How is it possible to write a minus (-) in a code listing?
I'm using Texmaker and MikTex.
Here's a example:
Code: Select all
\documentclass{article}
\usepackage{listings}
\begin{document}
\begin{lstlisting}
a = 10;
a = 10 - 2;
\end{lstlisting}
\end{document}
Code: Select all
! Undefined control sequence.
<argument> \textminus
EDIT
Escape text solves this problem. But is this a good way?