In a huge book I edit, I sometimes simplify (beautify, or change in some other way) the global macros defined in the preamble via \def
or \(new|renew|provide)command
and then observe whether the change had any effect on the compilation time and on the output PDF file. For this purpose, I measure the times for compiling the book via \usr\bin\time -p <my compilation command>
and compare the file before the changes with the file after the changes with diff -a book_before_the_changes.pdf book_after_the_changes.pdf
. When the macro simplification had no effect, the only change diff
spits out is a human-readable ACSII timestamp, which I can read off the screen. When the macro simplification did have some effect, diff
spits out a bunch of unreadable gibberish, which leads me to examine the situation further by a command such as diffpdf
, which takes way, way longer.
Recently, I switched from pdflatex
to xelatex
, which compresses the output PDF files in such a way that diff -a book_before_the_changes.pdf book_after_the_changes.pdf
ALWAYS outputs unreadable gibberish. Is there a way to handle this problem, e.g., by preventing the compression, or by quickly comparing the previous and the current version for meaningful changes via some other utility? If there is such a way, what would it be?