unicode-math icon indicating copy to clipboard operation
unicode-math copied to clipboard

adds to much space between mathcal symbol and subscript

Open mennucc opened this issue 2 years ago • 5 comments

Description

enabling unicode-math adds to much space between mathcal symbol and subscript

info

  • Relevant for XeTeX
  • Relevant for LuaTeX
  • Issue tracker has been searched for similar issues? Yes

Minimal example demonstrating the issue

\documentclass{article}
\usepackage[paperwidth=0.3in,paperheight=0.3in,top=1pt]{geometry}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{STIX Two Math}
\begin{document}
\noindent
\(\symcal F_j\)
\end{document}

Further details

I am using texlive version 2021.20220204-1 as packaged in Ubuntu

  • The spacing between the mathcal F and the subscript in the above example (using XeTeX) is as follows immagine

  • if I use unicode-math and I use latin modern math it is immagine

  • if I disable unicode-math it is as follows immagine

results do not vary in a visible way by using LuaLaTeX instead of XeTeX

IMHO the spacing in the first two cases is excessive, while the last one is fine.

mennucc avatar Jun 27 '22 17:06 mennucc

In the current version (0.8q with TeXLive 2022) the spacing is only excessive with Latin Modern.

\documentclass{article}

\usepackage{unicode-math}

\begin{document}
\setmathfont{latinmodern-math.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{texgyrepagella-math.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{STIXTwoMath-Regular.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{Asana-Math.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{LibertinusMath-Regular.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{Garamond-Math.otf}
\[F_j\qquad \symcal F_j\]
\end{document}

image

marcin-serwin avatar Jun 28 '22 16:06 marcin-serwin

@marcin-serwin I guess you used LuaLeTeX since I can reproduce your result. XeLaTeX 3.141592653-2.6-0.999994 (TeX Live 2022) however gives excess spacing for STIXTwoMath as well:

xelatex

e-kwsm avatar Jun 30 '22 04:06 e-kwsm

This is an engine and/or font issue. For STIX Two Math, the script F has math kerning for positioning the subscripts but XeTeX is not applying it.

khaledhosny avatar Mar 31 '24 23:03 khaledhosny

I tried again my initial example with a more recent version of LuaLaTeX ( This is LuaHBTeX, Version 1.14.0 (TeX Live 2022/dev/Debian) and it looks fine image wheras with XeLaTeX it is horrible (This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2022/dev/Debian) image

If I use the standard font (and not Stix) then both xelatex and lulatex are horrible.

mennucc avatar Apr 03 '24 10:04 mennucc

FYI, there is a bug in the OpenType spec. LuaTeX is following the letter of the spec, which gives better results here (due to bad font data) while XeTeX is following the intent of the spec and matches Microsoft implementation.

I reported an issue against an OpenType spec, and eventually LuaTeX will need to be fixed as well as the fonts, so you should report your issue to the individual fonts that are not behaving as expected.

The issue here should be close since there is no much unicode-math can do here.

khaledhosny avatar Apr 06 '24 22:04 khaledhosny