I would like to use ü
in the caption of my listings. It works with the lstinputlisting
command, but not with inputminted
:
\documentclass[11pt]{report}
\usepackage{geometry}
\geometry{a4paper, left=2cm, right=2cm, top=2cm, bottom=2cm}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage[ngerman]{babel}
\usepackage{color}
\usepackage{minted}
\newcommand{\code}[4][text]{
\inputminted[label=#3, frame=lines, framesep=2mm]{#1}{#2}
}
\begin{document}
\code[make]{makefile}{Gemeinheiten für Listing \ref{code:auto-einfach}}{code:gemeinheiten}
\end{document}
Makefile:
Bericht.pdf: Bericht.tex
pdflatex -shell-escape $<
This is the error when I use pdflatex
on that.
*** Error while highlighting:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)
(file "/usr/lib/python2.7/codecs.py", line 351, in write)
(./Bericht.out.pyg)
Runaway argument?
commandchars=\\\{\}
! File ended while scanning use of \FV@GetKeyValues.
<inserted text>
\par
l.16 ...ref{code:auto-einfach}}{code:gemeinheiten}
The error disappears when I remove the ü
.
How can I get this to work with umlauts?
\code
: you declare 4 arguments (the first one, optional and the other three mandatory), but then in the definition you do nothing with#4
?\lstinputlisting
as well, and that takes a fourth label argument. With minted, I currently do not use a float and therefore no label.