[XeTeX] LaTeX to Xetex conversion query

Robert Spence spence at saar.de
Tue Jan 30 00:48:05 CET 2007

Rene, Pete,

On 29 Jan 2007, at 22:22 , Peter Dyballa wrote:

> Am 29.01.2007 um 17:11 schrieb Rene Borgella:
>> Now that I've been hearing about the wonderful world of XeTeX, I am
>> wondering how I can convert my previous LaTeX docs (as well as
>> write new
>> ones) to easily convert to html.

> You have to use UTF-8 encoding for the text. You should not set any
> input or font encoding.
> I have no idea how htlatex will handle the UTF-8 input ...

I use the following command (to typeset an input file named  
"index.tex" as the output file "index.html", using a TeX4ht  
configuration file "mycfg.cfg" that sets the parameters for the  
generation of the accompanying file "index.css" so that the .css file  
validates successfully; the .html file validates as XHTML 1.0):

htlatex index.tex "mycfg.cfg,xhtml,uni-html4" " -cunihtf -utf8"

I process the same input file "index.tex" with the command

xelatex -output-driver='xdvipdfmx' index

to produce "index.pdf".

To manage the page layout and typeface selection differences between  
XHTML and PDF output, I have a logical "if-then-else" structure  
inside the input file that looks something like this:

\usepackage[hscale=.7, vscale=.80, centering, verbose]{geometry}
\setsansfont[Scale=1, %
Minion Pro Bold
Minion Pro Bold Italic%
SmallCapsFont={Minion Pro},%
\setromanfont[Scale=MatchLowercase,LetterSpace=-3.0]{Lucida Sans}
\setmonofont[Scale=MatchUppercase, WordSpace={0.5,0.4,0.6}]{Monaco}

I know next to nothing about how or why all this works (or whether it  
still works after you make the big leap to TeX Live 2007 and/or the  
latest gwtex), but the developers (Jonathan Kew for XeTeX and Eitan  
Gurari for TeX4ht) can usually provide quick answers to concrete  
questions.  I know that Eitan Gurari reads the TeX on Mac OS X  
mailing list; however, he said in a posting on 11 October that his  
mail filter is set up so that only messages which have one of the  
following words in the subject line get through:
tex4ht, xhlatex, htlatex, mzlatex, oolatex, laspeak

There's some brief documentation at
that contains some examples of various alternative command line  
options one can play around with when using TeX4ht ...

If you're looking at the XeTeX documentation, it's worth remembering  
that Jonathan Kew thinks and typesets in plain (Xe)TeX, i.e. doesn't  
commit himself to any particular macro package but leaves it up to  
the user to decide whether to use XeTeX in conjunction with LaTeX, or  
ConTeXt, or whatever.

Good luck,
-- Rob Spence
This stub is removable for your convenience.

More information about the XeTeX mailing list