|
|
Verbatim boxes in Maxima
- 1. Dednat6
- 2. Verbatim boxes in Dednat6
- 3. Maxima
Many of the objects that I use in my research start their life as
things that can be drawn in ASCII art. This...
Sometimes I need to typeset in LaTeX a figure in ASCII art, like
this one:
The most obvious way to typeset that would be to use \begin{verbatim}...\end{verbatim}, but that environment is very
fragile because it uses catcode tricks, and its variants, like verbatimbox, that are able
to generate boxes, aren't much better... so I added to Dednat6 a head that generates code like this:
\vbtbgbox{\vbox{\vbthbox{f\char95 \char95 .\ \ \ }%
\vbthbox{|\ \ |\ \ \ }%
\vbthbox{a\ \ b\char95 \char95 .}%
\vbthbox{\ \ \ |\ \ |}%
\vbthbox{\ \ \ c\ \ d}}}}
|
The first version of that was a very quick hack that I wrote for my
presentation on Dednat6 at TUG 2018. For example, the boxes in the page 4 of the
slides were generated by the lines starting with %V and %L
in this part of the LaTeX source of the slides.
In Maxima a matrix whose lines are strings with the same length
would look almost like the verbatim boxes above... but it would be much
uglier. We can get better "verbatim boxes", that are LaTeXed like
this,
by using
vbtbox(["f__. "],
["| | "],
["a g__."],
[" | |"],
[" b c"]);
|
instead of
matrix(["f__. "],
["| | "],
["a g__."],
[" | |"],
[" b c"]);
|
and by doing a texput('vbtbox, 'smop); defining the
function smop would be a simple matter of programming.
But I thought that it would be more fun to use CFFI to call my Lua
code from Lisp... the code is in these files, but it is a mess:
TODO: mention Lisptree, displa_delegate, asciirect...
|