我定义了一个自定义颜色,用于跟踪更改包changes.sty
。效果很好除了当我向命令的可选参数添加注释参数时。
有人可以确认存在这种行为并提出解决方法吗?
MWE 是:
\documentclass[14pt]{extarticle}
\usepackage[margin=1.0in]{geometry}
\usepackage{color}
\definecolor{darkgreen}{rgb}{0.0,0.6,0.1} % Custom colour
\usepackage{changes}
\definechangesauthor[color=magenta]{AA}
\definechangesauthor[color=darkgreen]{BB} % Author BB uses custom colour
\begin{document}
% No comment or custom colour: WORKS FINE
Quick \added[id=AA]{brown} fox jumped.
% Comment but no custom colour: WORKS FINE
Quick \added[id=AA,comment={Not red}]{brown} fox jumped.
% No comment or custom colour: WORKS FINE
Quick \added[id=BB]{brown} fox jumped.
% Comment and custom colour: GENERATES ERROR (Line 19)
Quick \added[id=BB,comment={Not red}]{brown} fox jumped.
% ! Package xcolor Error: Undefined color model `'.
%
% See the xcolor package documentation for explanation.
% Type H <return> for immediate help.
% ...
%
% l.19 Quick \added[id=BB,comment={Not red}]{brown}
% fox jumped.
\end{document}
附言我尝试通过为注释参数提供较宽的边距来美化示例,但changes.sty
似乎没有使用这些边距。在 PDF 文档中搜索“宽度”没有找到任何我认识的参数,用于控制包含注释的边距气球的宽度。
答案1
更改包加载xcolor
,因此颜色按照此包的语法进行处理。但是您在包的语法中定义了颜色color
,这让人感到困惑xcolor
。要么加载 xcolor 而不是 color,要么将您的定义移到changes
包后面:
\documentclass[14pt]{extarticle}
\usepackage[margin=1.0in]{geometry}
\usepackage{changes}
\definecolor{darkgreen}{rgb}{0.0,0.6,0.1} % Custom colour
\definechangesauthor[color=magenta]{AA}
\definechangesauthor[color=darkgreen]{BB} % Author BB uses custom colour
\begin{document}
% No comment or custom colour: WORKS FINE
Quick \added[id=AA]{brown} fox jumped.
% Comment but no custom colour: WORKS FINE
Quick \added[id=AA,comment={Not red}]{brown} fox jumped.
% No comment or custom colour: WORKS FINE
Quick \added[id=BB]{brown} fox jumped.
Quick \added[id=BB,comment={Not red}]{brown} fox jumped.
\end{document}