(n + 1')th patch to mactex.lisp? How add texword prop to running maxima?
Subject: (n + 1')th patch to mactex.lisp? How add texword prop to running maxima?
From: steve at horne
Date: Fri, 16 May 2003 23:01:43 +0000
Hello Maxima users --
(n + 1')th patch to mactex.lisp? How add texword prop to running maxima?
Years ago (version 5.1?) I patched mactex.lisp to allow
strings to be inserted into the output file --
I wanted to produce a batch file that when "batched" or
piped through maxima, produced
a tex (in those days, now latex) file which was essentially complete.
Since I seem to be in math paper mode again,
I hacked the current version of mactex.lisp to do the same thing.
A typical use -- the .mc file might contain
= thing.mc====
load("/home/steve/maxima/mactex2.lisp")$
system("rm aa2.tex");
savtex(exp)::=
buildq([exp],tex(exp,"/home/steve/maxima/aa2.tex"))$
savtex("%Given: we need to move a distance $\\theta$,
in time $t$. Frictional deceleration is $b$,
motor acceleration $\\alpha_1$, deceleration $\\alpha_2$.
Find $\\alpha_1$ and $\\alpha_2$ such that the electrical
energy delivered is a minimum.");
/* The leading % flags it as a string */
savtex("%for time $t_1$, accel, then for time $t_2$, decel.");
x1: (alpha1-b)/2 * t1^2;
eq1: theta1=x1;
savtex(eq1);
====== and so forth===
A wrapper latex file does boilerplate, then \input aa2.tex to pull in the result.
To generate the paper,
maxima <thing.mc
pdflatex wrapper
does the trick.
There seem to have been a slew of patches to mactex.lisp,
but the (reasonably) current one
(from maxima-5.9.0) doesn't seem to do exactly what I want --
or does it? Is there some other technique to accomplish the same goal?
If not, and there's interest, I'll post the patch.
Question -- Is there a way, from maxima, to add a texword property
to the running lisp? I tried
lisp : (defprop $theta1 "\\theta_1" texword)
but it didn't seem to work. This would be a useful feature.
I recall SMP (predecessor of Mathematica) allowed something like this.
Thanks,
Steve