Tips, Tricks, and Solutions


The LaTeX changes package
Ekkart Kleinod  • 

This page contains tips, tricks, and solutions for the changes package.

\comment conflict with tikz externalization.

See ticket 67.

The problem is using the TikZ library external which leads to a conflict with the todo package:

! Package tikz Error: Sorry, the system call 'lualatex -halt-on-error -interact
ion=batchmode -jobname "./example-figure0" "\def\tikzexternalrealjob{example}\i
nput{example}"' did NOT result in a usable output file './example-figure0' (exp
ected one of .epsi:.eps:.ps:). Please verify that you have enabled system calls
. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'w
rite 18' or something like that. Or maybe the command simply failed? Error mess
ages can be found in './example-figure0.log'. If you continue now, I'll try to
typeset the picture.

See the tikz package documentation for explanation.

One solution is not to use todo for comments (e.g. via \usepackage[commentmarkup=uwave]{changes}). Another solution has been found by Yingsheng Huang (@Turukano), just rename the todo macro:

\makeatletter
\renewcommand{\todo}[2][]{\tikzexternaldisable\@todo[#1]{#2}\tikzexternalenable}
\makeatother

In summary, take a look at the ticket and the following example files:

command already defined

Some packages use the same names for their commands as the changes package, in particular \comment and \highlight are not originally named commands.

In this case, changes may prefix its commands to avoid naming collisions. This is controlled by the commandnameprefix option.

In order for this to work, the changes package has to be loaded after the other packages or commandnameprefix=always must be selected.

\documentclass{article}

\usepackage{comment}
\usepackage[commandnameprefix=ifneeded]{changes}

\begin{document}

    \chcomment{changes comment}

    \added{changes addition}

\end{document}

protect for commands that generate errors

Sometimes it can help to write \protect in front of the command in question to protect it. Doesn`t have to work, but is often worth a try.

This code generates an error with \nonumber:

\documentclass{scrartcl}

\usepackage{changes}
\usepackage{amsmath}

\begin{document}

\added{
    \begin{alignat}{2}
        a &= b \nonumber\\
        b &= c
    \end{alignat}
}

\end{document}

With \protect the error no longer occurs:

\documentclass{scrartcl}

\usepackage{changes}
\usepackage{amsmath}

\begin{document}

\added{
    \begin{alignat}{2}
        a &= b \protect\nonumber\\
        b &= c
    \end{alignat}
}

\end{document}