2

The following minimal example is stripped down from the sentence, β€œLet (𝑇, ≀) be a poset.” Feeding lualatex or xelatex with

\documentclass{standalone}
%\usepackage[math-style=ISO]{unicode-math}
\begin{document}
\((T,{\le})\)
\end{document}

yields a relatively small gap between 𝑇 and the comma, whereas using unicode-math, with or without the [math-style=ISO] (it doesn't matter), yields a gap larger by a factor of β‰ˆ1.196 for lualatex and β‰ˆ1.204 for xelatex:

output for lualatex

In case of the glyphs with lots of space in the right lower corner (𝐹, 𝑃, 𝑇, 𝑉, π‘Š, π‘Œ), this increase by β‰ˆ 20 % causes more pain than we already endure. The documentation of unicode-math is silent about the commas completely. It's unclear to me whether the gap has increased because of Latin Modern Math, or whether unicode-math (whether intentionally or not) inserts additional horizontal space. Is it a bug or a feature?

In the first case: which purpose does it serve?

In the second case: Can this gap before the math commas be reduced (either in general or for the pairs β€œπΉ,”, β€œπ‘ƒ,”, β€œπ‘‡,”, β€œπ‘‰,”, β€œπ‘Š,”, and β€œπ‘Œ,”) once for the whole document rather via \mskip-1mu plus.5mu minus.5mu each time?

4
  • it's much easier if you use article rather than standalone in such tests. standalone is ... complicated and introduces many artifacts that make tracing things hard Commented Mar 6 at 21:01
  • @DavidCarlisle Got it. With standalone, we can allow for smaller LaTeX input files because we don't need to add \pagestyle{empty} or pretend as if the page number were not printed. Also, visual comparisons are sometimes easier when the PDF outputs are visually small.
    – AlMa1r
    Commented Mar 6 at 21:28
  • sure but I'm far more likely to add \tracingall and trace what tex is doing than look at the output for code posted here:-) Commented Mar 6 at 21:31
  • @DavidCarlisle I see. I'll do better next time.
    – AlMa1r
    Commented Mar 6 at 22:05

1 Answer 1

4

The spacing is determined by the font used not by the tex macros

Latin Modern Math OpenType

This is with lualatex, xelatex log is different but identical space

\documentclass{article}
\usepackage{lmodern}
\usepackage[math-style=ISO]{unicode-math}
\showoutput
\begin{document}
\((T,{\le})\)
\end{document}

....\TU/latinmodern-math.otf(1)/m/n/10 𝑇
....\kern1.48 (italic)
....\TU/latinmodern-math.otf(1)/m/n/10 ,

Latin Modern tfm

pdflatex log

\documentclass{article}
\usepackage{lmodern}
%\usepackage[math-style=ISO]{unicode-math}
\showoutput
\begin{document}
\((T,{\le})\)
\end{document}

....\kern1.3889
....\kern-0.55556
....\OML/lmm/m/it/10 ;

Computer Modern tfm

pdflatex log

\documentclass{article}
% \usepackage[math-style=ISO]{unicode-math}
\showoutput
\begin{document}
\((T,{\le})\)
\end{document}

....\OML/cmm/m/it/10 T
....\kern1.3889
....\kern-0.55556
....\OML/cmm/m/it/10 ;

Latin Modern Math with italic correction mode 2

Luatex offers three modes of handling italic correction, Mode 2 here works better but note that it's a global change that may change more than you want. Exactly what changes in each mode is not over documented in the luatex manual, use at own risk:-)

enter image description here

\documentclass{article}
\usepackage[math-style=ISO]{unicode-math}
\showoutput
\mathitalicsmode=2
\begin{document}
\((T,{\le})\)
\end{document}

....\TU/latinmodern-math.otf(1)/m/n/10 𝑇
....\TU/latinmodern-math.otf(1)/m/n/10 ,
8
  • Thank you! So in other words and up to the tolerance of 0.1 pt, unicode-math with Latin Modern Math OpenType does not introduce a negative kern which we obtain when using tfm, right? I'm still unsure about the purpose (feature) or the absence thereof (bug).
    – AlMa1r
    Commented Mar 6 at 21:29
  • @AlMa1r the font designer has to take a manual design choice to adjust the letters between any two characters in a font, especially in opentype fonts there are a lot of pairs to consider and lots of room for different people to have different judgements or maintainers just to get tired and not add some or .... but tex always believes the font. In luatex you can modify the font metrics and add kern pairs on the fly but in xetex for math mode fixing it really would mean forking the font and modifying the font to have more kern pairs Commented Mar 6 at 21:35
  • I see. I suspect that β€œjust to get tired and not add some [pairs]” is likely. :-( Unless someone provides another answer here :-).
    – AlMa1r
    Commented Mar 6 at 22:06
  • @AlMa1r seems to be the day for modifying answers after second thoughts, see update Commented Mar 6 at 23:16
  • For xelatex, I modified the font by inserting a subtable in Element > Font Info > Lookups > GPOS > Math kern and let the kerning be set automatically. It looks great in fontforge: ibb.co/CVXYHWW . However, it seems that xelatex ignores this table when in math mode.
    – AlMa1r
    Commented Mar 6 at 23:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .