# open type math font STIX letters are very close to each others in some places

I was trying some fonts from this post which-opentype-math-fonts-are-available

From http://stixfonts.org/ and have been using it for few days. It looks really nice. Except sometimes some of math letters in fractions hit each others.

Compare this image (will show MWE below), comparing STIX and STIX two and the default latex font. Notice how the denominator is touching the math in the line below it

Here is MWE

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}

%\setmainfont{XITS}
%\setmathfont{XITS Math}
\begin{document}

$G(x,s) = \left\{ \begin{array}[c]{ccc}% \frac{\cos s}{\cos(1) }\sin(1-x) & & 0\leq s\leq x\\ \frac{\cos x}{\cos(1) }\sin(1-s) & & x\leq s\leq 1 \end{array} \right.$

\end{document}


Compiled using lualatex foo.tex

This below is the default Latex font:

The question is, is there is something one can do to fix this? Is this a bug in the font? I find it harder to read when the letters are touching each others. Otherwise, it is a nice font. I think they put too much space between the fraction line and the denominator. With the default font, the spacing is much better.

To install the fonts, I unzipped the file from the above link, and copied the 3 font folders to ~./fonts folder. That is all. This is on cygwin. On windows or mac, the fonts need to be moved to wherever the opentype fonts folder is.

• it doesn't look great the parameters can be tweeked a bit but (as has been said multiple times before) \left( 1-x\right)  is bad input and would be better as (1-x) – David Carlisle Apr 14 '18 at 9:51
• to +1 @DavidCarlisle: the spacing between G and opening parenthesis looks very bad in both tests due to bad \left(x, s\right) input... – user4686 Apr 14 '18 at 11:26
• @DavidCarlisle I removed the \left( and \right) but the output still looks the same. – Nasser Apr 14 '18 at 16:35
• as a workaround you could increase baselineskip or arraystretch when using stix 2 – David Carlisle Apr 14 '18 at 16:40
• I'd be more worried about the distance of numerator and denominator from the fraction line, which I find excessive with STIX Two Math. – egreg Apr 14 '18 at 18:07

The default spacing is rather cramped

You could open up arrays when using stix 2 by adding

\renewcommand\arraystretch{1.3}


to the preamble

Although really array is not suitable for this kind of layout, it uses inline math not display and is designed for setting arrays and matrices, if you put \arraystretch back to the default and use cases then you get

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}
\renewcommand\arraystretch{1.3}

%\setmainfont{XITS}
%\setmathfont{XITS Math}
\begin{document}

$G(x,s) = \begin{cases} \frac{\cos s}{\cos(1) }\sin(1-x) & 0\leq s\leq x\\ \frac{\cos x}{\cos(1) }\sin(1-s) & x\leq s\leq 1 \end{cases}$

\end{document}


Or perhaps with stix2 you should increase baselinestretch slightly, adding

\renewcommand\baselinestretch{1.1}


gives

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}
\renewcommand\baselinestretch{1.1}

%\setmainfont{XITS}
%\setmathfont{XITS Math}
\begin{document}

$G(x,s) = \begin{cases} \frac{\cos s}{\cos(1) }\sin(1-x) & 0\leq s\leq x\\ \frac{\cos x}{\cos(1) }\sin(1-s) & x\leq s\leq 1 \end{cases}$

\end{document}