I have an edition of a document and I'd like to create a new edition with corrections on several places.
What's the best way to create a list of corrections?
I would imagine encapsulating the 'wrong' text with some command (e.g. \wrong{ }
), and then encapsulating the corrected text by some other command (e.g. \fixed{ }
).
Then I could (a) get a list of corrections automatically by the page and section of each correction, and (b) toggle the display of the corrected version.
Is there anything like that I can use?
Thanks.
EDIT: I used the post proposed in the comments and modified to make this:
EDIT 2: Following the responses I made this correct as well, for future use. So this snippet now does what it should.
\documentclass{journal}
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\def\correctionslist{}
\long\def\rightwrong#1#2{#1\edef\curpos{\arabic{section}.\arabic{subsection}}\expandafter\global\expandafter\addto\expandafter\correctionslist\expandafter{\curpos: RIGHT: #1\\ WRONG: #2 \par}}
\begin{document}
\newcommand{\curpos}{\arabic{section}.\arabic{subsection}}
\section{How to make cookies}
\subsection{Why do we want cookies?}
Cookies are tasty.
\rightwrong{
We like any type.
}
{
But only if they're Oreos.
}
\subsection{How do we make them?}
We need flour and sugar.
\rightwrong{
Some sugar will suffice.
}
{
Lots of sugar.
}
\section{List of corrections}
\correctionslist
\end{document}
The problem is that \curpos
is evaluated only when I call \correctionslist
, so the section.subsection numbering is wrong. How can I solve this?
Thanks again.
\wrong{}
command. And for\fixed{}
you can create your own easily.commenting
package