On 25.05.22 21:47, 'Nasser M. Abbasi' via FriCAS - computer algebra system wrote:

Fricas uses very old and not recommended \over when it generates latex.
This causes modern compilers such as lualatex to hang when using dmath
environment.

Could the latex be corrected to use \frac{} instead?

Well, maybe it can, but you already have everything if you run a newer version of FriCAS (1.3.7 should be OK).

I can offer you the following:

setSimplifyDenomsFlag(true)
ii:=integrate(asin(x)*log(x),x)

print1D x      ==> display((x::OutputForm)::Formatter(Format1D))
printLaTeX x   ==> display((x::OutputForm)::Formatter(FormatLaTeX))
printMathJax x ==> display((x::OutputForm)::Formatter(FormatMathJax))

print1D ii
printLaTeX ii
printMathJax ii

Or if you want the output directly, without the need to call some function, then do the following.

)set output algebra off
setFormats!([FormatMathJax])$JFriCASSupport
ii

and you get

--FORMAT:BEG:FormatMathJax
\[
\frac{\log\left(\sqrt{-{x}^{2}+1}+1\right)-\log\left(\sqrt{-{x}^{2}+1}-1\right)+\left(2\, \log\left(x\right)-4\right)\, \sqrt{-{x}^{2}+1}+2\, x\, \arcsin\left(x\right)\, \log\left(x\right)-2\, x\, \arcsin\left(x\right)}{2}
\]
--FORMAT:END:FormatMathJax

Note that you can actually also output other things than "\[" and "\]".
See
https://github.com/fricas/fricas/blob/master/src/algebra/fmtjfricas.spad#L168
or simply use

BOX ==> OutputBox
setDefault!(_
  (s: String): BOX +-> box("\begin{dmath*}")$BOX,_
  (s: String): BOX +-> box("\end{dmath*}")$BOX_
)$Formatter(FormatMathJax);

For the output of FormatLaTeX you would need
https://github.com/fricas/fricas/blob/master/src/doc/fricasmath.sty
But maybe FormatMathJax is enough for you.

Hopefully, you will find no bug. But I'd be happy if you can use that formatting framework.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/5ef353f7-52d1-0fe0-75dc-9cca2846697e%40hemmecke.org.

Reply via email to