5

When using htlatex command, the turkish characters "ç" "ğ" "ş" "ü" appear OK but when it comes to "ı", TeX4ht produces an image. Is there any way around this?

Edit: When I use another font like \usepackage[bitstream-charter]{mathdesign}, the letter "ı" never appears.

\documentclass[18pt]{article}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{center}
{\Huge ÖÇŞİĞÜöçşığü}
\end{center}
ÖÇŞİĞÜöçşığü


\end{document}

Output

enter image description here

Edit 2:

I have tried adding

\ifdefined\HCode\else
\usepackage[bitstream-charter]{mathdesign}
\fi

\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}

at the beginning and run

htlatex index.tex "xhtml,charset=utf-8" "-cunihtf -utf8"

the output is as follows.

enter image description here

padawan
  • 1,532
  • the space before -cunihtf is important, it doesń't work without it. alternatively, you can use make4ht, which is frontend for tex4ht and it has -u option for unicode output – michal.h21 Feb 17 '15 at 09:24

1 Answers1

7

You need to use special command line options to output the file in utf-8 encoding:

htlatex filename "xhtml,charset=utf-8" " -cunihtf -utf8"

regarding mathdesign package, many fonts are currently not supported by tex4ht usual way to solve package conflicts is to use conditional package loading:

\documentclass[18pt]{article}

\ifdefined\HCode\else
\usepackage[bitstream-charter]{mathdesign}
\fi

\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{center}
{\Huge ÖÇŞİĞÜöçşığü}
\end{center}
ÖÇŞİĞÜöçşığü


\end{document}

enter image description here

michal.h21
  • 50,697
  • I have tried this without mathdesign. The result is even worse. Should I force the browser to use UTF-8 some way? – padawan Feb 16 '15 at 23:34