My machine has a mixture of TeX systems dating from the eighties until today. I'm sending TeX files to an organization and I would like them to run smoothly (without errors or missing resources) on a standard TeX Live 2018 distribution.

How can I install a second up-to-date TeX Live distribution in some directory so that I can be sure that, once inside that directory, kpathsea will not use any resource from the surrounding hard disk, but only the files of the standard TeX Live distribution in that directory?

I know that this can be attained by using a virtual machine, but as virtual machines take a lot of space and are a bit heavy, I would prefer a method of obtaining the same results without using virtual machines.

  • 1
    If you are familiar with git, an option could be to use continuous integration.In that case, this might be helpful.
    – Abby
    Oct 24, 2018 at 8:58
  • That would require opening an account on travis, preparing make files, etc. My question is: what would be the test file? How can travis assert that compilation of a latex file has succeeded?
    – yannis
    Oct 24, 2018 at 9:25
  • In principle, all you need to do is ensure that the environment variables used by kpathsea and friends, and your PATH environment variable, only point to your TexLive2018 implementation. I don't really see how @Abby's comment is helpful (but I admit didn't spend much time looking at the GitHub link!)
    – alephzero
    Oct 24, 2018 at 9:27
  • Using Travis you can specify which file it should compile (in the travis.yml, from the top of my head). The build will pass if the compilation has succeeded, and it will fail if the compilation did not succeed.
    – Abby
    Oct 24, 2018 at 10:30
  • OK, but the error may be a semantic one (not a syntax error, not making TeX stop), and this travis will not detect, isn't it?
    – yannis
    Oct 25, 2018 at 10:08

1 Answer 1


You just need to use the binaries from the 2018 directory: all them set the default locations based on their installed location so they will only use the 2018 texmf-tree plus TEXMFHOME which defaults to ~/texmf so if you unset TEXMFHOME and use /usr/local/texlve/2018/bin/*/pdftex Then it will use 2018 texlive.

Of course if you use luatex or xetex it will (by default) also use the system fonts.

If you want confirmation you can use pdftex -recorder option and it will give a full list of all files used.

  • Let us imagine I have a directory called TESTING, and in that directory I put a texmf.cnf file with paths covering standard TeX Live 2018 as well as some subdirectories of TESTING. Will then every binary (pdflatex, makeindex, bibtex, etc.) I will launch inside TESTING use texmf.cnf and read the paths from it? Or do I have to tell the binaries explicitly that I want to use that texmf.cnf?
    – yannis
    Oct 25, 2018 at 10:11
  • @yannis texmf.cnf will be read from the current directory but normally I don't need that if I want to test with tl2016 for example I just use /usr/local/texlive/2016/bin/x86_64-cygwin/pdflatex file and that binary will use the texlive 2016 tree then in the same directory I can go pdflatex file and it will use the 2018 tree. Obviously if you have local texmf.cnf in the current directory that changes things as both the binaries would read that config file and so use the same search tree. Oct 25, 2018 at 10:25
  • In the "private" texmf.cnf (the one that normally lies in /usr/local/texlive/2017/) there is a HOMETEXMF variable. Can that variable be a relative path ".", meaning the current directory where the file texmf.cnf is placed? Or must it be an absolute path?
    – yannis
    Oct 25, 2018 at 10:53
  • I just tried it and the texmf.cnf used was that from the standard directories and not from the current one: kdebug:fopen(/usr/local/texlive/2018/texmf.cnf, r) => 0x7fff944e5030 kdebug:fclose(0x7fff944e5030) => 0 kdebug:fopen(/usr/local/texlive/2018/texmf-dist/web2c/texmf.cnf, r) => 0x7fff944e5030 kdebug:fclose(0x7fff944e5030) => 0 How can I force pdftex to read texmf.cnf from the current directory?
    – yannis
    Nov 10, 2018 at 14:29
  • I found the answer in tex.stackexchange.com/questions/410592/…
    – yannis
    Nov 10, 2018 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .