Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
1  
That seems to work, but I get tons of LaTeX Error: Command `\acute' already defined in `'. errors like with XeTeX. –  ℝaphink Sep 5 '11 at 10:24
2  
yes, I think there is no correct support for lualatex in tex4ht now, and this is the best what we could get. –  michal.h21 Sep 5 '11 at 10:43
    
Thanks. I'll select your answer anyway. –  ℝaphink Sep 5 '11 at 10:57
    
@Raphink: You can't use fontspec + system fonts with tex4ht. tex4ht.exe will be looking for tfm files. You can find some discussion about the problems in the thread starting here: http://tug.org/mailman/htdig/tex4ht/2011q3/000326.html –  Ulrike Fischer Sep 6 '11 at 17:24
1  
@MichaelWeibel see tug.org/applications/tex4ht/mn-commands.html#QQ1-9-33 –  michal.h21 Mar 5 '13 at 9:05
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.