3

The code below are all running with xelatex on Windows 10, TeX Live 2022, and have updated all packages by tlmgr update --all --self.

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{XITSMath-Regular.otf}
\setmathfont{XITSMath-Bold.otf}[version=bold]
\begin{document}
$\symbfit{x}$
$x$
\boldmath $x$
\end{document}

enter image description here

XITS Math works. But Erewhon Math, XCharter Math and KpMath not work.

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{Erewhon-Math.otf}
\setmathfont{Erewhon-Math-Bold.otf}[version=bold]
% \setmathfont{XCharter-Math.otf}
% \setmathfont{XCharter-Math-Bold.otf}[version=bold]
% \setmathfont{KpMath-Regular.otf}
% \setmathfont{KpMath-Bold.otf}[version=bold]
\begin{document}
$\symbfit{x}$
$x$
\boldmath $x$
\end{document}

enter image description here

$\symbfit{x}$ is not bold when version=bold is set. But set BoldFont= works. I found the usage of BoldFont on tex.se, the doc of unicode-math does not mention BoldFont.

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{Erewhon-Math.otf}[BoldFont=Erewhon-Math-Bold.otf]
% \setmathfont{XCharter-Math.otf}[BoldFont=XCharter-Math-Bold.otf]
% \setmathfont{KpMath-Regular.otf}[BoldFont=KpMath-Bold.otf]
\begin{document}
$\symbfit{x}$
$x$
\boldmath $x$
\end{document}

enter image description here

What is the reason for this?

Question:

  1. When \setmathfont{Erewhon-Math-Bold.otf}[version=bold], \setmathfont{XCharter-Math-Bold.otf}[version=bold] or \setmathfont{KpMath-Bold.otf}[version=bold] is set, $\symbfit{x}$ is not bold. But $\symbfit{x}$ is bold when \setmathfont{XITSMath-Bold.otf}[version=bold]. Why XITSMath works, but Erewhon Math, XCharter Math and KpMath not work.
  2. What different between \setmathfont{Erewhon-Math.otf}[BoldFont=Erewhon-Math-Bold.otf] and \setmathfont{Erewhon-Math.otf}\setmathfont{Erewhon-Math-Bold.otf}[version=bold]?
  3. The usage of BoldFont is from fontspec or other? I cannot found the exactly explanation.

Update

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
\setmathfont{KpMath-Regular.otf}[version=xxx] % case 1
% \setmathfont{XITSMath-Bold.otf}[version=xxx] % case 2
% \setmathfont{KpMath-Bold.otf}[version=xxx] % case 3
\begin{document}
$\symbfit{x}$
\mathversion{xxx}
$x$
\end{document}

In above demo of three case, the first x is always latinmodern. Only in case 3, the fisrt x is not bold italic. In other words, in case 3, some thing is wrong. At present, the difference between the three cases is that part of the slots in case 3 are empty. I don't know whether this is the reason for this problem. Logically speaking, setting the version should not affect any mathematical font if you do not use the \mathversion{} to enable version. In other words, the default normal version is independent of the other versions set manually. It is not clear whether this problem is caused by defects in the implementation of unicode-math.

1
  • I think it is a unicode-math package issue: it has been reported on https://github.com/wspr/unicode-math/issues/512 for the Fira-Math fonts… four years ago! Commented Feb 5, 2023 at 8:45

1 Answer 1

3

A similar issue has been reported here four years ago about Fira-Math fonts, unicode-math seems to be a bit frozen…

What is interesting in your post is that the \symbfit command works for the XITSMath family and not with the other three you mention. As I am maintaining these three, I tried to understand what is done differently in XITSMath vs. Erewhon-Math. It appears that in XITSMath-Bold defines twice the same glyphs for normal and bold:

  • U+0041-U+005A (A-Z upright) and U+1D400-1D419 (bold) hold the same glyphs; idem for the lowercase Latin letters;
  • U+1D434-U+1D44D (A-Z italic) and U+1D434-U+1D44D (bold italic) hold the same glyphs;
  • and so on…

Doing the same thing on Erewhon-Math-Bold does fix the issue for Erewhon-Math, but this fix looks odd to me : I would expect to put bolder versions of U+0041-U+005A (already bold) in U+1D400-1D419 but not the same glyphs, I'd rather leave these slots empty if I have no bolder version. Am I wrong?

Regarding your second and third question, my understanding is that the BoldFont= is meant for text fonts, not for maths fonts, I am surprised that it works here.

1
  • I agree with you. I think versions should be independent and not affected by each other. I updated my question and added an example.
    – Clara
    Commented Feb 6, 2023 at 8:29

You must log in to answer this question.

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