Hello everyone,
are you aware of any way to include special characters (è,ò,à...) inside listings with the listings package? I tried the extendedchars=true option of the package, as well as using inputenc, fontenc, and their combination, but no way, it fails every time.
Or, should I try an alternate package?
Document Classes ⇒ National characters inside lstlisting environment
NEW: TikZ book now 40% off at Amazon.com for a short time.
National characters inside lstlisting environment
I've just tried inputenc with latin1 (ISO-8859-1) encoding, this seems to work fine. UTF-8 on the other hand doesn't work. If you only use Latin-1 characters, this could be an option for you. extendedchars should be enabled by default in newer versions of the listings package.
Code: Select all
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{listings}
% ...
\begin{lstlisting}
èàò
\end{lstlisting}
Re: National characters inside lstlisting environment
Thank you, this is similar to the answer the package author gave. I'll try this ASAP. My fault was always using UTF8
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
National characters inside lstlisting environment
Hi,
there's the package listingsutf8 that provides a workaround for using utf8 with listings when \lstinputlisting would be used.
Stefan
there's the package listingsutf8 that provides a workaround for using utf8 with listings when \lstinputlisting would be used.
Stefan
LaTeX.org admin