ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
518 stars 73 forks source link

Bibliography fails to compile in revtex4-2 when using DIFnomarkup #286

Open omnster opened 1 year ago

omnster commented 1 year ago

First, my apologies because this is apparently a revtex issue, not the latexdiff.

When I wrap \bibliography with a null environment, the compilation fails.

Here's an mwe to reproduce:

1.tex:

\documentclass{revtex4-2}
\newenvironment{DIFnomarkup}{}{}%
\begin{document}
This is a reference~\cite{examplereference}.
\begin{DIFnomarkup}
\bibliography{ex}
\end{DIFnomarkup}
\end{document}

ex.bib:

@article{examplereference,
    title = {Example Title},
    author = {Author, First and Author, Second},
    year = {2023},
    journal = {Example Journal},
    volume = {1},
    pages = {123456}
}

When I try to compile the document with

pdflatex 1.tex
pdflatex 1.tex
bibtex 1
pdflatex 1.tex

first, bibtex starts complaining about the Notes.bib file (however, 1.bbl is generated)

Illegal, another \bibdata command---line 4 of file 1.aux
 : \bibdata
 :         {1Notes}

Then, pdflatex fails with

(./1.bbl
! Undefined control sequence.
l.54 ...info {title} {Example title},\ }\href@noop
                                                   {} {\bibfield  {journal} ...

If I comment out the DIFnomarkup lines in the mwe, the compilation runs without errors.

Versions:

pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023/Arch Linux)
This is BibTeX, Version 0.99d (TeX Live 2023/Arch Linux)

Again, I am sorry for reporting it here, as this is not a latexdiff issue, but I would really appreciate any help to get rid of the compilation error.