On 2/23/13 4:11 PM, Nathan Carter wrote:
Harald's idea sounds like a great one, so I tried to implement it. I
have no problem creating Python objects with arbitrary _latex_()
methods, but then there's no way to insert them into the document. The
only way to get Sage output into the document is with the \sage{...}
command, which seems to be built only for inline and in math mode. You
can't, for example, create an object whose LaTeX representation is
several paragraphs long, with display math and so on in it, and then try
to do \sage{thatObject}. You get a ton of errors of various kinds,
including ones about paragraph breaks in places they shouldn't be.
Doing it this way (creating Python objects to store the problems) was
important to me, because I hoped to create a solution that didn't just
generate random problems each time the document was compiled, but also
(a) automatically generate several versions of the exam/worksheet in the
same LaTeX document (concatenated), and (b) permute the problems
differently in each version. Is this hopeless or does someone here know
a relevant SageTeX trick that I don't?
One thing you might do is use \sagestr to just include the output
directly into the tex file, without running the _latex_ method. See
page 6 of the sagetex manual.
Jason
--
You received this message because you are subscribed to the Google Groups
"sage-edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-edu?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.