1

The following MCE points out that some characters (for instance , or ) have strange behavior (shifted on the left) in listings with lualatex (up to date TeX Live 2020). Do you know why?

\documentclass{article}
\usepackage{fontspec}
\usepackage{listings}

\begin{document}
\begin{enumerate}
\item §Foo§
\item «Foo«
\item €Foo€
\item →Foo→
\item ←Foo←
\end{enumerate}

\begin{lstlisting}
1. §Foo§
2. «Foo«
3. €Foo€
4. →Foo→
5. ←Foo←
\end{lstlisting}
\end{document}

enter image description here

Denis Bitouzé
  • 9,652
  • 4
  • 27
  • 85
  • 1
    See https://tex.stackexchange.com/a/25396/2388 – Ulrike Fischer May 26 '20 at 08:42
  • Not a big surprise, listings doesn't support UTF-8. You can try saving your listing in an external file and load it using listingsutf8 package. – Henri Menke May 26 '20 at 09:08
  • @HenriMenke AFAIK, listings doesn't support UTF-8 with pdftex engine; here I consider the luatex engine. And my MCE shows that listings, when used with luatex engine, supports at least some Unicode characters. – Denis Bitouzé May 26 '20 at 09:22
  • @UlrikeFischer I didn't find the question you link since I was searching with 'lualatex". So I think it is worth not considering my question as duplicate. BTW, do you think it is worth asking the listings maintainer to add (a limited part of) chars with Unicode positions above 256 to the processing list of listings? – Denis Bitouzé May 26 '20 at 09:32
  • it is always easier to find a question when you know it is there ;-). I have linked to this quite often. It would be worth to ask for the € as it is also in T1. Beside this it could be worth to ask for a proper "add range of chars"-inferface (but perhaps there is already one, my answer is from 2011 and I didn't checked if is can be done easier now). – Ulrike Fischer May 26 '20 at 09:46
  • @UlrikeFischer Attention of listings' maintainer drawn. – Denis Bitouzé May 26 '20 at 15:59

0 Answers0