latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
243 stars 28 forks source link

Error when using two Unicode subscritps #395

Closed asr closed 7 years ago

asr commented 7 years ago

After updating my TeX Live installation running tlmgr update --all, I'm getting the following error:

bug.tex:

\documentclass{article}
\listfiles
\usepackage{amsmath}
\usepackage{unicode-math}

\begin{document}
\begin{align*}
  r = s₁₂
\end{align*}
\end{document}
$ xelatex bug.tex
...
! Missing } inserted.
<inserted text>
                }
l.9 \end{align*}

? ! Extra }, or forgotten $.
<template> }
            $}\ifmeasuring@ \savefieldlength@ \fi \set@field \hfil \endtempl...
l.9 \end{align*}

? ! Missing } inserted.
<inserted text>
                }
l.9 \end{align*}

? ! Extra }, or forgotten $.
<template> }
            $}\ifmeasuring@ \savefieldlength@ \fi \set@field \hfil \endtempl...
l.9 \end{align*}

? [1] (./bug.aux)

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 amsmath.sty    2016/11/05 v2.16a AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
unicode-math.sty    2017/01/27 v0.8d Unicode maths in XeLaTeX and LuaLaTeX
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
   expl3.sty    2017/07/19 L3 programming layer (loader)
expl3-code.tex    2017/07/19 L3 programming layer
l3xdvipdfmx.def
ucharcat.sty    2015/11/19 v0.03 ucharcat for luaLaTeX (DPC)
  xparse.sty    2017/07/19 L3 Experimental document command parser
l3keys2e.sty    2017/07/19 LaTeX2e option processing using LaTeX3 keys
fontspec.sty    2017/07/23 v2.6c Font selection for XeLaTeX and LuaLaTeX
fontspec-xetex.sty    2017/07/23 v2.6c Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
   tuenc.def    2017/04/05 v2.0i Standard LaTeX file
fontspec.cfg
  fix-cm.sty    2015/01/14 v1.1t fixes to LaTeX
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
filehook.sty    2011/10/12 v0.5d Hooks for input files
unicode-math-xetex.sty
wspr commented 7 years ago

Is this possibly @davidcarlisle's fault? The error goes away if you replace \begin{align*}...\end{align} with \[...\].

asr commented 7 years ago

Is this possibly @davidcarlisle's fault?

What did you mean?

wspr commented 7 years ago

I wondered if there had been changes in amsmath that caused this problem. Perhaps not though, it doesn't look like the dates are too close.

Does the following work for you?

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
\[ r = s₁₂ \]
\end{document}
asr commented 7 years ago

Replacing \begin{align*}...\end{align*} with \[...\] works for me.

wspr commented 7 years ago

Thanks, that helps. It's possible the bug is in an underlying part of expl3 or amsmath rather than unicode-math — or maybe an interaction between all three. That makes it harder to track down...

asr commented 7 years ago

Thanks for the workaround.

davidcarlisle commented 7 years ago

If we are blaming each other, I suspected the changes in some expl3 brace matching code, so we could ping @ blefloch :-) https://github.com/blefloch

On 30 July 2017 at 06:16, Andrés Sicard-Ramírez notifications@github.com wrote:

Thanks for the workaround.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wspr/unicode-math/issues/395#issuecomment-318879276, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNcAil2Pa7NFYD0IdQy-wmiVpE3POGvks5sTBHLgaJpZM4Ol2X4 .

wspr commented 7 years ago

Apologies for the false accusation!!

asr commented 7 years ago

I suspected the changes in some expl3 brace matching code

Thanks for the pointing! The problem disappears if I use a previous version of expl3, so I filed https://github.com/latex3/latex3/issues/387.

blefloch commented 7 years ago

FYI @davidcarlisle I don't think I got pinged. But indeed it's somehow my fault. A bad interaction between \halign and the align-safe groups of expl3.

asr commented 7 years ago

I'm reopening the issue because the PR https://github.com/wspr/unicode-math/pull/397.

asr commented 7 years ago

Thanks everyone for fixing the issue so quickly!