[Tex/LaTex] Placing temporary files outside of dropbox for compilation: issues with openout_any and nomenclature

document-configurationenvironment-variables

So I store my TeX source files in dropbox for backup and synchronization. Of course, it's annoying when you compile to have dropbox upload and download the changes to the temporary files, so you want to put these somewhere else. Since I use Mac OS X and Linux, I chose /var/tmp/texBuild as my output directory for these files. My Makefile includes simply:

TMPDIR = /var/tmp/texBuild
FC = pdflatex -output-directory $(TMPDIR)

When creating a nomenclature, it complained that it was not authorized to write to that directory. A quick search gave me an answer: edit the texmf.cnf to change the variable openout_any from p to a. However I then found this question: Open a file whose name start with a dot and other strangely named files? where it is suggested to not do that system wide. Where can I set this environment variable? In my Makefile? Should I rather pick another output directory than /var/tmp? I realize I could have just made a comment to that other question but hopefully my question is sufficiently different to warrant its own question.

Best Answer

It's not necessary to alter a texmf.cnf file and it's not recommendable either.

A call such as

openout_any=a pdflatex file

(assuming Bash or similar shell) will override the setting of the variable for the current job. I believe that this can be easily implemented in a Makefile.

Altering a texmf.cnf file exposes you to security issues. Also this way of doing is not safe, but it's more controllable, as only the current process (and its children, if any) will "see" that setting of the environment variable.