|
From: Foad S. F. <f.s...@gm...> - 2024-05-03 21:10:53
|
Hi Robert,
Thanks a lot for your kind and quick response. Please see my remarks
between your lines below: 👇
On Fri, May 3, 2024 at 10:19 PM Robert Dodier <rob...@gm...>
wrote:
> 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.
>
Gee, what an embarrassing mistake. You are right; I had forgotten the
semicolon!
>
> > 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?
>
You are right again. I copied and pasted it into a LaTeX document, and it
works. I was using KLatexFormula to test the equations, as I always do to
avoid compiling the long LaTeX documents every time. Here
<https://pastebin.com/raw/r32uVJ8n> is the error message I got there.
>
> >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?
>
Same as above, embarrassing! (-‸ლ)
>
> > 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?
>
The packages that KLatexFormula includes in its preamble are `amsmath`,
`amssymb`, and `amsfonts` by default.
Best,
F.
>
> best
>
> Robert
>
|