Page 1 sur 1

Latex possible bug?

Publié : sam. sept. 17, 2022 8:16 pm
par XcasEngGuy
It appears that xcas is no longer putting in the parenthesis around the argument in sin:

The xcas entry:
Capture_20220917-160659.jpg
Capture_20220917-160659.jpg (26.48 Kio) Consulté 1947 fois
produces:
Capture_20220917-160659.jpg
Capture_20220917-160659.jpg (26.48 Kio) Consulté 1947 fois
\(\left[\begin{array}{c}a=\mathrm{str2}\cdot \sin \mathrm{ang}\\b=\mathrm{str2}\cdot \cos \mathrm{ang}\end{array}\right]
\)


From:
% Generated by xcas
\documentclass{article}
\usepackage{pst-plot,color}
\usepackage{graphicx}
\begin{document}
\noindent \framebox{1} {\tt eq1:=[[a=(str2*sin(ang))],] } \\
\begin{equation} \label{eq:0}
\left[\begin{array}{c}a=\mathrm{str2}\cdot \sin \mathrm{ang}\\b=\mathrm{str2}\cdot \cos \mathrm{ang}\end{array}\right]
\end{equation}
\noindent \framebox{2} {\tt } \\

\end{document}

Re: Latex possible bug?

Publié : sam. sept. 17, 2022 8:23 pm
par XcasEngGuy
My post got corrupted somehow, hope you can understand it. I was not able to edit it.

Matt

Re: Latex possible bug?

Publié : mar. sept. 20, 2022 3:00 pm
par parisse
It seems it is a question for Luka.
Note that you can run

Code : Tout sélectionner

latex("legacy",1)
in your session before converting to latex, this should switch to my old latex code with parenthesis around the argument.

Re: Latex possible bug?

Publié : mer. sept. 21, 2022 6:05 pm
par XcasEngGuy
Thanks. That helps but it breaks some of my recent tweaks using perl scripts to change diff(x(t),t,2), for example, to a more textboox style:

\(\frac{d2\left(\text{y(t)}\right)}{\mathrm{dt2}}=\frac{4 \sqrt{10} \frac{d2\left(x(t)\right)}{\mathrm{dt2}} \sqrt{x\left(t\right)}^{-1}}{2}-4 \sqrt{10} \frac{1}{2} \frac{d\left(\text{x(t)}\right)}{\mathrm{dt}} \frac{1}{2} \frac{d\left(\text{x(t)}\right)}{\mathrm{dt}} \sqrt{x\left(t\right)}^{-1} x\left(t\right)^{-1}
\)

Re: Latex possible bug?

Publié : mer. sept. 21, 2022 6:11 pm
par XcasEngGuy
Even better (added tweak):

\(\frac{d^{2}\left(\text{y(t)}\right)}{\mathrm{dt^{2}}}=4 \sqrt{10} \frac{d^{2}\left(x(t)\right)}{\mathrm{dt^{2}}} \frac{\sqrt{x\left(t\right)}^{-1}}{2}-4 \sqrt{10} \frac{1}{2} \frac{d^{}\left(\text{x(t)}\right)}{\mathrm{dt^{}}} \frac{1}{2} \frac{d^{}\left(\text{x(t)}\right)}{\mathrm{dt^{}}} \sqrt{x\left(t\right)}^{-1} x\left(t\right)^{-1}\)

From:
Capture_20220921-141219.jpg
Capture_20220921-141219.jpg (16.96 Kio) Consulté 1882 fois

Re: Latex possible bug?

Publié : sam. sept. 24, 2022 1:35 am
par lukamar
New latex conversion omits parentheses when applying functions to simple arguments like e.g. x. I will add an additional condition that the argument must be a one-letter symbol, which should make the output better (one-letter symbols are typeset in italic, so removing parentheses wouldn't affect readability).

Re: Latex possible bug?

Publié : dim. sept. 25, 2022 6:29 pm
par XcasEngGuy
Sounds good, Thanks