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've noticed that there are plenty of OTF and TTF fonts packaged with my new TexLive 2012. For example, the Asana-Math OTF font is in

$TEXMFDIST/fonts/opentype/public/Asana-Math

And there is a TTF in a different location. Can I use it in fontspec without intalling it in my system fonts, or specifying its absolute path?

share|improve this question
1  
Welcome to TeX.SE! Please consider editing your question to provide information on what you've tried so far, as well on which TeX engine (XeTeX, luaTeX?) you intend to use. –  Mico Aug 19 '12 at 12:45

3 Answers 3

up vote 3 down vote accepted

If you only want to use fonts with UTF-8 TeX derivatives (XeTeX and LuaTeX) then you do not need to install them in your system font folder. Depending on your operating system and engine choice, using the font name may be less reliable than using the font file name. I would therefore favour doing the latter whether you are using system-wide or TeX tree fonts.

For example,

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Asana-Math.otf}
\begin{document}
$y = mx + c$
\end{document}

works on my system with both XeLaTeX and LuaLaTeX, but I do not have Asana Math installed system-wide (i.e. not available in for example Word).

share|improve this answer
    
Asana Math is part of TeXLive, the reason why it is found –  Herbert Aug 19 '12 at 16:08
    
@Herbert Exactly the point I'm making: it's installed in the TeX tree, so is found by XeTeX and LuaTeX, but does not need to be copied into the system-wide tree. –  Joseph Wright Aug 19 '12 at 16:09
    
sure, but I understand that the question refers to a TrueType in another location. –  Herbert Aug 19 '12 at 16:17
    
@Herbert I think we read the question in different ways: I guess we need the OP to clarify. –  Joseph Wright Aug 19 '12 at 18:36

copy the file into

$TEXMFLOCAL/fonts/truetype/.../

then run texhash or update your database when running MiKTeX. Then you can use the font with its font name, eg

\usepackage{fontenc}
\setmainfont{Helvetica Neue}

if you are running Linux, then you can save the files under /home/$USER/.fonts/, run fc-cache and it will be found by xelatex

share|improve this answer

With LuaTeX you can use fonts installed by TeX Live (i.e. under TEXMF tree) the same way you use system fonts. XeTeX does not support this yet, but on Linux/Windows you can follow the instruction here to make TeX Live fonts available system wide so that XeTeX can find it.

Alternatively, you can call the fonts by their file names which works with TEXMF tree fonts in both engines, but it can be a bit complex if you want to use more than one font style. Check fontspec documentation on how to load fonts by file names.

share|improve this answer

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.