TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem using my own OTF fonts within a LaTeX document. I read I should compile the document with xelatex which I have installed on my Mac with MacPorts (package texlive-xetex)

My minimal document looks like this:



    Lorem ipsum

Compiling it via xelatex test.tex I get the following errors:

This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/MacPorts 2012_5)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
* LaTeX warning: "xparse/redefine-command"
* Redefining document command \oldstylenums with arg. spec. 'm' on line 107.
) (/opt/local/share/texmf-texlive-dist/tex/latex/fontspec/fontspec-xetex.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/euenc/eu1lmr.fd)kpathsea: Invalid fontname `[lmroman10-regular]', contains '['

! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadab
le: Metric (TFM) file or installed font not found.
<to be read again> 
l.100 \fontencoding\encodingdefault\selectfont

What am I doing wrong? I also tried to specify the whole path to my font with \setmainfont[Path=/Absolute/Path/To/My/OTF/Font/]{file.otf} in the preamble.

Although I would prefer using pdftex instead of xelatex because I read that xelatex comes with some disadvantages and I do not want to install it on every computer I use it. Is there a good solution for using OTF fonts with pdftex?

share|improve this question
An answer to your question was submitted some time ago, please consider marking the answer as ‘Accepted’ (see How do you accept an answer?) or explain why the answer given did not answer your question. – Silke Jan 26 '13 at 14:22
up vote 3 down vote accepted

What am I doing wrong?

The Minimum Working Example you provided is the correct way to use OpenType fonts with LaTeX. However, you're probably missing some part of TeX Live.

The solution would be one of the following:

  • Install MacTeX.
  • Install the following MacPorts packages: texlive-basic, texlive-fonts-extra and texlive-fonts-recommended.

I recommend the first option, but the second one should also work (if you really want to do this through MacPorts).

Is there a good solution for using OTF fonts with pdftex?

Unless you want to convert them to Type 1 fonts, I'm afraid not. Luckily there are a lot of people doing the converting for you. You can find a lot of fonts that can be used for pdfLaTeX in The LaTeX Font Catalogue.

share|improve this answer
I second this advice. I'm not quite sure why you've installed the MacPorts version of TeX; you'll probably have far fewer headaches with the regular MacTeX distribution. That being said, XeTeX assumes that your fonts are in the usual place for fonts on the Mac: either /Library/Fonts or ~/Library/Fonts. But the error you're getting is because you're missing fonts in your distribution as Silex notes in the second bullet point. – Alan Munn Jan 16 '13 at 1:42
You were right, I really was missing one of the packages you listed above. Thank you! :) – Jan Mar 13 '13 at 14:38

Your Answer


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.