3

I used htlatex to the following code (say foo.tex)

\documentclass[10pt]{article}
\usepackage{tikz}
\usepackage{amsthm}
\usepackage{amsmath} 
\usepackage{amssymb}
\usepackage{amscd}
\usepackage{makeidx} 
\usepackage{graphicx} 
\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
\usepackage{multibib}

\begin{document}

αβγδ 
{\it αβγδ}

\end{document}

I execute

mk4ht htlatex foo.tex "xhtml,mathml"

and the html file gave me the following αβγδ abgd

I would expect αβγδ *αβγδ*

That is can not translate right the \it with the greek characters.

Any idea?

Thank you.

1 Answer 1

3

This is caused by how tex4ht process fonts - special conversion files for each used font is used. This file is obviously missing for Greek italics. Simple solution is to disable italics font with tex4ht.

First of all, you should edit your source file and use

\textit{αβγδ}

instead of

{\it αβγδ}

because this form cannot be easily converted to html with this technique.

Then create custom config file config.cfg:

\Preamble{xhtml, mathml}
\begin{document}
\renewcommand\textit[1]{\ifvmode\ShowPar\fi\NoFonts\HCode{<em>}#1\HCode{</em>}\EndNoFonts}
\EndPreamble

This configuration will prevent usage of italics font and will insert <em> tags.

Compile with:

htlatex  foo.tex "config, charset=utf-8" " -cunihtf -utf8" 

Result:

<p class="noindent" >αβγδ <em>αβγδ</em>                                                              
</p>
2
  • Thank you for your answer. Almost work, I got the following, <p class="noindent" >abgd <em>abgd</em>. I found that htlatex give an error couldn't find font grmn1000.htf char:0--255
    – user37325
    Sep 26, 2013 at 17:11
  • Finally, the following work, htlatex foo.tex "config, charset=utf-8"
    – user37325
    Sep 26, 2013 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .