wspr / breqn

Automatic line breaking in LaTeX equations
18 stars 2 forks source link

Undefined control sequence. \eq@measure ...al \eq@failout \endgroup \EQ@trial #22

Open hmenke opened 6 years ago

hmenke commented 6 years ago

The following example fails in TeX Live 2018 with a irrecoverable error, i.e. no PDF is produced. It works if you comment out the last line of the equation.

\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{dmath*}[layout={L}]
\sum_{k\hiderel{=}0}^{n} \left(\frac{k}{n} - x\right)^2 \binom{n}{k} x^k (1 - x)^{n - k}
= \left(1 - \frac{1}{n}\right)x^2 + \frac{1}{n}x - 2x^2 + x^2
= \frac{1}{n}x(1 - x)
\leq \frac{1}{4n}
\end{dmath*}
\end{document}
$ pdflatex -interaction=nonstopmode test.tex 
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2018-04-01> patch level 4
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2018/texmf-dist/tex/latex/breqn/breqn.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))
(/usr/local/texlive/2018/texmf-dist/tex/latex/breqn/flexisym.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/breqn/cmbase.sym)
(/usr/local/texlive/2018/texmf-dist/tex/latex/breqn/mathstyle.sty))
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/tools/calc.sty)) (./test.aux)
! Undefined control sequence.
\eq@measure ...al \eq@failout \endgroup \EQ@trial 

l.9 \end{dmath*}

)
Runaway argument?
\end {document} 
! File ended while scanning use of \adjust@parshape@a.
<inserted text> 
                \par 
<*> test.tex

! Emergency stop.
<*> test.tex

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.
wspr commented 6 years ago

Thanks. Is this error particular to this equation? (I.e., do you use layout=L for other equations without trouble?)

wspr commented 6 years ago

BTW when you see

! Undefined control sequence. \eq@measure ...al \eq@failout \endgroup \EQ@trial

this means that \EQ@trial only is undefined. So you could describe this simply as "Undefined control sequence (\EQ@trial)” or similar.

hmenke commented 6 years ago

The error is quite specific to this equation. It disappears if you remove stuff, e.g. \left(...\right). Here is the reference question on TeX.SX which I was answering when I found this bug: https://tex.stackexchange.com/questions/443103

wspr commented 6 years ago

I turned on debugging mode and breqn claims it can’t find a satisfactory solution using layout=L. My question here would be: if a specific layout is requested but not possible, should it just produce a sensible error message? My feeling is yes…