Short question
Seems like --flatten
doesn't work properly with latexdiff-vc
.
How can I get this working, without reverting to my elaborated workflow described below?
Context
I track the history of my Latex documents using SVN. I've recently started using latexdiff
to generate PDFs highlighting the changes between certain revisions.
My initial workflow of svn+latexdiff was (1) to copy over the whole svn folder to a temporary lcoation, (2) update this to the relevant revision, (3) go back to the original svn folder and (4) start latexdiff
specifying the relevant folders and files. As I split up my latex document in multiple files using \input{}
statements, I have to use the latexdiff --flatten
option to get this working. So, at the Windows command prompot I type something like:
latexdiff --flatten ..\..\copy_at_r48\main.tex main.tex > diff.tex
I figured there must be an easier way and bumped into latexdiff-vc
which supports specifying svn revisions directly.
However, the following doesn't seem to work, as the old versions of linked files doesn't seem to get retrieved/flatten; there are only DIFF markings in the main content:
latexdiff-vc --flatten -r 48 main.tex
Best Answer
I've written a very simple Windows batch script (
latexdiff-svn.bat
) that automated my described workflow. It exports a given revision of the the svn working copy to a temporary folder (typically underC:\Users\username\AppData\Local\Temp
), performslatexdiff --flatten
, and deletes the temporary folder.The actual barebones script is only 5 lines
And below a slightly more elaborated version that does some basic checking on the parameters, and provides some friendly clues to the user. You can copy-paste the code in a file named for example 'latexdiff-svn.bat'
Note: the
latexdiff
script used with the--flatten
option outputs a few DEBUG lines. If you want to suppress these (without fixing the perl script itself), see the solution to this stackoverflow question: https://stackoverflow.com/questions/11362041/how-to-suppress-specific-lines-in-windows-cmd-output