3

When documenting a class/package with the doc package (or some derivative), what's the best way of including a literal equals sign in the text of a \changes command? Since = is used as a special character in the entries, anything before it is stripped.

MWE:

\documentclass[margin=10pt,varwidth=25em]{standalone}
\usepackage{doc}
\RecordChanges
\begin{document}
\changes{v1}{2020-01-01}{Before=After}
\PrintChanges
\end{document}

Output:

General: After ... 1

Wrapping in braces doesn't work. The best I've come up with is to define a macro in the preamble and then include the command sequence as a string, like this:

\documentclass[margin=10pt,varwidth=25em]{standalone}
\usepackage{doc}
\RecordChanges
\def\MyEquals{=}
\begin{document}
\changes{v1}{2020-01-01}{Before\string\MyEquals\space After}
\PrintChanges
\end{document}

But is there a more elegant solution?

2

makeindex has a set of special characters, and gglo.ist sets = as the actualchar. You can quote that =, so that makeindex will treat it literally, using the quotechar. To quote a character for makeindex you just prepend it with the quotechar, which in gglo.ist is !, so you can write:

\changes{v1}{2020-01-01}{Before!=After}

Running makeindex -s gglo.ist -o test.gls test.glo on that file you get:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.