6

When trying to compile the following document with xelatex:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}

\begin{document}

äöüÄÖÜ

\end{document}

I get this error (sorry for the long paste):

This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/Debian)
 restricted \write18 enabled.
entering extended mode
(./umlauts.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, et
hiopic, farsi, arabic, pinyin, croatian, bulgarian, ukrainian, russian, slovak,
 czech, danish, dutch, usenglishmax, ukenglish, finnish, french, basque, ngerma
n, german, swissgerman, ngerman-x-2012-05-30, german-x-2012-05-30, monogreek, g
reek, ibycus, ancientgreek, hungarian, bengali, tamil, hindi, telugu, gujarati,
 sanskrit, malayalam, kannada, assamese, marathi, oriya, panjabi, italian, lati
n, latvian, lithuanian, mongolian, mongolianlmc, nynorsk, bokmal, indonesian, e
speranto, coptic, welsh, irish, interlingua, serbian, serbianc, slovenian, friu
lan, romansh, estonian, romanian, armenian, uppersorbian, turkish, afrikaans, i
celandic, kurmanji, polish, portuguese, galician, catalan, spanish, swedish, th
ai, loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)))
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def))
(/var/lib/texmf/tex/generic/babel/babel.sty
(/usr/share/texlive/texmf-dist/tex/generic/babel/germanb.ldf
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def))) (./umlauts.aux)

! Package inputenc Error: Unicode char \u8:äöü not set up for use with LaTeX
.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.9 äöü
          ÄÖÜ
? 

! Package inputenc Error: Unicode char \u8:ÄÖ not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.9 äöüÄÖ
              Ü
? 
Runaway argument?
! Paragraph ended before \UTFviii@two@octets was complete.
<to be read again> 
                   \par 
l.10 

? 
(./umlauts.aux) )
No pages of output.
Transcript written on umlauts.log.

But the file is in utf-8 encoded:

$ file -i umlauts.tex
umlauts.tex: text/x-tex; charset=utf-8

I cannot understand what I am doing wrong. Is my latex broken? I am using Texlive from the Ubuntu 12.10 repos.

3
  • 1
    Your code compiles with pdflatex, though. Please see tex.stackexchange.com/questions/2984/…
    – krlmlr
    Mar 10, 2013 at 20:18
  • 1
    The most voted answer in the question linked by @krlmlr says clearly that inputenc should not be used when processing with XeLaTeX. On the other hand, T1 encoded fonts may print the wrong glyph for non ASCII characters. So either use fontspec and OpenType fonts, or don't use XeLaTeX with that file.
    – egreg
    Mar 10, 2013 at 21:26
  • The comment by @egreg solves the problem. Results look fine if I remove inputenc and fontenc from the preamble.
    – verstexnix
    Mar 13, 2013 at 21:31

1 Answer 1

4

Myself, I use

\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}

Perhaps that will work for you too? (That said, I use pdflatex rather than XeTeX...)

3
  • 1
    Indeed. No amount of fiddling with options to inputenc and fontenc will fix this problem.
    – kahen
    Mar 10, 2013 at 20:21
  • In fact, this is distinctly bad practice or maybe even harmful when using XeLaTeX.
    – doncherry
    Apr 12, 2013 at 23:27
  • +1 No idea if it's bad in XeLaTex, but worked for me in LaTex!
    – Oriol
    Nov 17, 2013 at 20:46

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