An (eev-based) alternative to emaxima.styLong story short, in an image...
My main page on Maxima is here.
1. Introduction: emaxima.styMaxima comes with something called "EMaxima", whose main files - for me - are these ones: I was mainly interested in one feature of emaxima.sty - the one that is explained in page 10 of its manual, that typesets LaTeX blocks like this one,
The definition of the environment `maximasession' in emaxima.sty uses catcodes heavily, and so I couldn't put "\begin{maximasession} ... \end{maximasession}" blocks inside "\vbox"es or "\scalebox"es - it would by better to reimplement `maximasession' in another way. The package `emaxima.sty' is a bit hard to use. What I am going to explain in this page is an alternative to `emaxima.sty' that is much harder to use - and almost impossible to use if you are not me - but that has some ideas that I think that are worth documenting. 2. `emaxima.lisp'If we run this
the last part of the log is:
that is similar to the syntax that `maximasession' understands.
3. Maxima2.luaDednat6 is a LaTeX package that I wrote, and that I use to typeset many kinds of diagrams. It very unpopular: I only know one person who uses, or who has used it, besides me - a friend of mine called Fernando Lucatelli - but Dednat6 is very easy to extend, and sometimes I write new extensions for it as quick hacks. One of these extensions is Maxima2.lua. If I put this in a LaTeX file at any point after the part that loads Dednat6,
the "dofile" loads Maxima2.lua, that defines "%M" as a new "head"; the code for that is here. Then when Dednat6 processes the "%M"-block it simply puts the lines after the "%M"s into the global variable maxima_lines as a multi-line string, and when Dednat6 processes this line
it "output"s this LaTeX code:
The definitions for "\sa", "\ga", "\maximablue", and "\maximared" are here:
The "%M"-block is easy to tweak by hand. The "output" sends some (ugly!) TeX code both to the TeX part of lualatex and to stdout - it appears in the log, but I usually don't look at it. Note that the " "s and the "%"s in the "(%i)" lines of the "%M"-block were converted to "\%"s and "\ "s. This was done by Co1.lua, as a trick to quote certain characters without needing to change catcodes. The "\sa{sin-cos}" is a kind of "\def". I can expand its definition using "\ga{sin-cos}" - and I can do that inside the macros that I use for scaled multicolumn output. 4. Maxima2.lua: a demoYou can see a non-trivial example in this PDF. Note that it has a page that has two matrices with diagrams in its entries, that looks like this: See my page on Qdraw and MyQdraw for some explanations - but they are very incomplete at this moment. Links:
To download the source of that PDF and compile it on your machine, run this:
5. `find-Maxima2-links'To generate an "%M"-block from a Maxima program I use `M-x find-Maxima2-links' - where find-Maxima2-links is a very messy 5-minute hack. |