1 year ago

#235185

test-img

niklas

lstinputlisting adds cryptic line

i am using lstinputlisting in a latex document to include some source code. When I am giving a specific line range or firstline to start with there is a cryptic line added directly before my code looking like that:

code line added by latex

My latex code:

\lstset{  % Konfiguration
xleftmargin=0.5cm,
language=C++,  % C++ als Sprache vordefinieren. Optional überschreiben
basicstyle=\small,
backgroundcolor=\color{lgray},
keywordstyle=\color{black}\bfseries,
commentstyle=\color{black}\small,
showstringspaces=false,
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
tabsize=4,
showtabs=false,
}

\lstinputlisting[linerange=739-745]{Marlin/Configuration.h}

Does someone know where this line comes from and how to fix it?

Minimal example:

\documentclass[12pt, ngerman]{scrreprt}
\usepackage{listings}
\begin{document}
    \lstinputlisting[linerange={740-745}]{example.h}
\end{document}

latex

listings

lstlisting

0 Answers

Your Answer

Accepted video resources