Skip to content

Using setmathfont six or more times, in combination with "text-style" mathematics causes fatal error #674

@nilsjor

Description

@nilsjor

This one really baffled be. In my attempt to isolate the error I made this minimal NOT-working example:

\documentclass{report}

\usepackage[%,
  % mathrm=sym,% Uncomment one of these lines to fix it
  % mathsf=sym,%
  ]{unicode-math}

\begin{document}

\setmathfont{Garamond Math}[Scale = MatchAveragecase]
\setmathfont{Garamond Math}[Scale = MatchUppercase, range = {bb, bbit}, StylisticSet=1]
\setmathfont{Kp Math}[Scale = MatchUppercase, range = {scr,bfscr}]
$\mathsf{NP}$ % Alternatively, comment this line out; or *any* of the subsequent setmathfont

\setmathfont{STIX Two Math}[range={"02AF4}, Scale=1] % \interleave
\setmathfont{STIX Two Math}[range={"02AFD}, Scale=0.8] % \sslash
\setmathfont{STIX Two Math}[range={"027C5}, Scale=1] % \lbag
$\mathrm{KL}$ % Or comment this line out...

\setmathfont{STIX Two Math}[range={"027C6}, Scale=1] % \rbag

Testing \(x \interleave y\), \(p \sslash q\), and the multiset bag-notation \(\lbag a, b \rbag\).

\end{document}

If this is compiled as-is, it causes the following fatal error:

No file minimal.aux.
Runaway argument?
10@nil try@load@fontshape expandafter ifx csname curr@fontshape endcsname ETC.
./minimal.tex:23: Paragraph ended before split@name was complete.
<to be read again> 
                   par 
l.24 
     
 733 words of node memory still in use:
   12 hlist, 1 vlist, 2 rule, 2 local_par, 1 dir, 6 math, 9 glue, 4 kern, 2 penalty, 7 glyph, 17 attribute, 52 glue_spec, 17 attribute_list, 2 if_stack, 1 write nodes
   avail lists: 2:5,3:3,4:1,5:7,7:2,8:4
./minimal.tex:24:  ==> Fatal error occurred, no output PDF file produced!
Transcript written on minimal.log.

minimal.log excerpt:

Package fontspec Info: 
(fontspec)             STIX Two Math scale = 1.

\sym__um_fam6=\mathgroup9
LaTeX Font Info:    Overwriting symbol font `__um_fam6' in version `normal'
(Font)                  TU/STIXTwoMath(0)/m/n --> TU/STIXTwoMath(0)/m/n on input line 22.
LaTeX Font Info:    Overwriting symbol font `__um_fam6' in version `bold'
(Font)                  TU/STIXTwoMath(0)/m/n --> TU/STIXTwoMath(0)/b/n on input line 22.
Runaway argument?
10@nil try@load@fontshape expandafter ifx csname curr@fontshape endcsname ETC.
./minimal.tex:23: Paragraph ended before split@name was complete.
<to be read again> 
                   par 
l.23 
     

Tested with LuaLaTeX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions