From: Robert D. <rob...@gm...> - 2024-05-03 20:19:41
|
Foad, I tried the examples you gave, as I'm keen to make sure the TeX stuff is working ... > ```maxima > tex(sigma = matrix([sigma[xx], sigma[xy]], [sigma[yy], sigma[yx]])) > ``` > > in the maxima REPL and I it got stuck for some reason! Did you omit the semicolon or dollar sign at the end? If so Maxima will wait to see if there's more input. > I ran the same command in WxMaxima and I got > > ```latex > $$\sigma=\ifx\endpmatrix\undefined\pmatrix{\else\begin{pmatrix}\fi \sigma_{{\it xx}}&\sigma_{{\it xy}}\cr \sigma_{{\it yy}}&\sigma_{ {\it yx}}\cr \ifx\endpmatrix\undefined}\else\end{pmatrix}\fi $$ > ``` > > which is syntactically wrong. I dunno, I pasted that into a trivial document and latex says it's okay. What is the error you get? Are you maybe working with amstex instead of latex? >Then I tried Robert's suggestion: > > ```maxima > texput(sigma_xx, "\\sigma_xx"); > texput(sigma_xy, "\\sigma_xy"); > texput(sigma_yy, "\\sigma_yy"); > texput(sigma_yx, "\\sigma_yx"); In order to get the expected output, I think you need "\\sigma_{xy}" there. > tex(sigma = matrix([sigma_xx, sigma_xy], [sigma_yy, sigma_yx])); > ``` > > and I got > > ```latex > $$\sigma=\ifx\endpmatrix\undefined\pmatrix{\else\begin{pmatrix}\fi \sigma_xx&\sigma_xy\cr \sigma_yy&\sigma_yx\cr \ifx\endpmatrix\undefined}\else\end{pmatrix}\fi $$ > ``` > > which is also wrong. Well, latex says it's okay, and produces the expected DVI for that input. What is the error you're getting? > I tried the command > > ```maxima > sigma = matrix([sigma[xx], sigma[xy]], [sigma[yy], sigma[yx]]) > ``` > > inside the WxMaxima and used the LaTeX export, and I got > > ```latex > \[sigma\operatorname{=}\begin{pmatrix}{{sigma}_{\ensuremath{\mathrm{xx}}}} & {{sigma}_{\ensuremath{\mathrm{xy}}}}\\ > {{sigma}_{\ensuremath{\mathrm{yy}}}} & {{sigma}_{\ensuremath{\mathrm{yx}}}}\end{pmatrix}\] > ``` > > which, despite being a bit bloated, is a valid LaTeX equation. Well, given the \operatorname bit, I guess you must be working with amstex. Is that right? Does that account for the other problems? best Robert |