I hope nobody minds me asking, but why are there separate STIX and XITS math fonts, and how can I go about deciding which one I should use? Which one is best suited for which purpose? Is one of the two better than the other?
[Tex/LaTex] STIX versus XITS
stix
Related Solutions
(I've updated the answer to reflect the arrival of the STIX Two text and math fonts in late 2016. The STIX Two fonts weren't available yet in Sept. 2016, when this query was posted.)
I'm not in a position to evaluate the STIX Text and STIX Math fonts. Whatever it is that's afflicting them, there's good news: The STIX Two text and math fonts, which were released in Dec. 2016, have much better properties, as is shown below.
If, for some reason, your TeX distribution doesn't (yet) have the STIX Two text and math fonts, you may wish to consider using the XITS and XITS Math fonts. They are derived from STIX and STIX Math, but they don't generate the problem behavior you've run into. (Well, there's a different, and fortunately minor problem: The lower limit of integration is typeset too far to the right when using XITS Math. This may be fixed by issuing a directive such as \mkern-9mu
, which is equivalent to three negative thin-spaces.) Speaking for myself, I must say that I much prefer the shape of the integral symbol used by STIX Two Math over the version that's used by both STIX and XITS.
The following code was compiled on a Mac running MacOS10.12 "Sierra", MacTeX2016, LuaTeX 0.95, and LuaLaTeX format dated 2017/02/25. I understand that MacTeX2017, which will be released later this quarter, will use LuaTeX 1.04. The latest version of LuaTeX reportedly does a much better job of placing the limits of integration.
\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage[math-style=ISO]{unicode-math}
\newcommand\myeq{%
\[
P(\vec{k}) = \int_a^b e^{i\vec{k} \cdot \vec{R}} P(\vec{R}) \,\mathrm{d}\vec{R}.
\]}
\setlength\textwidth{7cm}
\begin{document}
\setmainfont{STIX}\setmathfont{STIX Math}
\renewcommand{\vec}[1]{\symbf{#1}}
STIX
\myeq
\medskip
\setmainfont{STIX Two Text}\setmathfont{STIX Two Math}
\renewcommand{\vec}[1]{\symbf{#1}}
STIX Two
\myeq
\medskip
\setmainfont{XITS}\setmathfont{XITS Math}
\renewcommand{\vec}[1]{\symbf{#1}}
XITS
\myeq
\end{document}
Update, Oct. 2017: Prompted by a follow-up comment by @HaraldHanche-Olsen, here's the "look" of the equation using the Stix Two text and math fonts, but now with MacTeX2017, LuaTeX 1.0.4, and unicode-math
2017/08/02 v0.8f:
As Harald has noted, the positioning of the lower limit of integration is now just fine.
i've checked with the font developers charged with "cleaning up" the stix 2 fonts.
the basic text font is modeled on times roman, as noted.
the sans and monospace characters in unicode plane 1 are the outlines from stix 1. they are both slated for cleanup and some redesign (but as far as i know that is not yet scheduled). the developer says this:
I don't know if you could say that there is a direct model for any of the sans, it is simply intended to work decently with the rest of the font stylistically. The math monospaced glyphs are also the outlines from 1.x, [...] but as with most other math monospaced are a modified Courier.
regarding selecting compatible fonts for sans serif and monospace text, again from the developer:
I think if one had to choose a matching Sans, there are a number of candidates, but yes, Helvetica and Courier are as good as any, if we consider availability issues.
there is plenty of advice in other questions on this site regarding adjustments in relative size (e.g., normalizing x-height) to these fonts for the sake of compatibility of appearance.
Best Answer
For a bit of historical context, when the STI Pub released v1.0.0 of the STIX fonts it did not have any math layout support neither for TFM files for traditional TeX engines nor OpenType layout for modern TeX engines. XITS started as a community effort to provide OpenType layout support and make the STIX fonts usable with engines that support OpenType math layout (namely XeTeX, LuaTeX as well as Microsoft Office 2007 and later).
Later STI Pub released a version of STIX fonts with OpenType math layout, but it was incomplete and had known bugs, so XITS remains preferable if one wants to use
unicode-math
package.A bit later, STIX support files for traditional TeX engines was released (the
stix
packages), but XITS does not provide equivalent support, so if one wants to use STIX fonts in a traditional LaTeX setup, thestix
package is the only option (and it works in XeTeX and LuaTeX, too, but using the traditional font machinery of course).STI Pub is working on next version of STIX fonts that should provide better OpenType math layout and revised glyph shapes (among other things), so it would supersede XITS in certain ways (XITS would still be useful for people who prefer the existing design, or want to do right-to-left math).