5

This is a follow-up question to UTF8 for listings

With these MWE I will not see the german umlauts in the resulted pdf (XeLaTeX was used):

\documentclass{article}
\usepackage{verbments}
\begin{document}
\begin{pyglist}[encoding=utf-8,language=text]
Test äöü Test
\end{pyglist}
\end{document}

What should I do to support UTF-8 in verbments?

Micha
  • 2,869
  • It doesn't compile in my system. – cacamailg Apr 22 '13 at 12:51
  • I use Debian and I have to install python-pygments first. To compile, I use xelatex -shell-escape inputtest.tex – Micha Apr 22 '13 at 13:01
  • Since I cannot install that package in my machine, I found a solution to deal with UTF-8 and listings here http://tex.stackexchange.com/questions/24528/having-problems-with-listings-and-utf-8-can-it-be-fixed (see the best answer). – cacamailg Apr 22 '13 at 13:29
  • well, this is not the answer to my question, because it's an follow-up question. listings in general has problems with UTF-8 but verbments was introduced to support unicode. Thanks for providing the link, too. – Micha Apr 22 '13 at 13:59
  • 2
    load the package fontspec which should be loaded by default of you use LuaLaTeX or XeLaTeX. – Marco Daniel Apr 22 '13 at 19:55
  • 1
    As Marco Daniel observes, you must load fontspec for the thing to work. – egreg Apr 22 '13 at 20:36
  • @MarcoDaniel: this was the solution! – Micha Apr 22 '13 at 20:45

1 Answers1

3

Your issue isn't related to verbments. It's a font issue related to German umlauts. XeLaTeX uses utf-8 as default but the predefined font doesn't support this. A look in the log file shows for the following example:

\documentclass{article}
%\usepackage{fontspec}
\begin{document}
Test äöü Test
\end{document}

related part of the log-file:

Missing character: There is no ä in font cmr10!
Missing character: There is no ö in font cmr10!
Missing character: There is no ü in font cmr10!

To work with German umlauts you have to load the package fontspec which should be loaded normally. See: Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX

Marco Daniel
  • 95,681