On Wed, Jul 20, 2011 at 12:41, Johannes Wilm wrote: > > So you are saying that the binary, after reading a latex file, isn't quite > aware of the DOM-structure of the file, while after reading a Context-file > it is?
If you want to build the DOM structure, you need to know exactly what each command has to do. You need to know that \startformula should start <mathml>, you need to know that \bf starts <b>, ... In LaTeX this information is missing. LuaTeX engine doesn't know that \bf should switch to bold. The engine only knows that it needs to switch to a different font. If you take a look at what tex4ht does: it redefines almost every single LaTeX command and creates a special mark in dvi file, so that it knows how to create html or odt file out of it. ConTeXt does a very similar thing, except that it has that mechanism already built into relevant commands. If that information is missing in LaTeX, it won't help you to import just the \setupbackend part. Similar - since tex4ht didn't do as heavy redefinitions of ConTeXt commands as for LaTeX, it is nearly useless, even though it has exactly the same potential. Mojca
