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

Font selection of minus sign only working with `range = { \minus, "2212 }`, but not with `range = { "2212 }` or with `range = { \minus }`

Open jasperhabicht opened this issue 2 years ago • 0 comments

Description

It seems that the font for the minus sign can only be selected, if both \minus and "2212 are selected via the range option, such as range = { \minus, "2212 }. If only "2212 or only \minus are selected, the font does not change.

Add info or delete as appropriate:

  • Relevant for LuaTeX and XeLaTeX
  • See https://tex.stackexchange.com/q/705051/47927

Minimal example demonstrating the issue

If you change range = { \minus, "2212 } in the below MWE to range = { "2212 } or to range = { \minus } the font is not selected as expected:

\documentclass{article}
\RequirePackage[silent]{fontspec}
\setmainfont{Times New Roman}
\RequirePackage{unicode-math}
\setmathfont{STIX Two Math}
\setmathfont{Times New Roman}[ 
    range = { \minus, "2212 } 
]

\begin{document}

-6 and $-6$ 

\end{document}

Further Details

It might be the case that this behaviour is intended, but it is at least not documented in the manual.

jasperhabicht avatar Dec 16 '23 12:12 jasperhabicht