# How to install a font on MacTeX 2013

I don't understand why fonts that work perfectly fine on Windows with TeXLive 2013 don't work on my Mac with MacTeX-2013, but whatever. I need to install "Linux Libertine O," but do not know how to do it. The instructions I find online all seem to be for older versions of MacTeX and OS X. I need the font to work with XeLaTeX. If there is a large font distribution/package of some sort that I can use that would be ideal so that I don't keep having to install fonts one by one.

-
@texenthusiast I found that but the directions were not helpful for me. –  Dan Aug 8 '13 at 2:43
I don't have the libertine package, and I don't know how to install packages - so I'm dead in the water for that also. I figured I'd start by trying to just install a simple font before learning that stuff. –  Dan Aug 8 '13 at 2:45
@texenthusiast fontspec error: The font "Linux Libertine O" cannot be found. –  Dan Aug 8 '13 at 2:59
@Dan: A reason why your document compiles under Windows but not under MacOSX is that the fonts may be activated on your Windows machine but not (yet) on your Mac. If that's the case, you'll need to use the method described in Joseph Wright's answer, viz., use each font's exact file name. –  Mico Aug 8 '13 at 6:25

Do you have Linux Libertine installed as an OTF in your Mac? If so, using fontspec + XeLaTeX should "just work".

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Linux Libertine O}
\begin{document}
Testing, 1, 2, 3.
\end{document}


\$ pdffonts ~/tmp/TeX/libertine.pdf

name type encoding emb sub uni object ID

OKMUQH+LinLibertineO-Identity-H CID Type 0C Identity-H yes yes yes 5 0

edit: As per Joseph Wright's request for clarification: I have installed the Linux Libertine OTF package as a system-wide font (i.e. accessible to any application on my Mac)

-
I installed all packages in MacTeX. Joseph's answer works for me, but not this one. So I have the package. I think the procedure of picking the filename of Libertine is exact way to go. Most probably least problems between different OSX systems. It would be interesting to see how you installed the system-wide font to compare better to Joseph's answer. –  Masi Jan 13 at 20:23
I just installed the libertine fonts through fontbook (double clicked them from the finder, and installed them). I just tried the MWE again (I'm running Yosemite in a new machine) and it just works. No idea why it's not working for you. Did you install libertine as a system-wide font? If not, that's the problem. –  mvarela Jan 14 at 21:05
No libertine in my Fontbook. How did you install libertine as a system-wide font? - I do no get it why I should do it, since the font exists in my system and not necessarily to install anything extra. Using Joseph's answer works like a charm! –  Masi Jan 15 at 11:03
You can just open a finder window on the folder that Joseph pointed to, select the otf files and open them in fontbook. You'll get the option to install them. Once installed, you can use them in all Mac apps, not only LaTeX (which is why I install all my fonts system wide). Also, using this method allows you to use any system font, not only the ones that come with TeXlive, and you don't need to know about the OTF file names. –  mvarela Jan 15 at 11:12

XeTeX uses system-dependent code to load fonts, hence it's quite possible to see differences between how Windows and Mac installations find fonts. What will always work is looking not for the 'friendly' name of the font but the font file name:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{LinLibertine_R.otf}
\begin{document}
Testing, 1, 2, 3.
\end{document}


I'm using the files inside /usr/local/texlive/2013/texmf-dist/fonts/opentype/public/libertine, i.e. without a 'stand alone' installation of Linux Libertine for use by non-TeX programs. Again, this can be important! (See also mvarela's answer)

-
This is the best answer here! Works in the newest OSX installation well. Seems to be also much more robust and stable way of picking the font, since the file should always be the same. I think this way should of use should be mentioned widely for OSX users. Old way of sticking to Hoefler's font here and ignoring the Libertine latextemplates.com/template/compact-academic-cv –  Masi Jan 13 at 20:21