From: Leo B. <leo...@um...> - 2021-12-22 13:25:09
|
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? imaxima It runs a maxima repl in emacs, producing output in latex, and can export the whole session to a latex buffer for editing. > I normally run Maxima inside Emacs using the low-level > way to send lines to its REPL described here - > > http://angg.twu.net/LATEX/2021emacsconf.pdf <- slides > http://angg.twu.net/emacsconf2021.html maxima.el has such facilities. > > I do have Fermin MF's maxima.el installed, > > https://gitlab.com/sasanidas/maxima > https://emacsconf.org/2020/talks/33/ > > but I don't understand it well yet, and when I tried to integrate it > with my way of doing things I stumbled on some quirks of its function > `maxima-string'... I tried to ask Fermin for help but he was too busy, > so I thought that it was better to wait until 1) he was in holidays, > 2) I had done more of my homework... anyway, I _think_ that I can > handle answers like "use Fermin's functions maxima-foo and maxima-bar" > - and answers that yield a command like > > savemaximasession(42, 99, "/tmp/foo"); > > that I can run in a Maxima REPL to save the cells 42 to 99 to /tmp/foo > as a maximasession block would be ideal... Try imaxima.el, I think it does much of what you want. Aside from merging Fermin's work back into Maxima's source tree, what is on my todo list is improving ob-maxima for org-mode integration, with the aim of providing a "workbook"-like experience. The current ob-maxima lacks many features... Leo |