[XeTeX] XeTeX to (X)HTML

Jonathan Kew jonathan_kew at sil.org
Wed Apr 26 10:12:05 CEST 2006

On 26 Apr 2006, at 8:52 am, digital donkey wrote:

> I was wondering if anyone has any experience converting XeTeX LaTeX
> documents to (X)HTML.
> So far I have looked at the following two TeX to HTML converters:
> Ltoh ( http://quong.com/ltoh/ )
> Written in Perl. Great customization for handling commands and
> environments. This is especially cool since one can wrap fontspec
> rules to appropriate style classes in an HTML span tag. But as far as
> I can tell it doesn't handle Unicode (though this may be a trivial
> fix)

Perl has pretty extensive support for Unicode, so that should be  
feasible. Just a SMOP, I guess. :)

> TeX4ht
> ( http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html )
> The authoritative TeX to HTML converter. Supports Unicode input and
> output natively. However, it processes .dvi files, so it doesn't like
> XeTeX by default. I haven't tried feeding XeTeX's .xdv directly to
> tex4ht yet.

I'm very confident this won't work; anything that reads .dvi would  
have to be modified to understand .xdv. (The modifications aren't  
huge, but they're definitely not optional!)

In any case, working from .xdv would not a good way forward, as  
the .xdv file does not contain Unicode character codes for your  
Unicode text; it contains (font-specific) glyph codes. This is  
necessary in order to capture the results of OpenType/AAT features,  
complex script behaviors, etc., but it means that you can't easily or  
reliably derive the original Unicode text from the .xdv file. This  
should be considered a format for display/printing only.


More information about the XeTeX mailing list