Closed gpelouze closed 3 years ago
@gpelouze has this issue been fixed? As long as the "\cite{}" exists regardless of \hsapce{0pt} from Latexdiff, the complilation fails. I am using Overleaf with TexLive 2021 (2020, 2019, and 2018 does not work neither).
@xiang-yu can you provide an MWE. The merge request from @gpelouze is supposed to have fixed this, and worked at least for me (on TexLive 2019/Debian). Have you verified that your version of latexdiff contains the fix?
@ftilmann Thanks. latexdiff 1.3.2 did the trick.
Summary
As described in this Stackexchange post, using latexdiff with latest versions of LaTeX and citation commands produces the following error:
Steps to reproduce
The bug can be reproduced with pdfTeX 3.14159265-2.6-1.40.21, ulem 2019/11/18, and the following files:
old.tex
new.tex
Running
latexdiff old.tex new.tex > diff.tex
produces the followingdiff.tex
file (unused parts of the header have been removed for clarity):Upon compilation, it produces the following error:
Reason for the bug
The culprit seems to be the
\hspace{0pt}
. (Removing it fromdiff.tex
suppresses the error and results in the expected document.)It was added in latexdiff v1.2.1: “introduce an invisible space (\hspace{0pt} after \mbox{..} auxiliary commands (not in math mode), to allow line breaks between added and deleted citations” (changelog).
Proposed solution
Replacing the
\hspace{0pt}
statement with its TeX equivalent\hskip0pt
seems to fix the issue, while still allowing line breaks between added and deleted citations.This can be implemented by replacing the following line:
by