Latex possible bug?
Modérateur : xcasadmin
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Latex possible bug?
It appears that xcas is no longer putting in the parenthesis around the argument in sin:
The xcas entry: produces: \(\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}
The xcas entry: produces: \(\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}
- Pièces jointes
-
- Clipboard01.jpg (6.1 Kio) Consulté 2239 fois
-
- Clipboard01.jpg (6.1 Kio) Consulté 2240 fois
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex possible bug?
My post got corrupted somehow, hope you can understand it. I was not able to edit it.
Matt
Matt
Re: Latex possible bug?
It seems it is a question for Luka.
Note that you can run
in your session before converting to latex, this should switch to my old latex code with parenthesis around the argument.
Note that you can run
Code : Tout sélectionner
latex("legacy",1)
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex possible bug?
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}
\)
\(\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}
\)
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex possible bug?
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:
\(\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:
Re: Latex possible bug?
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).
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex possible bug?
Sounds good, Thanks