ConTeXt vs. LaTeX -> XML/MathML -> XHTML/SVG/PNG -> ePub
On Mon, Aug 2, 2010 at 10:10 AM, Grant W. Petty
I am trying out ConTeXt for the very first time, hoping to assess whether it's worth re-tooling from LaTeX for authoring scientific textbooks.
To elaborate on this comment which I made in another thread, I have written and self-published two university-level atmospheric science textbooks in LaTeX which are doing quite well by the standards of my small field. I am now also contracting to publish textbooks for other authors. I am very interested in eventually reformatting my own existing books, as well as future books, as documents that can be both printed as professional-quality bound textbooks as well as distributed as e-books -- for example ePub format and/or XHTML. The principle technical hurdle seems to be posed by the heavy use of mathematical equations. I want the math in the electronic versions to be very clean and scalable (e.g., SVG; eventually MathML as e-readers do a better job of supporting it). While there are programs like TeX4HT and LaTeXML that convert LaTeX source to XML/MathML, they seem to have trouble with unfamiliar packages and macros, and the math rendering seems quite imperfect as well (though I can't yet tell whether that's a problem with the conversion to MathML or rather with current e-readers imperfect support for MathML). My question is whether anyone has insight into the relative strengths of LaTeX vs. ConTeXt as an authoring environment in the specific case that the author wants high-quality multi-format outputs for print and electronic distribution. An example workflow I could imagine would be ConTeXT or LaTeX source -> XML/MathML (DocBook?) -> PDF or XHTML with math encoded as MathML and/or SVG and/or PNG -> ePub with high-quality math readable on various commercial readers I'm quite new to this subject matter, having only begun to learn about e-publishing formats a couple of weeks ago, so I'll welcome any advice, however basic. It's my impression, by the way, that ConTeXT does not directly support AMSMath, which might mean having to not only rewrite a lot of existing source but also to re-learn how to write math. Thanks, Grant
On Mon, 2 Aug 2010, Grant W. Petty wrote:
On Mon, Aug 2, 2010 at 10:10 AM, Grant W. Petty
wrote: I am trying out ConTeXt for the very first time, hoping to assess whether it's worth re-tooling from LaTeX for authoring scientific textbooks.
To elaborate on this comment which I made in another thread, I have written and self-published two university-level atmospheric science textbooks in LaTeX which are doing quite well by the standards of my small field. I am now also contracting to publish textbooks for other authors.
I am very interested in eventually reformatting my own existing books, as well as future books, as documents that can be both printed as professional-quality bound textbooks as well as distributed as e-books -- for example ePub format and/or XHTML. The principle technical hurdle seems to be posed by the heavy use of mathematical equations. I want the math in the electronic versions to be very clean and scalable (e.g., SVG; eventually MathML as e-readers do a better job of supporting it).
While there are programs like TeX4HT and LaTeXML that convert LaTeX source to XML/MathML, they seem to have trouble with unfamiliar packages and macros, and the math rendering seems quite imperfect as well (though I can't yet tell whether that's a problem with the conversion to MathML or rather with current e-readers imperfect support for MathML).
I think that it is better to test mathml on a recent web browser rather than ereaders.
My question is whether anyone has insight into the relative strengths of LaTeX vs. ConTeXt as an authoring environment in the specific case that the author wants high-quality multi-format outputs for print and electronic distribution. An example workflow I could imagine would be
ConTeXT or LaTeX source -> XML/MathML (DocBook?) -> PDF or XHTML with math encoded as MathML and/or SVG and/or PNG -> ePub with high-quality math readable on various commercial readers
I'm quite new to this subject matter, having only begun to learn about e-publishing formats a couple of weeks ago, so I'll welcome any advice, however basic.
Context/latex to xml will never work unless you are willing to restrict yourself to a subset of supported input syntax. If you are willing to do that, then a cleaner alternative to is to *input* all your text as XML. For plain text XML is not too verbose, but MathML is a pain to type by hand. There are various libraries that convert tex math markup to mathml that may ease the task. If the math is not too complicated, one option is to use asciimath. ConTeXt has some basic support for asciimath, and I believe that it is possible to convert asciimath to mathml. Another option is to explore Microsoft's linear math format. It has a well defined grammer, so in principle it will be much easier to convert it to latex/context/mathml input. The big advantage of using such a setup is that you can use the same source to display the document on web (or epub, which is essentially zipped xml files) and to generate pdf (context handles xml input very well). One less toolchain to debug.
It's my impression, by the way, that ConTeXT does not directly support AMSMath, which might mean having to not only rewrite a lot of existing source but also to re-learn how to write math.
You can start by looking at http://dl.contextgarden.net/myway/context-latex-math.pdf Aditya
participants (2)
-
Aditya Mahajan
-
Grant W. Petty