[XeTeX] xetex + listings + inputencoding
M. Niedermair
m_g_n at gmx.de
Wed Feb 4 09:02:25 CET 2009
Hi,
what is the best way, to include listings in utf8/iso8859-1 encoding.
In the listings doc i found:
inputencoding=<encoding>
determines the input encoding. The usage of this key requires the
inputenc package; nothing happens if it’s not loaded.
% ---------------------------------
\documentclass{scrartcl}
\usepackage{xltxtra}
\usepackage[final,writefile]{listings}
\lstloadlanguages{java,HTML,[AlLaTeX]TeX,make}
\begin{document}
Listing 1 (utf8)
\lstinputlisting{list1.java}
Listing 2 (iso8859-1)
\lstinputlisting[inputencoding=latin1]{list2.java}
\end{document}
% ---------------------------------
If i use the sample, i see the correct chars in list1.java, but in
list2.java the chars are missing.
If i use the package inputenc, i get the message
*** you should *not* be loading the inputenc package
If i use
\usepackage[inputencoding=utf8/latin1]{listingsutf8}
i get some errors.
What can i do?
By
Michael
More information about the XeTeX
mailing list