From: Pierre-Charles David Date: 2001-10-19T22:31:41+09:00 Subject: [ruby-talk:22742] [ANN] texml.rb 0.3 Available at: http://purl.org/net/home/pcdavid#texml.rb From the webpage: texml.rb: a small rewrite of Douglas Lovell's TeXML tool (originally in Java) in the Ruby language. It might not support all the features of the original, and probably has bugs, but it works well enough for my needs and may be useful to others. It's released under the GPL license, and requires the xmlparser extension for Ruby, to be found on RAA. TeXML consists in two things: * An XML dialect modeled after the structure of (La)TeX documents. This dialect replaces (La)TeX commands with corresponding XML elements. For example, the (La)TeX source fragment \texttt{some text} can be represented in TeXML as some text. The DTD for this dialect and its usage is presented in detail in Mr. Lovell's article TeXML: Typesetting XML with TeX, Douglas Lovell, IBM Research, in TUGboat 20.3, Proceedings of the 1999 Annual Meeting, available in PDF here. * A small utility to convert an XML document conforming to this DTD into a syntaxically correct (La)TeX source file, ready to be typeset. The orginal tool is writtent in Java by M. Lovell; what I provide here is a re-implementation of this tool (based on the information in the article) in the Ruby programming language. TeXML allows you to leverage the power and robustness of TeX's typesetting engine to present your XML documents. Typical usage is: 1. Convert your XML document into TeXML using an XSLT stylesheet. 2. Use texml.rb to convert the resulting file into (La)TeX. 3. Use (La)TeX to typeset the file. % xslt docbook2texml.xsl report.xml | texml.rb > report.tex % latex report.tex In the long term, XSL:FO (XSL Formatting Objects) should provide the same kind of functionnalities (quality typesetting of XML documents), but current implementations are not as mature (by far) as the TeX engine. Also, XSL:FO is very low level (comparable to bare TeX), whereas TeXML allows you to write LaTeX files, which have a higher level of abstraction, and for which lots of useful extension packages exist. In theory, you could write your XSLT stylesheet to output directly (La)TeX source, but I find it more convenient to ouput XML. This allows you to do some post-processing on the files more easily, and with this tool, the conversion is painless. -- Pierre-Charles David (pcdavid emn fr) Computer Science PhD Student, �cole des Mines de Nantes, France Homepage: http://purl.org/net/home/pcdavid