There is a specific command to run tex4ht with XeTeX: htxelatex
(which doesn't really work actually as far as I'm concerned).
What is the command to run text4ht with LuaTeX instead?
Edit Oct 2015:
Issues with babel are now fixed, the document can be compiled without errors.
make4ht, new build tool for tex4ht
supports LuaLaTeX out of the box, you can just use
make4ht -l filename
The minimal sample file may look like this:
\documentclass{article}
\usepackage[czech]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\begin{document}
Příliš žluťoučký kůň úpěl ďábelské ódy. Nazd\~ar
\end{document}
There is also some experimental support for Fontspec
, see my guide
Original post
You can try this shell script, windows version is there
#!/bin/sh
lualatex --output-format=dvi --jobname=$1 $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
lualatex --output-format=dvi --jobname=$1 $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
lualatex --output-format=dvi --jobname=$1 $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
tex4ht -.dvi -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
t4ht -.dvi -f/$1 $4 ## -d~/WWW/temp/ -m644
save it as htlualatex
and make executable.
This code sample
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{luainputenc}
\begin{document}
\section{Does it make sense?}
Příliš žluťoučký kůň úpěl ďábelské ódy
\end{document}
gives some compilation errors about invalid utf-8 sequences, but the html output is correct. Without \usepackage[utf8]{luainputenc}
the output file ended at the first accented character.
LaTeX Error: Command `\acute' already defined in `'.
errors like with XeTeX.
http://tug.org/mailman/htdig/tex4ht/2011q3/000326.html
Commented
Sep 6, 2011 at 17:24