From: Alan G I. <ai...@am...> - 2008-05-12 16:16:21
|
On Fri, 09 May 2008, Jeff Anderson apparently wrote: > My suggested support for math in docutils will allow elbow room for > whatever math output format that a user wants. > My original message to the list details everything, but I'll sum it up > here. I'm looking to add a new directive, role, and a docutils xml tag > to handle math data. Each individual output writer will worry about the > end output format-- we don't have to favor one type of math over > another. We can support mathml, images and even jsmath if we wanted. If > someone wrote a Microsoft Word writer, they could even build in support > for outputting to Microsoft Equation. > One of the wonderful things about docutils is the ability to support > multiple output formats. All we have to do is treat html+mathml and > html+png as two different formats. Fortunately, they are similar enough > to have the same writer handle them both. > To make this possible, docutils needs to be able to understand when it > is handling an equation, and not just another block of raw > pass-through that it knows nothing about. That's where the new > directive, role, and XML tag come in. Once docutils can grasp that what > it is handling is equation code, it can handle it appropriately > depending on the output format requested. Currently the only way to > handle math is through hacks. You more or less have to hard code in your > math equations into your source, and have them tailored for the desired > output format using the raw directive. This destroys the portability of > rst documents. I want to bring that portability back when using equations. > Hopefully this answers the various questions on the thread! What remains unclear to me is exactly how this will differ from what Jens has done. Have you tried out his sandbox code? I use it successfully to produce both XHTML and LaTeX. I guess one difference is that you seem to be proposing that docutils have some kind of built-in support for math. I suppose this would have to be very generic and may be related to the general idea of plug-in support? Perhaps something along this line would be possible ... A ``math`` role and a ``math`` directive. Each would require that a "math handler" be declared. Then the "math handler" would have to be available as a plugin? I'm essentially whistling in the wind here, as I do not understand the docutils architecture. But I think the starting point for a discussion is this question: what can you not do with Jens's code that you would like to be able to do? Cheers, Alan Isaac |