6

I have a problem with the listings of my latex document. I am using the "listings" package (not the "listing" package).

Although the pagenumbering is still set to "roman" right after the titlepage, the \lstlistoflistings command produces a page where the numbering is "arabic". Apparently I am not the only one with that problem. Is this maybe a bug of the listings package? Can somebody help me with this?

Here is a code sample of my .tex file.

    ...
    \begin{document}
    \dominitoc[e] 
    \pagestyle{empty}

    \include{titlepage}

    \pagenumbering{roman}

    \include{firstquote} % page numbering ok "i"
    \include{preamble} % page numbering ok "ii"

    \pagestyle{headings} 

    \include{abstract}

    \begin{spacing}{1.2}

        \renewcommand{\contentsname}{Table of Contents}
        \tableofcontents % page numbering ok "iii"
        \listoffigures % page numbering ok "iv"
        \listoftables % page numbering ok "v"
        \lstlistoflistings % here is the page that produces de problem, page numbering "1"

    \end{spacing}

    \pagenumbering{arabic}

    \addtolength{\parskip}{0.25\baselineskip}

    \include{chapters/01-introduction}
    ...

1 Answer 1

7

You have reset the page numbering to \arabic by \pagenumbering{arabic}. The page numbering style is used that is active, when the page is shipout. Add a \newpage, \clearpage, or \cleardoublepage before.

\begin{spacing}{1.2}
  ...
  \lstlistoflistings
\end{spacing}
\cleardoublepage % or \newpage
\pagenumbering{arabic}

Consider using \frontmatter and \mainmatter, if you are using a document class that provides it (book, memoir, …). These commands take care of starting new pages and the page numbering.

2
  • Great! Thank you very much. This did the trick! Commented Oct 18, 2012 at 10:50
  • thank you so much for that ! Commented Aug 31, 2021 at 23:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .