> Also, I'd like to get just the raw TeX associated with a
> Maxima variable without the $$'s around the string...
> Where is the TEX function defined? Is there a doc? How
> would I customise this? I am a LISP virgin!
Lisp isn't needed to get a string out of the tex function: use
tex(<<expression>>,false).
Unfortunately, Maxima is very weak on string manipulation primitives.
To extract xxx from $$xxx$$, you can use the following somewhat ugly
Maxima code:
stripped_tex(expr):=
block([str: tex(expr,false)],
concat("",?subseq(str,2,?length(str)-2)))$
Hope this helps.
-s
For those who care about the gory details:
-- tex(...,false) actually returns a Lisp string, not a Maxima string.
(Until we convert Maxima to consistently use Lisp strings, I consider
this a bug.)
-- ?xxx refers to the Lisp symbol xxx.
-- The Lisp function ?subseq operates on Lisp sequences (including
strings) and uses zero-based indexing. We really ought to add some
basic string manipulation functions to Maxima.
-- The Maxima function concat("",...) converts a Lisp string to a Maxima
string. It probably works to omit this.