All my listings labels appear with prefix 1. in all sections, such as the following example, where the second listing of my paper in section 2 appears with the prefix 1. rather than 2.
I have already realized that \maketitle
is the root of this behavior. If I remove \maketitle
the labels appear correctly with 1 and 2, rather than 1.1 and 1.2.
How can we keep consistent numbering with the following llncs template:
\documentclass[runningheads]{llncs}
\usepackage{listings}
\begin{document}
\title{PetClinic Sample}
\maketitle
\section{Intro}
\label{sec:alternatives}
We will use the PetClinic Spring~\ref{lst:input}
\begin{lstlisting}[language={HTML}, caption={Button}, label={lst:button} ]
<button></button>
\end{lstlisting}
\section{Idioms}
\begin{lstlisting}[language={HTML},caption={Input},label={lst:input}]
<input>
\end{lstlisting}
\end{document}
\usepackage{chngcntr}\begin{document}\counterwithout{lstlisting}{section}
will number listings continuously and not per section. However, Springer may not like it if you do that, so if you are planning to submit this somewhere then it may be changed back upon publication.