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 want to use a really cool open-source OpenType font with my LaTeX document.

I was told that either I could go through a long process of converting the OpenType font to one useable by LaTeX, or I should instead switch to using XeTeX.

Is there a way for me to use an unmodified OpenType font with my LaTeX document (and existing LaTeX installation)?

share|improve this question
    
possible duplicate of Installing TTF fonts in latex –  Dima Jul 28 '10 at 14:34
add comment

3 Answers 3

Switch to XeTeX:

  1. Change your invocations of pdflatex to xelatex.
  2. \usepackage{xltxtra} at the beginning of your preamble (some XeTeX goodies, in particular it also loads fontspec, which is needed for font selection).
  3. \setmainfont{Name of OTF font} in the preamble.
  4. No step 4.

It’s as easy as that.

Drawback: you lose the advantages of the microtype package. Ah, and be sure to use UTF-8 as your source encoding, and remove any \usepackage{inputenc} declarations.

See also: Differences between LuaTeX, ConTeXt and XeTeX.

share|improve this answer
4  
You also have to remove \usepackage{fontenc} declarations. See tex.stackexchange.com/q/2984/1035 –  Mateus Araújo Sep 11 '10 at 5:59
add comment

As far as I know you should install it as a system font. Such that it becomes available in system settings for UI fonts, web-browser and all apps. On Mac OS X and Linux (Gnome at least) it is simple as double clicking the downloaded font.

After that you can use fontspec & Xe(La)TeX to select that font by name (note that font name can be different from the file name).

If you don't want to install the font as a system font, you can drop the font into the same folder as your tex document and xelatex should be able to find it.

To use OpenType and TrueType fonts with tex, latex (for dvi, dvi-ps, dvi-ps-pdf workflow) special font metrics will need to be generated and font map installed. Unfortunately I'm on a quest to find out how to properly do it.

Note that using "cool fonts from the web" might not be of high quality as highly engineered fonts. The Latin Modern has something like more than 50 complete fonts to cover different weights, italics, maths and special ligatures. None of the other fonts come close for exploiting latex typography power. Commercial fonts from Adobe, Apple, Microsoft are usually of high typographical quality and are more complete.

share|improve this answer
add comment

You should definitely switch to XeTeX if you want to do that. Fonts are (and as far as I can see, will always be) a pain to use with LaTeX by itself.

share|improve this answer
1  
This is by far the easiest way: use XeTeX (or LuaTeX) with the fontspec package. –  Joseph Wright Jul 26 '10 at 20:16
3  
But it doesn't really answer the question. What do you do to use an OpenType font once you've switched to XeTeX? –  jalf Jul 27 '10 at 1:29
    
\usepackage{fontspec}\setmainfont{My OpenType Font} –  Will Robertson Jul 29 '10 at 5:50
add comment

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.