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
@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
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

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{unicode-math}
\setmainfont
[    Extension = .otf,
UprightFont = *-regular,
BoldFont = *-bold,
ItalicFont = *-italic,
BoldItalicFont = *-bolditalic,
]{xits}

\setmathfont
[    Extension = .otf,
BoldFont = *bold,
]{xits-math}

\begin{document}
Text $x+y=\sqrt{z}$ \boldmath $x+y=\sqrt{z}$
\end{document}

-
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` –  Herbert 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
Why is it the case that "Fonts bundled with TeXLive are not usually made available to system"? Is there some policy statement or reason given? –  Faheem Mitha Nov 15 '12 at 15:21
@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