TeX output from Maxima 5.9.0



I am relatively new to Maxima, but have tried to find the answer to this
question in the FAQ and docs.

I am using Maxima as part of a computer aided assessment system to
automatically mark students' work, and as part of this am concatinating
strings to generate feedback.  I would like to capture the output from the
TEX function as a string.  For efficiency reasons I don't want to write to
a file and then load this back.

Also, I'd like to get just the raw TeX associated with a Maxima variable
without the $$'s around the string - sometimes I'd like to produce inline
equations, or construct arrays say, with specified entries.  In short I'd
like a little more control. 

Where is the TEX function defined?  Is there a doc?  How would I customise
this?  I am a LISP virgin!

The sort of syntax I'd like is the following:


 WrongAnswer: x^2/2*EXP(x)+c;
 Integrand:x*EXP*(x);

 FB1:"Incorrect answer.  You were asked to integrate $"$
 T1:TEX(Integrand);
 FB2:"$.  The derivative of your answer should be equal to the function that you were asked to integrate.  In fact the derivative of your answer is \\["$
 T2:TEX(Diff(WrongAnswer,x));
 FB3:"\\] So you must have done something wrong!"$

 FeedBack:CONCAT(FB1,T1,FB2,T2,FB3);

Many thanks in advance for any advice.

Chris Sangwin
----------------------------------------------
LTSN Maths, Stats & OR Network
School of Mathematics and Statistics
University of Birmingham
Birmingham, B15 2TT
United Kingdom
+44 121 414 6197
----------------------------------------------