latexdiff-vc: generate .bbl files before calling latexdiff #127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My git project does not track the
.bbl
files, which made sense at the time of creating it since those files are a product, not a source. As a result,latexdiff-vc
fails to generate the bibliography and all references appear as [??].This patch is a quick and ugly hack I made into the
latexdiff-vc
code (as downloaded from CTAN, which seems to be slightly different from the one here on github) that callsbibtex
into$file1
and$file2
in order to generate the.bbl
files before callinglatexdiff
. However it will probably need some work before being ready to be merged:$flatten
and/or$run
) before callingbibtex
, but I was not sure what would be the way to go. Or maybe the whole block should be moved inside theif ( defined($flatten) )
parts where$olddir
and$newdir
are declared.[pdf]latex
should be called with-draftmode
in order to improve the speed (then again, maybe this should be done on ALL calls to$CFG{LATEX}
except the last one), but I don't know if this option islatex
-specific and thus unsupported by other LaTeX compilers (then again, this is probably no different for--interactive=batchmode
as well).cd '$fileNpath';
in the latex-and-bibtex call I added because otherwise LaTeX complained about relative '\input's; not sure if this was the most elegant way to go but it Just Works™.$olddir
and$newdir
are generated, because I was having trouble when callingpdflatex
on/tmp/me7swkOS1w/latexdiff-vc-HEAD~1/tex/main.tex
because of the damned~
. On second thought, maybe having donecd
to that directory first and then calling the latex and bibtex commands without the path would have been a better option. (I hope nobody uses this for comparing commitsHEAD~2
andHEAD^2
for example... maybe this wasn't such a good idea after all.)Please do not consider this as a ready-to-use PR but rather as a suggestion for improvement; as I said it was an ugly hack which will likely need some work and reviewing before being ready (in fact my original idea was to report this as a regular issue, but the patch seemed more convenient). Feel free to ditch the whole PR if you like the idea but prefer to rewrite it from scratch :)
I tested the program with my particular use case and it worked, but I didn't perform extensive testing (I did this in a couple of hours; I just learned about this software today... by the way, kudos to the creators!)