So most people are claiming that the path to install new latex packages is ~/Library/texmf when I run the terminal command kpsewhich -var-value=TEXMFHOME I get ~/Library/texmf but this directory does not exist

however I do have ~/Library/texlive/2014/texmf-var

Can anyone tell me what is going on, and if I wanted to install a new package where do I do this?

Or should I just make the directory ~/Library/texmf

  • 4
    Just make ~/Library/texmf. I'm not sure, but I think that ~/Library/texlive/2014/texmf-var is the equivalent of ~/.texlive2014/texmf-var in which case, it is for auto-generated files. In some cases, you might need to delete this directory and you certainly should not install things into it! (Besides, TeX will look in TEXMFHOME for what it expects to find in TEXMFHOME. It is normal for it not to exist until you create it. (Not everyone needs it.) – cfr Nov 20 '14 at 2:41
  • @cfr Please make that comment an answer (you are spot-on about the nature of ~/Library/texlive/2014/texmf-var). – Joseph Wright Nov 20 '14 at 6:55
  • The MacTeX installer doesn't touch users' home directories; I'd be very wary of an installer which does! As @cfr says, create the folder yourself. – egreg Nov 20 '14 at 9:58
  • @JosephWright Done though it hardly seems to count as an answer! – cfr Nov 20 '14 at 17:43

You need to create the directory TEXMFHOME. That is, in your case, you need to create ~/Library/texmf and any subdirectories which you need below it.

For example, if you wanted to install greatpackage.sty, you would create a directory ~/Library/texmf/tex/latex/greatpackage to contain it.

~/Library/texlive/2014/texmf-var is for auto-generated files. You can safely delete ~/Library/texlive/2014 and it will be recreated as and when necessary during compilation. You certainly should not install things into it! First, you might need to delete this directory in some cases. Second, TeX will look in TEXMFHOME but not ~/Library/texlive/... for .cls and .sty files etc.

It is normal for TEXMFHOME not to exist until you create it. Not everyone needs this directory and, besides, a well-behaved installer ought not modify your home directory, as egreg mentioned in comments.

Indeed, upstream TeX Live recommend installing it as a non-root user and it is perfectly possible to install it as a non-root user other than yourself, in which case the installer could not modify your home directory, even if it wanted to do so. (For example, I manage my installation as texlive:texlive precisely because doing so prevents the software from touching either system or home directories.)

  • Thank you so much for a clear explication. (I would uproot you but I don't have the rep for it). One quick fallow up question, For something like the moderncv github.com/kuhess/moderncv/blob/master/README.md It says that the style and class files should be in the same directory as the tex file using them. Would it be equivalent to install those class and tex files into the TEXMFHOME and as a result not need the .sty .cl files in the same directory as the tex file? – Howard Nov 20 '14 at 20:00
  • @Howard On the page you linked to, it says that on OS X, you should install the files into ~/Library/texmf/tex/latex/moderncv which would put them into TEXMFHOME. Generally, having them in the same directory as your .tex file would be equivalent, unless a package or class has been very oddly (badly) written. If my answer helps, please consider accepting it by clicking on the greyed-out tick at the top left of the answer. This lets others know that the question has a useful answer. Disclaimer: it also gives me points. But you get some too ;). – cfr Nov 20 '14 at 21:12
  • Thanks!!!!!!!! I'm loving this community! And i'm excited to get to the point I can do more than use Latex, but start making smart classes and styles!!!!!! =) – Howard Nov 20 '14 at 23:59
  • @cfr this helped thanks. Where did you learn that one must create such a directory structure ~/Library/texmf/tex/latex. I am very dependent on people in this community to find such information and convey it, rather than find the information myself. – Muno May 25 '17 at 8:52
  • @Muno To be honest, I don't remember. I learnt from the predecessor to MacTeX (although I'm no longer using a Mac). So probably either the gwtex documentation (if I'm remembering correctly) or TeXShop's documentation. Or, possibly, Kopka & Daly, which I learnt LaTeX itself from. Try searching for tex directory structure or tds. There is a document on it somewhere, but I can't seem to find it right now. – cfr May 25 '17 at 12:32

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.