[Tex/LaTex] TexLive 2012 Ubuntu 13.04 – Correct way to set TEXMFHOME

installingtexlivetexmf

I have found numerous guides on how to do this (heres a couple):

but I have a different directory structure and none of the places present in the answers are present on my system.

Using locate I have found these locations of existing 'texmf.conf' files:

ben@ben-OptiPlex-9010:~$ locate texmf.cnf
/etc/texmf/web2c/texmf.cnf
/usr/share/doc/texlive-doc/latex/pgfplots/texmf.cnf
/usr/share/doc/texlive-pictures-doc/latex/pgfplots/texmf.cnf
/usr/share/texlive/texmf/web2c/texmf.cnf
/usr/share/texmf/web2c/texmf.cnf

All of the texmf.conf files (I ignore the ones embedded in /usr/share/doccontain lines that say something along the lines of do not edit this file directly). The options provided are:

  • /usr/share/texmf/web2c/texmf.cnf & /usr/share/texlive/texmf/web2c/texmf.cnf: Go and modify the texmf.cnf in ../../ which clearly does not exist. So create it? And in which location, texmf or texlive/texmf?

  • /etc/texmf/web2c/texmf.cnf: PLEASE DO NOT EDIT THIS FILE DIRECTLY. It is meant to be generated from files in /etc/texmf/texmf.d/ which only contains 00debian.cnf & 80tex4ht.cnff. Do I add a new one? Is the name important?

  • Go with what is suggested in some answers and just change the TEXMFHOME variable as I do with any other variable in Ubuntu (~/.pam_environment file these days)?

Best Answer

On writing this question, I found a definitive answer in the TEX (Live) on Debian guide on tug.

This part explains the best option and why:

The central configuration file /etc/texmf/texmf. cnf is special, as it defines all search paths for (almost) all programs in the TEX world. All the paths mentioned above are defined in it, but other behaviour (such as various size and security settings) is also controlled via this file. Since many different packages can contribute to the final texmf.cnf, we adopted a method often used in Debian: We install separate parts of the con- figuration file into a special directory /etc/texmf/ texmf.d and generate the final file from these snippets. Therefore, if a system administrator wants to change some setting, he should change the respective file in /etc/texmf/texmf.d and call update-texmf. Take as an example the setting of TEXMFHOME: In /etc/texmf/texmf.d/05TeXMF.cnf one can find TEXMFHOME = $HOME/texmf. However, in my own institution’s installation we had the input files always in $HOME/texlib, which I wanted to preserve. So I change the given line in /etc/texmf/texmf.d/ 05TeXMF.cnf and call (as root) update-texmf. The problem with this approach is that upon upgrade, either I have to reject changes of the file 05TeXMF.cnf, or I have to change the settings after every change of 05TeXMF.cnf in the Debian package. Here a bit of KPSE magic helps: As earlier settings in texmf.cnf override later ones, I can add a file 03local.cnf to /etc/texmf/texmf.d and put the changed TEXMFHOME variable there. Similar changes can be made for all the other settings in texmf.cnf. If you really must change as a user some setting in texmf.cnf, you have to create your own texmf. cnf and override the TEXMFCNF variable

So to answer my question, it seems the best approach in the Debian version of TexLive 2012 is to:

  1. Create a 03local.cnf file in /etc/texmf/texmf.d/ and add my TEXMFHOME assignment to it

  2. Apply the changes by calling sudo update-texmf