LaTeX "helpfully" split across lines (and which fowled up our regex).
Get around the problem by instead searching for "LaTeX Warning:" at
the beginning of the line. Hopefully (1) all versions of LaTeX
actually write this out and (2) it is not used for trivial
warnings.
This prevents a needless dependency on ImageMagick if all images are already
in formats suitable for pdflatex, but would need to be converted to .eps for DVI builds.
When using the synctex option with pdflatex, it writes out a file
containing paths to the input files. The problem is that
UseLATEX.cmake copies all the input files, so you get a link to
the copy, not the original. To correct for this UseLATEX.cmake
changed the directories back to the input files, but it only
did so for relative paths. pdflatex writes out absolute paths,
so these were not properly converted. This should fix that issue.
I also noticed that some of the "input" files are actually those
produced by latex programs (e.g. .aux, .bbl). Trying to convert
these paths to the input would cause pointers to files that do
not exist. To try to correct for this I only convert paths of
files of known extensions.
There was a reference to using VERSION_GREATER_EQUAL. However, this
conditional is only supported in CMake 3.7 and better. Instead,
use VERSION_GREATER, which is supported in much older versions
of CMake.
When running LaTeX in batch mode, it might not print any output when a
failure occurs. So, when running in this mode, cat out the log failure
if a LaTeX error occurs.
The implementation for this wraps the latex call in a CMake script
that runs latex and checks the return value. If not a success value,
reads and then prints the log.
They make the output much less verbose and also add file/line numbers
to errors. This mode is much nicer output for build systems. Thanks to
Nikos Koukis for the suggestion.
The ps2pdf command is really just a script, and on the Windows port
it is a bat file. The Windows command interpreter for bat files treat
= as a special character, so on Windows you should use # instead.
The _FLAGS CMake variables are specified as space-separated arguments
to make them easier to type. However, they have to be converted to CMake
lists to pass them to CMake commands that run programs. Otherwise they
will be interpreted as a single argument.
There were some separate_arguments commands to do just that. However,
I think when I changed over from defining macros to defining functions,
the scope of the separated arguments broke. This should fix that.
A user reported that converting a pdf to an eps was failing because his
pdftops program, which was a recent build/release, did not support the
-r flag, which sets the resolution used when objects are rasterized.
After some searching, I believe the issue is that there are two versions
of pdftops running around: one from Poppler and one from Xpdf. The former
supports the raster resolution flag, the latter does not.
Rather than jump through hoops trying to identify which one is installed
on a system, I just removed the flag. The consequence is that rasterized
objects will use a smaller resolution (the default is 300 dpi, and we were
setting it to 600 dpi). However, if you start engaging rasterization, then
the result probably is not looking as good anyway.
It looks like with the release of ImageMagick 7.0 that the name of the
convert program has been renamed to magick. Most implementation have a
link from convert to magick, but the windows install by default does
not provide a convert program. To make sure it works everywhere, search
for both programs (searching for magick first).
Previously, UseLATEX.cmake was calling latex_needit for the
BIBLATEX_COMPILER variable. However, this variable was never set
because the FindLATEX module sets the BIBER_COMPILER variable instead.
Look for that variable.
Other minor changes include updating the documenting comments and calling
wantit rather than needit on the biber compiler just in case there are
latex installations without it.