Yeah, you're right, but I'm still going to argue. :) Indeed, the whole thing would work in Sage exclusively, or a combination of Sage and TeX (beyond SageTeX). Here are the priorities I was operating under; all are priorities for the end user of the package, not for the author of the package. (If I prioritized the needs of the author, I would simply abandon the project and play Wii with my kids instead. That's maximal convenience right there!)
1. If possible, do everything in one file rather than more than one, and one piece of software, rather than more than one. Putting everything in one LaTeX file (with optional problem bank .sty files for those who need that) or one Sage notebook (again, with optional problem banks) would satisfy this constraint. 2. If possible, let the user operate in TeX rather than Sage, for several reasons. 1. Most of what they write will be TeX, and only a little will be Sage. 2. Most people are more comfortable in TeX than Sage. 3. The user retains the freedom to put all manner of comments, images, headings, etc. before/between problems, etc. 4. Doing it in Sage means putting potentially nontrivial amounts of code in quotes (or user-defined functions or lambdas), which is awkward, and unnerving to Python/Sage newbies. Doing it in TeX (I had hoped) could make this step invisible to the user. I don't mean to ignore your wisdom that it's easier and more reliable to build stuff in Sage than in TeX; I not only confess that you know both better than I do, but even what I have seen of both makes me agree with you. I'm just saying that I was shooting to build the thing that would be maximally easy to use when I was done, and I don't think that something built in Sage is that thing, even before I consider the additional step of running it through TeX as a second step. In fact, it would be sufficiently less easy to use that I don't think I'd invest the effort in building it in the first place; my expected satisfaction with the end result isn't enough to motivate it. So my last attempt to get this to work will be along these lines: 1. If you don't mind, Dan, can you give me a little bit more information about exactly how it is that the verbatim-like nature of sagesilent blocks don't play well with \def and \newcomand? Here's why: 2. I'll take that information over to TeX stack exchange (where some people know astonishing amounts about the guts of LaTeX, btw) and see if any of them can tell me a workaround for how to get sagesilent environments to work inside \def or \newcommand. If that works, I'll use it and do my original plan. And if it doesn't, I'm giving up with a clean conscience. :) N On Friday, March 1, 2013 12:24:36 PM UTC-5, Dan Drake wrote: > > On Thu, 28 Feb 2013 at 06:46PM -0800, Nathan Carter wrote: > > Sure. The goal is to create a LaTeX package for randomly generated > exams. > > It should let you do something like this: > > [snip] > > You know, it looks like what you _really_ want is a WebWorK server. :) > > Looking briefly over your TeX stuff, my first thought is that you could > write a Sage/Python program that generated the problems, wrote them into > a file that TeX could read (a variation on the .sagetex.sout file), and > then in your exam file, just read them in. > > That works on a principle that I've learned working with SageTeX: do as > much as you can in Sage/Python, because programming there is sane and > reasonable, unlike programming in TeX. > > Dan > > -- > --- Dan Drake > ----- http://math.pugetsound.edu/~ddrake > ------- > -- 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 sage-edu+unsubscr...@googlegroups.com. To post to this group, send email to sage-edu@googlegroups.com. Visit this group at http://groups.google.com/group/sage-edu?hl=en. For more options, visit https://groups.google.com/groups/opt_out.