Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
share|improve this question
3  
You need to install "vanilla" TeX Live. –  Adam Liter Feb 18 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 at 3:17
    
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. –  I Like to Code Feb 18 at 3:49
    
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 at 16:22
1  
With just one local texmf tree, you can use these commands: cd; mv texmf texmf.orig; ln -s ~/Dropbox/mylocaltexmf/ ~/texmf –  Paul Gaborit Feb 18 at 22:58

1 Answer 1

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.

share|improve this answer
    
Welcome to TeX.SX! –  Andrew Swann Sep 16 at 11:17

Your Answer

 
discard

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.