1

I defined a custom color for use with the track-changes package changes.sty. It works well except when I add a comment argument to the optional arguments of a command.

Can anyone confirm getting this behaviour and suggest a work-around?

The MWE is:

\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}

P.S. I tried to pretty up the example by giving wide margins for the comment arguments, but changes.sty doesn't seem to use those margins. A search of the PDF documention for "width" doesn't turn up anything that I recognize as a parameter for controlling the width of the margin balloons for containing the comments.

1 Answer 1

3

The changes package loads xcolor and so colors are processed in the syntax of this package. But you defined your color in the syntax of the color package, and this confuses xcolor. Either load xcolor instead of color or move your definition behind the changes package:

\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}
1
  • Thanks, Ulrike. That works perfectly. And Googling the difference between color and xcolor packages was educational in that there are many packages with x-prefix counterparts. On a separate note, would you be able to comment on the closing paragraph of my originally posted question? Should I spin that out to its own question? Commented Mar 6, 2023 at 14:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.