I was passing some documents I had in HTML to LaTeX for a better printout. While the main language of those documents is Spanish (and a few more are in English) there have snips in other languages, including languages that do not use Latin-1, such as Greek and IPA extensions.
Here is a minimal working example of what I am doing.
\documentclass[12pt]{book}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\Large
El término democracia viene del griego \textit{δημοκρατία}
(pronunciado \textsf{/ðimokɾatía/}) y que significa gobierno
del pueblo.
\end{document}
The document is correctly encoded in UTF-8 (I've check with low-level tools).
When attempting to compile using pdflatex
I get the following error fore each of the non-latin-1 characters.
! Package inputenc Error: Unicode char \u8:δ not set up for use with LaTeX.
And, indeed, those glyphs do not appear in the document:
Supposedly xelatex
should correct this problems, as it is supposedly Unicode-ready, however, with the same code I get the following errors:
! Package inputenc Error: Unicode char \u8:érm not set up for use with LaTeX.
! Package inputenc Error: Unicode char \u8:ðimo not set up for use with LaTeX.
! Package inputenc Error: Unicode char \u8:ía/ not set up for use with LaTeX.
(It does not report error in the Greek or IPA characters, only in the Latin-1 extended ones)
Neither these reported character groups, neither the Greek characters appear in the produced document:
I have isolated the xelatex
error to the inputenc
package. If I comment out that package the document compiles smoothly (the same happens with lualatex
). Still the Greek and IPA characters do not appear.
(And, of course, without inputenc
the pdflatex compilation, while not reporting any error, does not behave well either, I presume it is mapping each byte to the T1 encoding):
So, there are actually two questions:
How can I get to correctly get the Greek and IPA (and probably other non-Latin characters) to appear in my document bot using
pdflatex
and(xe/lua)latex
?How can I mask the
inputenc
so that it loads withpdflatex
but not with(xe/lua)latex
?
inputenc
orfontenc
at all.