# How to use Greek symbols in the lstlisting environment?

If I put ∆ in lstlisting it converts it into space. How to avoid that? I need to write this code in lstlisting:

\begin{lstlisting}
\multiput(x,y)(∆x,∆y){n}{object}
\end{lstlisting}

• You need to literate it. See the manual for more information. Just an untested try: \lstset{literate={∆}{{\tiny$\Delta$}}1}. – TeXnician Jul 3 '17 at 12:54
• You're the man! – Josh Jul 3 '17 at 13:16
• @TeXnician sounds like an answer to me – cgnieder Jul 3 '17 at 13:37

lstlisting's output routine will need to know how to parse unicode input. So you need to provide those information. The right setting for that is literate. The common syntax is literate={<input>}{{<output>}}<number of characters>.
That means to literate your input delta you need to use something like \lstset{literate={∆}{{\tiny$\Delta$}}1}. Please note that using this output version might not look very pleasing to you. Maybe you want to use a different representation than a down-scaled capital delta, but you get the idea.