All my files no longer compile after running my program due to such errors now
Double superscript. \left(-x^{2}+1\right) y^{\prime}^{2}
I have not updated TeXlive recently. Last time I updated it was about 5-7 weeks ago or so.
I did update Maple yesterday and then run my program which generates Latex by Maple.
Now when I try to compile the generated latex, I get the above errors. I am not sure what happened. I do know for sure if it is Maple's latex() which causes this or the update in TL I did which is the cause.
Here is a MWE
\documentclass[12pt]{book}
\usepackage{breqn}
\usepackage{amsmath}
\begin{document}
\begin{dmath*}
\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}
\end{dmath*}
\end{document}
it seems lualatex complains about y^{\prime}^{2}
>lualatex foo.tex
This is LuaHBTeX, Version 1.15.1 (TeX Live 2023/dev)
restricted system commands enabled.
(./foo.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2022-12-17>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/book.cls
Document Class: book 2022/07/02 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/bk12.clo))
(/usr/local/texlive/2022/texmf-dist/tex/latex/breqn/breqn.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-luatex.def))
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-def/luatex.def)))
(/usr/local/texlive/2022/texmf-dist/tex/latex/breqn/flexisym.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/breqn/cmbase.sym)
(/usr/local/texlive/2022/texmf-dist/tex/latex/breqn/mathstyle.sty))
(/usr/local/texlive/2022/texmf-dist/tex/latex/tools/calc.sty)) (./foo.aux)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2022/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Double superscript.
<recently read> \mathsup
l.12 \left(-x^{2}+1\right) y^{\prime}^{2}
= 1-y^{2}
?
Here is the Maple code using its latex() command to generate the above
interface(version)
Standard Worksheet Interface, Maple 2022.2, Windows 10, October
latex:-Settings(useimaginaryunit=i,
usecolor = false,
powersoftrigonometricfunctions= mixed, ## computernotation,
leavespaceafterfunctionname = true,
cacheresults = false,
spaceaftersqrt = true,
linelength=10000
);
Typesetting:-Unsuppress('all'); #always do this.
Typesetting:-Settings(prime=x,'typesetprime'=true); #this says to use y'(x) instead of dy/dx
Typesetting:-Suppress(y(x)); # this says to use y' and not y'(x)
ode:=(-x^2+1)*diff(y(x),x)^2 = 1-y(x)^2;
latex(ode)
gives
\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}
Here is also screen shot of the above
So you see I am using exactly the code generated by Maple as is. The program copies the latex to a file and the compiles it.
My question is: is this a Maple latex() command issue I should report to Maplesoft to fix? I do not know if this is how the latex was generated before I did an update to Maple last night or not. I will try to find out.
Meanwhile is there something I can do to workaround this without editing the actual latex generated by may be by adding something to the preamble? I can't edit the latex as it is all auto-generated by I can edit the preamble and add macros there to work around problems.
Update
I looked at an old latex generated by Maple before the update I did last night, and this is what it generated for the same equation
\left(-x^{2}+1\right) \left(y^{\prime}\right)^{2} = 1-y^{2}
compare to the current version which is
\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}
So it is Maple's fault. the first version above compiles OK and gives
So it seems like something changed in Maple's latex generated. I will report to Maplesoft.
y^{\prime}^{2}
has always been a tex error this is unrelated to any tex update so it's a bug in maple code (either yours or maplesoft's so not really on topic)