I want to have Umlauts in a latexdemo environment.
MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{latexdemo}
\begin{document}
\begin{filecontents*}{\democodefile}
Großschreibung
\end{filecontents*}
\PrintDemo{style=parallel}
\end{document}
pdflatex compilation error:
! Package inputenc Error: Unicode char ├\lst@ECƒ (U+9E9F)
(inputenc) not set up for use with LaTeX.
Sure, it compiles fine with lualatex.
I tried adding listingsutf8, I assume, there is more configuration needed?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{latexdemo}
\usepackage{listingsutf8}
\begin{document}
\begin{filecontents*}{\democodefile}
Großschreibung
\end{filecontents*}
\PrintDemo{style=parallel}
\end{document}
lstlistingsutf8manual, it does nothing on its own. Try adding\lstset{inputencoding=utf8/latin1 }, and remember this only works for characters representable in latin1 – daleif Mar 09 '18 at 15:37cœur. See also https://tex.stackexchange.com/questions/25391/the-listings-package-and-utf-8/25396#25396 – Ulrike Fischer Mar 09 '18 at 15:49