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

process substitution error #293

Closed dalbandea closed 7 months ago

dalbandea commented 8 months ago

I currently have LATEXDIFF 1.3.1a (Algorithm::Diff 1.15 fast, Perl v5.34.0). I would like to use latexdiff in the command line with process substitutions instead of writing the paths to the .tex files. However, commands like the following,

latexdiff <(git show 8c761da:paper.tex) <(git show 61f1d42:paper.tex) > diff.tex

yield the error

\\end\{document\} present but not \\begin\{document\}. at /usr/bin/latexdiff line 2256.

ftilmann commented 7 months ago

I am not so familiar with process substitution but with the < signs it looks like a kind of input re-direct. I am a little dubious whether this can work to substitute two different files. An additional difficulty is that latexdiff needs to open the input files twice, once to check the encoding, and then to re-open with the correct encoding [if that were the only problem, I would consider an option to suppress the first opening and just assume the encoding]. Is there a reason why you do not use latexdiff-vc --git which I think more or less can achieve what your example does. Otherwise it would be quite trivial to write a little shell script wrapper that creates temporary files from the git show and feeds them to latexdiff. I will close this for now as I don't see how I could debug this.