Question: latex problem after latest update to Physics package

after updating to latest Physics package, I find now latex geneated is invalid as it gives compile error.

I looked at old files I have and I see the latex generated before was correct. so something changed in the latex() command to cause this and now none of my files compile when I run my Maple program.

Before, same code used to generate this

 \left(-x^{2}+1\right) \left(y^{\prime}\right)^{2} = 1-y^{2} 

which compiled correctly.

Here is worksheet
 

interface(version)

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1378 and is the same as the version installed in this computer, created 2023, January 29, 12:4 hours Pacific Time.`

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)

[useimaginaryunit = i, usecolor = false, powersoftrigonometricfunctions = mixed, leavespaceafterfunctionname = true, cacheresults = false, spaceaftersqrt = true, linelength = 10000]

x, false

ode:=(-x^2+1)*diff(y(x),x)^2 = 1-y(x)^2;

(-x^2+1)*(diff(y(x), x))^2 = 1-y(x)^2

latex(ode)

\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}

 

 

The error from the latex compiler is 

 

\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}

compiled using texlive lualatex command gives

(/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}
? 

The fix is to keep same latex as before or use an extra {} like this  {y^{\prime}}^{2} 

but I think \left(y^{\prime}\right)^{2} looks better. But y^{\prime}^{2} is definitly wrong latex.

Download latex_problem.mw

Please Wait...