我定義了一種與 track-changes 套件一起使用的自訂顏色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}