>> I usually use
>>
>>   XML/Custom -> HTML
>>              -> LaTeX  -> postscript
>>                    -> pdf
> [snip]
>> I then create custom parsers based on REXML to convert the XML source
>> into HTML and LaTeX. I use the same parsers for all similar documents,
>> i.e., one for letters, one for articles, etc. 

[Horacio L?pez]:
> by any chance... is the XML-to-LaTeX converter publicly available ?

Well, as I said, there is no single XML-to-LaTeX converter. I use different
ones for different projects. And I tend to add features as I need
them, which means the features I don't need are not there.

But to get an idea of how I go about. Here is XML for a letter (not
well-formed, I know, I usually don't care about that unless I have
to):

	<to>
		Yukihiro Matsumoto
		Japan
	</to>

	<hi>Hello,</hi>

	<body>
	<p>Thanks for creating <b>Ruby</b>.</p>

	<p>It's <i>great</i>.</p>
	</body>

	<bye>Best regards,</bye>

And to convert it to a LaTeX letter, I use the following code:

	require 'rexml/document'

	module REXML
	  class Text
		def latex; string; end
	  end
	  class Element
		def latex
		  sub = map {|e| e.latex}.join
		  case name
		  when 'b' then "{\\bf #{sub}}"
		  when 'i' then "{\\it #{sub}}"
		  when 'p' then "\n\n#{sub.strip}\n\n"
		  else sub
		  end
		end
	  end
	end

	class LatexLetter
	  def initialize(doc); @doc = doc; end

	  def to
		@doc.elements['to'].text.strip.gsub(/\n/) {" \\\\ "}
	  end

	  def method_missing(sym, *a)
		@doc.elements[sym.to_s].latex
	  end

	  def latex
		return %Q{\\documentclass{letter}

		\\begin{document}
		\\raggedright

		\\begin{letter} {#{to}}
		\\signature{Niklas Frykholm}

		\\opening{#{hi}}
		#{body}
		\\closing{#{bye}}

		\\end{letter}
		\\end{document}}
	  end
	end

	puts LatexLetter.new(REXML::Document.new File.new('test.xml')).latex

// Niklas