I have different versions of a latex file that use toggles (from etoolbox). When I use latexdiff to compare the different versions, I can see that latexdiff is (practically) oblivious to changes in values of the toggles. For example, with file1.tex and file2.tex given below, the output of the latexdiff file (after compiling) is simply "content when boolFlag is true".
File 1.tex
\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\providetoggle{boolFlag}
\iftoggle{boolFlag}
{content when boolFlag is true}
{content when boolFlag is false}
\end{document}
File2.tex
\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\providetoggle{boolFlag}
\toggletrue{boolFlag}
\iftoggle{boolFlag}
{content when boolFlag is true}
{content when boolFlag is false}
\end{document}
The expected output is "content when boolFlag is false true".
How to get this correct latexdiff output?
The solutions I expect are
- A way to generate a file with replaced content when given the latex file with toggles, and the list of toggle variable values (similar to this, but with LaTeX rather than LuaLaTeX).
- Somehow make latexdiff aware of toggles (I suppose this is going to be hard; great if such a solution exists).