PDF: revert fix for #4484 (only compress images on last run).

Closes #4755.

This will mean some increase in the time it takes to
produce an image-heavy PDF with xelatex, but it will
make tables of contents correct, which is more important.

Note that the production time should also be decreased
by the previous commit, which fixed a logic error
affecting the number of runs.  That change might mitigate
the effect of this one.
This commit is contained in:
John MacFarlane 2018-07-06 23:51:20 +02:00
parent 55e8cb07d0
commit 146555e636

View file

@ -285,12 +285,7 @@ runTeXProgram verbosity program args runNumber numRuns tmpDir source = do
let file' = file
#endif
let programArgs = ["-halt-on-error", "-interaction", "nonstopmode",
"-output-directory", tmpDir'] ++
-- see #4484, only compress images on last run:
if program == "xelatex" && runNumber < numRuns
then ["-output-driver", "xdvipdfmx -z0"]
else []
++ args ++ [file']
"-output-directory", tmpDir'] ++ args ++ [file']
env' <- getEnvironment
let sep = [searchPathSeparator]
let texinputs = maybe (tmpDir' ++ sep) ((tmpDir' ++ sep) ++)