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
514 stars 72 forks source link

Issue with biblatex, possibly with hyperref as well #199

Closed vsbuffalo closed 4 years ago

vsbuffalo commented 4 years ago

I am having a problem that is (hopefully) replicable with the following MRE. This looks to be related to this StackOverflow issue.

The error is:

(/usr/local/texlive/2019basic/texmf-dist/tex/generic/oberdiek/se-ascii-print.de
f)
! Extra }, or forgotten \endgroup.
\UL@stop ...z@ \else \UL@putbox \fi \else \egroup
                                                  \egroup \UL@putbox \fi \if...
l.65 ...eplicate design of \textcite{article2016}}
                                                  \DIFdelend \DIFaddbegin \D...

?

after running:

$ latexdiff  new.tex old.tex > diff.tex
$ latexmk -xelatex -pvc diff.tex

where the files are:

new.tex

\documentclass[11pt]{article}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[bibstyle=authoryear,citestyle=authoryear-comp,
                date=year,
                maxbibnames=9,maxnames=5,maxcitenames=2,
                backend=biber,uniquelist=false,uniquename=false,
                % style=apa,
                sorting=nyt,
                hyperref=true]{biblatex}

\addbibresource{biblio.bib}

\title{A Title}
\begin{document}
\maketitle

\section{Introduction}

Here's a citation \textcite{article2016}.

\end{document}

old.tex:

\documentclass[11pt]{article}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[bibstyle=authoryear,citestyle=authoryear-comp,
                date=year,
                maxbibnames=9,maxnames=5,maxcitenames=2,
                backend=biber,uniquelist=false,uniquename=false,
                % style=apa,
                sorting=nyt,
                hyperref=true]{biblatex}

\addbibresource{biblio.bib}

\title{A Title}
\begin{document}
\maketitle

\section{Introduction}

Test.

\end{document}

biblio. bib:

@ARTICLE{article2016,
  title    = "An article title.",
  author   = "Smith, Bob and Joe, George, and Bill, Taylor and Samantha, Lee
             and Harriet, Judy and Ben, George and Rodd, Leandra",
  journal  = "A Journal",
  volume   =  11,
  number   =  2,
  pages    = "5",
  month    =  feb,
  year     =  2016
}

Version:

$ latexdiff --version
This is LATEXDIFF 1.3.0  (Algorithm::Diff 1.15 so, Perl v5.18.4)
  (c) 2004-2018 F J Tilmann
ftilmann commented 4 years ago

There is an incompatibility between citing commands and the ulem package used for highlighting. The work-around is to protect citation commands with \mbox'es, which is done by default by latexdiff for the standard citation commands. This has now been extended to the citation commands used by biblatex. Disadvantage of the use of mbox'es is that no line breaks are introduced within the citation commands, leading to severely overfull boxes, particularly bad for \cites style multi-reference commands; if this is an issue I advise changing to a different markup style. Fixed in commit d214390