13

I am running Ubuntu 12.04 which came with TeX Live 2009 pre-installed. I want to create a local texmf tree at the location ~/Dropbox/mylocaltexmf/, so that I can place my own .sty files in my Dropbox which automatically syncs across multiple computers. How do I make a local texmf tree visible to TeX Live? Note that I do not want to place the .sty files in the default TEXMFHOME.

Similar questions but on different operating systems:

I tried to follow the solution in How to make LaTeX see local texmf tree, but when I ran the command tlmgr it seems that there is no such command on my system.

$ tlmgr
No command 'tlmgr' found, did you mean:
 Command 'vlmgr' from package 'qdbm-util' (universe)
 Command 'rlmgr' from package 'qdbm-util' (universe)
tlmgr: command not found
8
  • 3
    You need to install "vanilla" TeX Live.
    – Adam Liter
    Feb 18, 2014 at 2:58
  • Just out of curiosity: why is ~/mylocaltexmf going to be better than ~/texmf (= normal TEXMFHOME)? But, anyway, look in texmf.cnf for these settings. Or install TeX Live from TUG, as suggested. Or use symlinks.
    – jon
    Feb 18, 2014 at 3:17
  • 1
    See my edit. The real folder I want to be my local texmf tree at is actually a folder in my Dropbox which can sync across multiple computers. Feb 18, 2014 at 3:49
  • 1
    OK. Find your texmf.cnf, namely the one you should/can edit. Since you are using the Debian-based TeX Live, I'm not sure where that is. Try to find it with kpsewhich or locate. The one you should edit says it should contain (only) your personal changes. Add this line: TEXMFHOME = ~/Dropbox/texmf (or mylocaltexmf). Now -- important! -- do mkdir ~/Dropbox/texmf/tex/latex and put your .sty files there. TEXMF* folders must mimic the TeX Live Directory Structure (TDS). Thus a .bib file should go in ~/Dropbox/texmf/bibtex/bib; etc., etc.
    – jon
    Feb 18, 2014 at 16:22
  • 3
    With just one local texmf tree, you can use these commands: cd; mv texmf texmf.orig; ln -s ~/Dropbox/mylocaltexmf/ ~/texmf Feb 18, 2014 at 22:58

1 Answer 1

12

Firstly, you need to tell tex to look in your ~/Dropbox/mylocaltexmf folder as the user texmf, instead of in the default, ~/texmf. To do this, you need to create the file 10localtexmf.cnf (or some similarly named file) in /etc/texmf/texmf.d, and tell it your custom value of your home texmf:

cd /etc/texmf/texmf.d sudo touch 10localtexmf.cnf sudo echo "TEXMFHOME = ~/Dropbox/mylocaltexmf" > 10localtexmf.cnf

Next, you need to tell Ubuntu to generate the texmf.cnf file in /etc/texmf/web2c from the contents of the /etc/texmf/texmf.d directory:

sudo update-texmf

Great! Now test to see whether this has worked by running:

kpsexpand \$TEXMFHOME

If that outputs ~/Dropbox/mylocaltexmf, then it's worked, and you're set. If it outputs ~/texmf, it means it's still set on the default. If this is the case, check the contents of /etc/texmf/web2c/texmf.cnf to check whether update-texmf has successfully appended your custom TEXMFHOME.

I personally use this to sync my custom beamer themes. Oh, and remember that as jon said, the contents of your localtexmf must mirror the standard texmf structure, so custom latex styles and themes should be put in ~/Dropbox/mylocaltexmf/tex/latex. Also, remember to run sudo texhash whenever you update your local texmf.

2
  • Ran through this, and it did not work for me. Even though /etc/texmf/web2c/texmf.cnf says TEXMFHOME = /home/*STUFF*/Dropbox/texmf, kpsexpand \$TEXMFHOME only outputs /home/*STUFF*/Dropbox, no texmf at the end.
    – RghtHndSd
    Mar 19, 2016 at 18:50
  • @drewsberry: I have made mylocaltexmf in ~/path/to/mylocaltexmf. Inside that, I have created the folder tex/latex and have copied the verse folder which contains verse.sty into it. But when I run a sample test.tex file, I get the error verse.sty not found. sudo texhash doesn't seem to indicate mylocaltexmf. kpsexpand command doesn't exist in my system. But /etc/texmf/web2c/texmf.cnf has an entry for mylocaltexmf. And finally, the test.log doesn't show any entry of searching the verse.sty in mylocaltexmf. What am I doing wrong? Mar 22, 2022 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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