[luatex] XML export from Latex

Michal Hoftich michal.h21 at gmail.com
Tue Mar 11 17:05:07 CET 2014

Hi Stefano,

yes I am relying on .4ht files provided by tex4ht, tex4ht.sty is
loaded by lua4ht.sty in the case it wasn't loaded by calling script
(like `make4ht -lun -m draft filename`). So this means that you still
need to provide .4ht files in order to insert html tags.

But because lua4ht has full access to nodes created by luatex, some
interesting things are possible. I am exploring possibility of using
`mlist_to_hlist` callback to convert math nodes to mathml, because
mathml implementation in tex4ht depends on some tricks with dvi file
and I don't know whether these tricks are possible to emulate in node
callbacks. Other things which may be possible and which are not
supported with tex4ht is support for vertical skips and rules.

Best regards,

2014-03-10 20:18 GMT+01:00 stefano franchi <stefano.franchi at gmail.com>:
> On Fri, Mar 7, 2014 at 3:26 AM, Michal Hoftich <michal.h21 at gmail.com> wrote:
>> Hi Stefano,
>> tex4ht works with LuaLaTeX, but no htlualatex script is provided by
>> default.  There are some conflicts between tex4ht and babel, but these
>> errors don't affect output, only compilation is stoped.
>> To workaround problems with babel, making local copy of html4.4ht file
>> and converting it to utf8 encoding should help. Note that polyglossia
>> doesn't work, because it loads fontspec and opentype fonts (or, more
>> precisely, fonts without tfm table) don't work with tex4ht dvi to xml
>> converter.
>> Regarding direct conversion conversion from LuaLaTeX to xml without
>> need to use dvi processing, it is possible. I created simple demo, or
>> proof of concept [1]. Not all things supported by tex4ht works, but as
>> you can see, fontspec works without the need of patching.
>> PS.
>> Note that make4ht [2] is not the same thing as mk4ht, it is simple
>> build tool which enables configuration of commands used for conversion
>> of images, post-processig generated files etc.
> Hi Michal,
> thanks for your suggestions. Both the approaches you suggested sound
> very promising.
> I haven't tried either yet, but I will definitely look into them
> closely in the near future.
> The direct Luatex-->XML approach you provided a proof of concept for
> would definitely be my choice,
> but I admit it seems quite a challenging task to bring over all the
> Latex features I would like to see in the final XML output.
> There is something I am not quite sure about: where is the conversion
> from latex commands to html code configured?
> In tex4ht that happens in the .4ht files corresponding to the single
> packages, if I'm not mistaken.
> Are you relying on the same .4ht files?
> Stefano
> --
> __________________________________________________
> Stefano Franchi
> Associate Research Professor
> Department of Hispanic Studies         Ph:   +1 (979) 845-2125
> Texas A&M University                          Fax:  +1 (979) 845-6421
> College Station, Texas, USA
> stefano at tamu.edu
> http://stefano.cleinias.org

More information about the luatex mailing list