Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've already Googled it, without concrete success. So, I'd like to know if someone knows a converter from XML to TeX. Something "simple" as latex2rtf.

share|improve this question
    
Could you elaborate whether you want to translate a specific XML-based document format (like FO or docbook) or general "xml data" to TeX. Maybe give an example of expected input/output? –  Stephan Lehmke Jul 2 '12 at 7:06
add comment

2 Answers

XML is a file format not a language of any sort so asking for a general XML to latex is like asking for ASCII to latex. In general it depends what is in the XML file, one would not expect the same latex formatting for an XSLT program as a XHTML document, just because they both happened to use an XML syntax.

In general you need to specify the styling you want for the XML language in use. XSLT is perhaps the canonical tool for this, however it is possible to get TeX to read the XML directly and apply formatting from a stylesheet. xmltex does this for LaTeX and ConTeXt has similar facilities built in.

For example, one specific translation: If you want to translate mathematics encoded in XML as MathML to LaTeX markup you could use the pmml2tex XSLT translation available from http://code.google.com/p/web-xslt/source/browse/trunk/pmml2tex

share|improve this answer
3  
\usepackage{smartass}: "XML is ... not a language of any sort": Isn't XML called "extensible markup language"? –  topskip Jul 1 '12 at 14:41
3  
True, but one man's metalanguage is another man's data: So yes it is a language of some sort but not in the same sense as LaTeX. –  David Carlisle Jul 1 '12 at 20:09
add comment

You can use XML + XSLT to produce a (La)TeX document, exemplified by TeXML. For example:

http://opera.inrialpes.fr/people/Tayeb.Lemlouma/MULTIMEDIA/XSLT/X2L.html

As others have noted, it won't be as "simple" as running xml2tex, but if you first transform your XML document (using XSLT) into an XML format already supported by existing tools, then you could leverage a tool to finish the job. Your process would resemble:

XML/XSL + XSLT -> TeX Document + TeX Engine -> Final Output

See also these tools and web sites:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.