On Fri, 20 Nov 2009 at 11:16AM +0100, Nicolas M. Thiery wrote: > > In Python, I could so something like > > > > the_verbatim_line.replace('sage: ', '', 1) > > > > but LaTeX does not make string handling easy. > > Precisely. So it sounds tempting to have latex write a quoted string > in the script: > > _st_.inline(10, "diff(3+x+2*x^3)") > > Instead of: > > _st_.inline(10, diff(3+x+2*x^3)) > > And then Python could do whatever preprocessing it wants with it. > > The two issues with that this could break the compatibility between > different versions of sagetex.py and the latex style file; also latex > should quote possible quotes in the string, which might get tricky.
Incompatibility between the "py and sty" files are not something I worry about; I think of those two as an inseparable pair. The quotes are a good idea, but you have to somehow eval() them and my previous experiments with eval() were not so successful. I'm not saying it won't work, just that I didn't have much success. Also, quoting the quotes would almost certainly be really hard -- what if someone already has a \" in the line? I am planning some SageTeX hacking around Christmas, since then this crazy semester will be over. I'm happy to take patches before then, of course. :) Dan -- --- Dan Drake ----- http://mathsci.kaist.ac.kr/~drake -------
signature.asc
Description: Digital signature