Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contents of \else is displayed as removed when an \iftrue block is deleted #261

Open
MBradbury opened this issue Mar 14, 2022 · 1 comment
Labels

Comments

@MBradbury
Copy link

If there is text contained within an \iftrue block and the \iftrue logic is then removed in an edit, latexdiff will display the contents of the else block as deleted. However, the contents of the produced document never contained the text in the else block. Ideally, latexdiff should not report that the document's contents have changed.

a.tex:

\documentclass{article}
\begin{document}
\iftrue
hello
\else
hi
\fi
\end{document}

b.tex:

\documentclass{article}
\begin{document}
hello
\end{document}

c.tex:

\begin{document}
\DIFdelbegin %DIFDELCMD < \iftrue
%DIFDELCMD < %%%
\DIFdel{hello
 }%DIFDELCMD < \else
%DIFDELCMD < %%%
\DIFdel{hi
}%DIFDELCMD < \fi
%DIFDELCMD <  %%%
\DIFdelend \DIFaddbegin \DIFadd{hello
 }\DIFaddend\end{document}

Version information (I'm using 4f17f7b off master):

$ latexdiff --version
This is LATEXDIFF 1.3.3a (Algorithm::Diff 1.1903, Perl v5.30.0)
  (c) 2004-2022 F J Tilmann
@ftilmann
Copy link
Owner

I can see the problem but this would be very difficult to fix as latexdiff would have to follow the whole logic of the conditional expressions. The promise of latexdiff is that it works with standard latex and ignores TeX commands such as the \if statements. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants