Previously, a simple string compare was performed. However, if the
user enters a relative string to LATEX_OUTPUT_PATH ("." would be
expected), then the string compare to the absolute path in
CMAKE_CURRENT_SOURCE_DIR would fail even though the two paths point
to the same place.
Fix the problem by first converting LATEX_OUTPUT_PATH to an absolute
path.
A recent change from macros to functions changed the scoping rules
that caused the variable that held the raster scale to not be defined
where the build targets were generated (and thus scaling did not occur).
Previously, all image files were classified into groups of files supported
by latex and those supported by pdflatex. This change also defines files
that are not directly supported by either (and therefore always have to
be converted).
Also added svg, tiff, and gif files to the list of those supported.
Some distributions of LaTeX simply do not handle image files with multiple
periods properly (they cannot identify the extension/format correctly).
The warning suggests best practice of renaming files.
The behavior of GET_FILENAME_COMPONENTS with arguments NAME_WE and EXT
would identify the extension as everything after the *first* period.
This messes up the identification of file types, which pretty much
always have short extensions (like .tex, .bib, .eps, etc.).
Variables holding things like LATEX_ADD_DOCUMENT arguments have to cached
now that we are using functions instead of macros. They should be declared
internal since the user should neither see nor set them, but I had
misspelled INTERNAL.
This basically undo's commit acc72788dd.
Apparently, there IS harm in running bibtex on an aux file with no cites
in it. Bibtex will give you an error in this case. It is also unclear
whether it is even possible to use the standard cites when using bibtex
or if you ever want to. If you do, there is still the fallback of
adding the main target to the MULTIBIB_NEWCITES command, if you know
enough to do so.
Even when using multibib, it is possible to still use the main cite
commands that go to the main aux file. Might as well run bibtex there.
There should be no harm.
I was confused when this was presented to me. I thought it represented
multiple .bib files, which is not the case. It represents aux files
created with the \newcites command in the multibib package. I hope this
name will create less confusion.
When parsing arguments, there is an IF statement that compares an
argument to an argument name (such as BIBFILES, IMAGES, etc.).
If there exists a variable with the same name, then the IF statement
will also try to dereference the variable and compare them. Thus,
if that variable equaled one of the arguments, it would be incorrectly
identified as an argument name.
As an example, consider this CMake code.
set(BIBFILES mydoc.bib)
add_latex_document(mydoc.tex BIBFILES ${BIBFILES})
These arguments, obviously, expand to "mydoc.tex;BIBFILES;mydoc.bib".
When checking the argument mydoc.bib, you would expect it to be
considered an argument to BIBFILES. However, deep in the call stack
there is an if statement that expands to
IF (BIBFILES STREQUAL mydoc.bib)
Clearly we mean these to be unequal. But because BIBFILES is also
a variable containing mydoc.bib, CMake considers this to be true.
Thus, UseLATEX though mydoc.bib was the start of a list of bibliography
files rather than a bibliography file itself.
The problem is solved by prepending "non_a_var_" to each string we
are comparing.
IF (not_a_var_BIBFILES STREQUAL not_a_var_mydoc.bib)
This makes it highly unlikely that either side of this comparison
will be a variable that gets expanded.
Add all known auxiliary files that LaTeX generates to the clean target.
Also add the final generated files (dvi, ps, pdf). Also add these
files to the auxclean target, which differs from the regular clean
in that it does not clean things like images that take a while to
rebuild.
These changes include:
* General cleanup of extranous code.
* Remove USE_NOMENCLATURES option. This mimiced the USE_GLOSSARIES
option, which is only there for backward compatibility purposes.
* Change USE_NOMENCLATURE to USE_NOMENCL to tie it directly to the
nomencl package. This is defensive in case someone wants to use
a similar nomenclature package with a slightly different name.