1

I am trying to show the changes in the References by using latexdiff.

In the beginning, I used latexdiff old.tex new.tex > diff.tex, then I run the diff.tex file, the changes were not shown.

Then I followed here to produce .bbl file by latexdiff old.bbl new.bbl > diff.bbl.

After that, I run the diff.tex file again, but got errors. Error messages like this: Something's wrong--perhaps a missing \item. \DIFdelend \bibitem{c29}. Something's wrong--perhaps a missing \item. \bibitem{c30}

I tried latexdiff --append-textcmd=... or latexdiff --append-safecmd=... or latexdiff --flatten... to produce the .bbl file, however, all did not work for me.

How can I solve this problem? Or is there any other ways to show the changes in References. Thanks.

Here are some examples:

ref.bib:

@article{c29,
title = "Thermal comfort: use of controls in naturally ventilated buildings",
journal = "Energy and Buildings",
volume = "33",
number = "3",
pages = "235 - 244",
year = "2001",
issn = "0378-7788",
doi = "https://doi.org/10.1016/S0378-7788(00)00087-6",
author = "Iftikhar A Raja and J.Fergus Nicol and Kathryn J McCartney and Michael A Humphreys",
keywords = "Buildings, Thermal comfort, Natural ventilation, Energy, Controls, Indoor temperature, Outdoor climate"
}

@article{c30,
title = "Predictive controllers for thermal comfort optimization and energy savings",
journal = "Energy and Buildings",
volume = "40",
number = "7",
pages = "1353 - 1365",
year = "2008",
issn = "0378-7788",
doi = "https://doi.org/10.1016/j.enbuild.2007.12.007",
author = "Roberto Z. Freire and Gustavo H.C. Oliveira and Nathan Mendes",
keywords = "Predictive control, Thermal comfort, Energy saving, HVAC systems"
}

diff.bbl:

%DIFDELCMD < %%%
\DIFdelend \bibitem{c29}
Raja IA, Nicol J, McCartney KJ \DIFdelbegin \DIFdel{et~al}\DIFdelend \DIFaddbegin \DIFadd{and Humphreys MA}\DIFaddend .
\newblock Thermal comfort: use of controls in naturally ventilated buildings.
\newblock \emph{Energy and Buildings} 2001; 33(3): 235 -- 244.
\newblock \doi{https://doi.org/10.1016/S0378-7788(00)00087-6}.

\bibitem{c30}
Freire RZ, Oliveira GH and Mendes N.
\newblock Predictive controllers for thermal comfort optimization and energy
  savings.
\newblock \emph{Energy and Buildings} 2008; 40(7): 1353 -- 1365.
\newblock \doi{https://doi.org/10.1016/j.enbuild.2007.12.007}.

old.bbl:

\bibitem{c29}
Raja IA, Nicol J, McCartney KJ et~al.
\newblock Thermal comfort: use of controls in naturally ventilated buildings.
\newblock \emph{Energy and Buildings} 2001; 33(3): 235 -- 244.
\newblock \doi{https://doi.org/10.1016/S0378-7788(00)00087-6}.

\bibitem{c30}
Freire RZ, Oliveira GH and Mendes N.
\newblock Predictive controllers for thermal comfort optimization and energy
  savings.
\newblock \emph{Energy and Buildings} 2008; 40(7): 1353 -- 1365.
\newblock \doi{https://doi.org/10.1016/j.enbuild.2007.12.007}.

new.bbl:

\bibitem{c29}
Raja IA, Nicol J, McCartney KJ and Humphreys MA.
\newblock Thermal comfort: use of controls in naturally ventilated buildings.
\newblock \emph{Energy and Buildings} 2001; 33(3): 235 -- 244.
\newblock \doi{https://doi.org/10.1016/S0378-7788(00)00087-6}.

\bibitem{c30}
Freire RZ, Oliveira GH and Mendes N.
\newblock Predictive controllers for thermal comfort optimization and energy
  savings.
\newblock \emph{Energy and Buildings} 2008; 40(7): 1353 -- 1365.
\newblock \doi{https://doi.org/10.1016/j.enbuild.2007.12.007}.
2
  • Can you provide a minimal working example of both bbl file and the old and new files witj just one or two references. The workflow described in the link works for me (in general), but it depends on the markup style. What is also problematic is when the very first reference is deleted. Currently you might not have a chance but to patch that up by editing the diff file.
    – frederik
    May 19, 2020 at 15:30
  • Thanks for your reply. The only change I've made is the author name list. Not all authors were shown in the old one, with "et al." at the end. In the new one, I removed "et al." and added all authors. I revised the post by adding some examples. Please check it.
    – Yang
    May 20, 2020 at 1:48

2 Answers 2

2

Rather than manually arranging bbl blocks, I got my diff document to compile by passing the --allow-spaces and --disable-citation-markup arguments to latexdiff. See https://github.com/ftilmann/latexdiff/issues/174#issuecomment-501177660

0

I solved my question based on the comment from @frederik .

Consideration:

latexdiff checks two files sequentially, errors occur if the reference block changed its position. For example, we have an old.bbl file with contents:

block 1
block 2
block 3

For the revised version, if the content of block 2 has been modified and denoted as block* 2, we have a new1.bbl with contents:

block 1
block* 2
block 3

Now we run latexdiff old.bbl new1.bbl > diff1.bbl, and run diff.tex (uses diff1.bbl) with no error.

If the block* 2 is moved to a different position (lets say the new file becomes new2.bbl), e.g.,

block 1
block 3
block* 2

Then we run latexdiff old.bbl new2.bbl > diff2.bbl, and run diff2.tex (uses diff2.bbl) with errors.

Solution:

I changed the reference block positions of the new.bbl file, so that the new.bbl and old.bbl have the same sequence of reference blocks. Then run latexdiff old.bbl new.bbl > diff.bbl, and run diff.tex. I think one can also change the old.bbl file as long as they have the same sequence of reference blocks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .