latex2html and UTF8 encoding
The last two days I have been fighting with latex2html. I am writing my books in LaTeX, in a Debian GNU/Linux machine. The .tex source file has UTF8 encoding, as has any new text file I create under Debian. One of the books it is written in Spanish, so there are a lot of accented characters:
á, é, í, ó, ú.
When I used pdflatex to generate a PDF document, all was ok, but when I tried to generate HTML with latex2html, the accented characters were generated as:
á, é, Ã, ó, ú
By the way the preamble of my .tex file was like this:
documentclass[10pt,letterpaper]{book}
usepackage[spanish]{babel}
usepackage[utf8x]{inputenc}
usepackage{makeidx}
author{Miguel Cobá}
title{Historias de Tristania}
begin{document}
maketitle
include{ch1}
end{document}
After a lot of research I finally could find the right invocation of latex2html to generate HTML correctly with accents:
latex2html -html_version 4.0,latin1,unicode book.tex
So, when using LaTeX to write something with accents, the encoding of the .tex files is UTF8 and want to generate HTML from the very same source .tex files, use the command above.
June 21st, 2008 at 3:27 am
Thanks a lot for the advice, i had the same problem and it´s all ok now!
October 24th, 2008 at 1:29 pm
Thank you, you also fixed my problem.
October 25th, 2008 at 10:40 am
I was also wrestling with this, thanks! That trick did it!
November 3rd, 2008 at 3:04 pm
Thanks, I was trying to convert my article (written in Italian) and I couldn’t figure out how to do it properly.
February 10th, 2009 at 4:47 pm
Thanks, 1UP!
March 18th, 2009 at 2:41 pm
Thank you for the tip!
November 12th, 2009 at 6:26 am
Thanks for the tip
January 31st, 2010 at 6:32 pm
thanks man , you really helped a lot
May 7th, 2010 at 7:09 am
Thanks for the info. What’s the difference between
\usepackage[utf8x]{inputenc}
and
\usepackage[utf8]{inputenc},
will it cause any trouble?
May 19th, 2010 at 8:28 am
¡Muchas gracias!
July 6th, 2010 at 5:51 am
Your hint save me a lot of time!
Muito obrigado!