TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have got a very peculiar question I'd like to ask about my latex processor:

  • In my school we are using the pdfTeXk backend. At some point there was a need to make a few configuration changes within the /usr/share/texmf/web2c/texmf.cnf configuration file (essentially set some values).

  • However since it's the school server I'm working on, I don't have root access to modify that file. Instead, we were told to create a texmf folder ~/texmf under our home directory and put any additional packages and configuration files in there should we needed to. And so I did by creating ~/texmf/texmf.cnf and placing my custom settings in it.

Now, the system is set to look for its configuration files using an environmental variable called TEXMFCNF. The default configuration location can be checked by issuing kpsewhich texmf.cnf. The problem is that if I set it to point to my custom configuration folder at ~/texmf it will ignore the default one in /usr/share/texmf/web2c (which contains many other settings I need) and only fetch mine. The same happens the other way around.

Eventually the question is: How do I make latex fetch both of the texmf.cnf files?

(This question is an exact replica of this one: http://stackoverflow.com/questions/11854289/how-does-latex-source-multiple-configuration-files and is posted here after suggestion of the user Andrea Bergia)

share|improve this question

According to the Kpathsea manual,

Kpathsea reads all 'texmf.cnf' files in the search path, not just the first one found; definitions in earlier files override those in later files. Thus, if the search path is '.:$TEXMF', values from './texmf.cnf' override those from '$TEXMF/texmf.cnf'.

In the TEXMFCNF variable you can use colons to separate several paths to search for texmf.cnf files in. An empty path entry should correspond to searching the system paths. Thus, you should be able to set TEXMFCNF to "~/texmf/:" (with a trailing colon) to have the system use settings from your texmf.cnf, if present, and use the system settings otherwise.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.