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

Compilation fails when \cite{} is added #236

Closed
RMeli opened this issue Jul 12, 2021 · 4 comments
Closed

Compilation fails when \cite{} is added #236

RMeli opened this issue Jul 12, 2021 · 4 comments

Comments

@RMeli
Copy link

RMeli commented Jul 12, 2021

Compilation fails when \cite{} is added. MWE below, but this also happens on more complex files where \cite{} is not empty.


File zero.tex:

\documentclass{article}
\begin{document}
Without reference.
\end{document}

File one.tex:

\documentclass{article}
\begin{document}
With reference \cite{}.
\end{document}

diff.tex (obtained with latexdiff zero.tex one.tex > diff.tex):

\documentclass{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL zero.tex   Mon Jul 12 18:13:38 2021
%DIF ADD one.tex    Mon Jul 12 18:13:37 2021
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}                      %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
\providecommand{\DIFmodbegin}{} %DIF PREAMBLE
\providecommand{\DIFmodend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE
%DIF LISTINGS PREAMBLE %DIF PREAMBLE
\RequirePackage{listings} %DIF PREAMBLE
\RequirePackage{color} %DIF PREAMBLE
\lstdefinelanguage{DIFcode}{ %DIF PREAMBLE
%DIF DIFCODE_UNDERLINE %DIF PREAMBLE
  moredelim=[il][\color{red}\sout]{\%DIF\ <\ }, %DIF PREAMBLE
  moredelim=[il][\color{blue}\uwave]{\%DIF\ >\ } %DIF PREAMBLE
} %DIF PREAMBLE
\lstdefinestyle{DIFverbatimstyle}{ %DIF PREAMBLE
	language=DIFcode, %DIF PREAMBLE
	basicstyle=\ttfamily, %DIF PREAMBLE
	columns=fullflexible, %DIF PREAMBLE
	keepspaces=true %DIF PREAMBLE
} %DIF PREAMBLE
\lstnewenvironment{DIFverbatim}{\lstset{style=DIFverbatimstyle}}{} %DIF PREAMBLE
\lstnewenvironment{DIFverbatim*}{\lstset{style=DIFverbatimstyle,showspaces=true}}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF

\begin{document}
\DIFdelbegin \DIFdel{Without reference }\DIFdelend \DIFaddbegin \DIFadd{With reference \mbox{%DIFAUXCMD
\cite{}}\hspace{0pt}%DIFAUXCMD
}\DIFaddend .
\end{document}

Compilation fails with the following error:

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b.
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -synctex=1 -interaction=nonstopmode -file-line-error -recorder -output-directory="/Users/rmeli/Desktop/latexdiff"  "/Users/rmeli/Desktop/latexdiff/diff.tex"'
------------
Set environment variable BIBINPUTS='/Users/rmeli/Desktop/latexdiff:'
Set environment variable TEXINPUTS='/Users/rmeli/Desktop/latexdiff:'
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(/Users/rmeli/Desktop/latexdiff/diff.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18> (/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/2021/texmf-dist/tex/generic/ulem/ulem.sty) (/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/color.sty (/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-def/pdftex.def)) (/usr/local/texlive/2021/texmf-dist/tex/latex/listings/listings.sty (/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2021/texmf-dist/tex/latex/listings/lstmisc.sty) (/usr/local/texlive/2021/texmf-dist/tex/latex/listings/listings.cfg)) (/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (/Users/rmeli/Desktop/latexdiff/diff.aux) (/usr/local/texlive/2021/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)
/Users/rmeli/Desktop/latexdiff/diff.tex:46: Extra }, or forgotten \endgroup.
\UL@stop ...z@ \else \UL@putbox \fi \else \egroup 
                                                  \egroup \UL@putbox \fi \if...
l.46 }
      \DIFaddend .
/Users/rmeli/Desktop/latexdiff/diff.tex:46: Extra }, or forgotten \endgroup.
\UL@stop ... \UL@putbox \fi \else \egroup \egroup 
                                                  \UL@putbox \fi \ifnum \UL@...
l.46 }
      \DIFaddend .
/Users/rmeli/Desktop/latexdiff/diff.tex:46: Missing } inserted.
<inserted text> 
                }
l.46 }
      \DIFaddend .
/Users/rmeli/Desktop/latexdiff/diff.tex:46: Missing } inserted.
<inserted text> 
                }
l.46 }
      \DIFaddend .
[1{/usr/local/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (/Users/rmeli/Desktop/latexdiff/diff.aux) )
(see the transcript file for additional information)</usr/local/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy6.pfb>
Output written on /Users/rmeli/Desktop/latexdiff/diff.pdf (1 page, 15136 bytes).
SyncTeX written on /Users/rmeli/Desktop/latexdiff/diff.synctex.gz.
Transcript written on /Users/rmeli/Desktop/latexdiff/diff.log.
Latexmk: Log file says output to 'diff.pdf'
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to '/Users/rmeli/Desktop/latexdiff/diff.log' for details
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.
Latexmk: Examining '/Users/rmeli/Desktop/latexdiff/diff.log'
=== TeX engine is 'pdfTeX'
Latexmk: Errors, so I did not complete making targets

OS: macOS 11.4
latexdiff: LATEXDIFF 1.3.1.1 (Algorithm::Diff 1.15 so, Perl v5.30.2)

@RMeli RMeli changed the title Compilation fails when Compilation fails when \cite{} is added Jul 12, 2021
@RMeli
Copy link
Author

RMeli commented Jul 12, 2021

This is actually a duplicate of #218, but fixes are not yet included in the latest version.

@ccaprani
Copy link

ccaprani commented Nov 16, 2021

FWIW, replicated using LATEXDIFF 1.3.1a (Algorithm::Diff 1.15 fast, Perl v5.32.1). Removing the \hspace{0pt} worked (found #218 after...c'est la vie).

@LuminousXLB
Copy link

I met the issue as well. But it seems to have been solved in 1.3.2.

@ftilmann
Copy link
Owner

ftilmann commented Mar 6, 2022

It seems this is fixed now. Closing

@ftilmann ftilmann closed this as completed Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants