# With package lstlistings the word “columns” appears before every code

\documentclass{article}
\usepackage{lstlistings}
\lstset {language=C++,
basicstyle=\small
columns=flexible,
stepnumber=0.8,
numbersep=8pt,
tabsize=4,
showspaces=false,
showstringspaces=false
}

\begin{document}
\begin{lstlisting}
CODE
\end{listing}
\end{document}


The problem is that the when I create the PDF I get

somewhat like

PDF Starts:

columns

CODE

:PDF Ends

Why is there a "columns" before my CODE and how can I remove it?

• Welcome to TeX.SX! There is a bunch of errors: \usepackage{listings}, not lstlistings and there is , missing after \small (which causes your problem), but another error is \end{listing} .. it should read \end{lstlisting}
– user31729
Jan 4, 2017 at 16:55
• (1) welcome, (2) see if you are not missing a comma after \small Jan 4, 2017 at 16:56

The comma missing after \small makes the pdfcompiler write columns in your pdf. In the following code the script is correct.

\documentclass{article}
\usepackage{listings}
\lstset {language=C++,
basicstyle=\small,
columns=flexible,
stepnumber=0.8,
numbersep=8pt,
tabsize=4,
showspaces=false,
showstringspaces=false
}

\begin{document}
\begin{lstlisting}
CODE
\end{lstlisting}
\end{document}