From: Leo B. <leo...@um...> - 2021-12-22 14:45:35
|
Leo Butler <leo...@um...> writes: > Eduardo Ochs <edu...@gm...> writes: > >> People, >> >> what are your favourite ways to convert a part of a log of a Maxima >> session to LaTeX? Let me explain what I did and what I need... >> >> I am on Debian and besides having Maxima installed from the Debian >> packages I also have a clone of the git repository of Maxima in the >> directory ~/bigsrc/maxima/. I was able to compile EMaximaIntro.tex >> with: >> >> rm -Rv /tmp/emaxima/ >> mkdir /tmp/emaxima/ >> cd /tmp/emaxima/ >> cp -v ~/bigsrc/maxima/doc/emaxima/EMaximaIntro.tex . >> cp -v ~/bigsrc/maxima/interfaces/emacs/emaxima/emaxima.sty . >> pdflatex EMaximaIntro.tex >> pdflatex EMaximaIntro.tex >> >> I followed the instructions in the pages 3 and 10 of EMaximaIntro.pdf >> and created a .tex file whose important parts were: >> >> \usepackage{emaxima} >> ... >> \begin{maximasession} >> diff(sin(x),x); >> integrate(cos(x),x); >> \maximaoutput* >> \i5. diff(sin(x),x); \\ >> \o5. \cos x \\ >> \i6. integrate(cos(x),x); \\ >> \o6. \sin x \\ >> \end{maximasession} >> >> When I LaTeXed it I got exactly the kind of output that I was looking >> for. >> >> My question is: how do I generate a maximasession block like the one >> above from inside a Maxima session? Can you recommend me a low-level >> way to do that? Another (low-level) way to do this is to load emaxima.lisp and set dispaly2d to emaxima. (%i2) load("emaxima.lisp"); (%o2) "emaxima.lisp" (%i3) display2d:'emaxima; (%o3) \mathrm{emaxima} (%i4) integrate(x^2,x); (%o4) {{x^3}\over{3}} (%i5) diff(sin(x),x); (%o5) \cos x (%i6) diff(cos(x),x); (%o6) -\sin x It is pretty straightforward to convert that output into the maximasession data you get from using emaxima-mode. Leo |