12

I am running a recently updated TeX Live 2011 on a Mac (OS X 10.7 Lion). I wanted to use the XITS fonts, but the following file generates errors when processed with xelatex:

\documentclass{article}
\usepackage{unicode-math} 
\setmainfont{XITS} 
\setmathfont{XITS Math}
\begin{document}
Text $x+y=\sqrt{z}$
\end{document}

I'm including the relevant (I think) output below. Any ideas what is going on?

kpathsea: Running mktextfm XITS
/usr/local/texlive/2011/texmf/web2c/mktexnam: Could not map source abbreviation X for XITS.
/usr/local/texlive/2011/texmf/web2c/mktexnam: Need to update /usr/local/texlive/2011/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input XITS
This is METAFONT, Version 2.718281 (TeX Live 2011)


kpathsea: Running mktexmf XITS
! I can't find file `XITS'.
  • You need to be running xelatex, not latex. Also, you need to download and install The XITS open type fonts. – Nathan Grigg Feb 7 '12 at 3:24
  • 1
    @nathan-grigg: The error above was generated by xelatex. However, I did not realize that I needed to download the fonts -- I thought what came with TeXLive 2011 was sufficient. Ire the fonts that I need in the zipfile from the XITS download site link? – banbh Feb 7 '12 at 3:39
  • I took a look at what is installed on my system by the xits package (cat version 1.103) and it includes a number of OTF files (such as xits-regular.otf, xits-math.otf, etc). I'm guessing this means the fonts are installed. Is there something else I need to install? – banbh Feb 7 '12 at 3:46
  • 2
    Yes, you need that and put it into /Library/Fonts (or wherever regular Mac fonts are installed in Lion) (I'm still using 10.6). – Alan Munn Feb 7 '12 at 3:46
  • it's a shame xelatex would not follow the same convention as say emacs.. – nicolas Apr 25 '16 at 7:16
24

Fonts bundled with TeXLive are not usually made available to system, font services and XeTeX can’t locate fonts in TeX tree by font name (LuaTeX based packages does, though). So you need to either install TeX fonts system wide (check TeXLive documentation, though not sure with works for Mac), or access fonts by file name:

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont{XITS}
[    Extension = .otf,
   UprightFont = *-Regular,
      BoldFont = *-Bold,
    ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic,
]
\setmathfont{XITSMath-Regular}
[    Extension = .otf,
      BoldFont = XITSMath-Bold,
]

\begin{document}
Text $x+y=\sqrt{z}$ \boldmath $x+y=\sqrt{z}$
\end{document}
  • 2
    on Linux one can define a local config file .fonts.conf in which additional directories can be defined, e.g. /usr/local/texlive/texmf-local/fonts/opentype/. Such directories will then be searched by fontconfig – user2478 Feb 7 '12 at 17:38
  • Thanks Khaled, that worked without installing the fonts (and using the document you suggested above). Also, on re-reading your user guide (that comes with XITS) you mention that you need to do this. In the end I installed the fonts by following the procedure here link due to Herbert Schulz. – banbh Feb 7 '12 at 21:32
  • The "you need to access it by file name" did the trick for me! Many thanks! – polemon Sep 24 '12 at 5:41
  • 3
    @FaheemMitha: that is the way things are done now, “why” is a question to TeX Live developers. – Khaled Hosny Nov 15 '12 at 15:44
  • 1
    This used to work for me (on MikTeX), but now I see that the file names of the math-versions have changed from xits-math.otf and xits-mathbold.otf to XITSMath-Regular.otf and XITSMath-Bold.otf, both in MikTeX and in CTAN, so the code needs to be updated. (Also the main font now uses a lot of upper case in the file names. This is not a problem on Windows, but I guess it matters on Linux.) – Michal Kaut Oct 9 '18 at 8:14

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.