0

How can I stop LaTeX from resetting page numbers whenever a new chapter starts? I would like to have a single global page number for the whole report. I don't think I am changing the default page numbering in any way with what I have in my preamble, but just in case, here it is:

\documentclass[12pt]{report}
\usepackage[english]{babel}

%use a new bibliography for each chapter
\usepackage[square,sort,comma,numbers,sectionbib]{natbib}
\usepackage{chapterbib}  

%math environment
\usepackage{amsmath}
 \numberwithin{equation}{chapter}

%graphics environment
\usepackage{graphicx}

%allow figure captions to cross between pages
\usepackage{caption}
    \DeclareCaptionLabelFormat{adja-page}{\\#1 #2 }

% reset figure numbers between chapters
\usepackage{chngcntr}
 \counterwithin{figure}{chapter}

% flush all floats whenever a new (sub(sub))section start
\usepackage{placeins}
\let\Oldsection\section
\renewcommand{\section}{\FloatBarrier\Oldsection}
\let\Oldsubsection\subsection
\renewcommand{\subsection}{\FloatBarrier\Oldsubsection}
\let\Oldsubsubsection\subsubsection
\renewcommand{\subsubsection}{\FloatBarrier\Oldsubsubsection}

%double spaced
\usepackage{setspace}
\doublespacing

%smaller margins
\usepackage[margin=1.25in]{geometry}

%define display style for large operators in rational equations
\newcommand\ddfrac[2]{\frac{\displaystyle #1}{\displaystyle #2}}
\newcommand\bfrac[2]{\left(\frac{ #1}{ #2}\right)}


%define a chapter author environment
\makeatletter
\newcommand{\chapterauthor}[1]{%
  {\centering\parindent0pt\vspace*{0pt}%
  #1%
  \par\nobreak\vspace*{25pt}}
  \@afterheading%
}
\makeatother

%no header
\pagestyle{plain}

%make bibliographies single spaced
\usepackage{etoolbox}
\AtBeginEnvironment{thebibliography}{\linespread{1}\selectfont}

%include sub(sub(sub)))sections in TOC
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}



\begin{document}
\include{title}
\tableofcontents
\vfill
\newpage
\include{intro}
\include{chap1}
\include{chap2}
\include{chap3}
\end{document}

Within each \included file, I have something like this:

\chapter{chap1}
\chapterauthor{author list}
\begin{abstract}
bla bla
\end{abstract}
\section{Introduction}
bla bla
...

One of the includes has this in its entirety, and it resets page numbers:

\chapter{title}
\cite{Merchant2010}
\bibliographystyle{ieeetr}
\bibliography{bib}
KBriggs
  • 527
  • There is not a single chapter in there ... –  Mar 23 '18 at 16:57
  • It's all between the \begin{document} and \end{document} - each chapter is in a separate file and is simply included. I will edit shortly with detail from one of them. @ChristianHupfer edited. – KBriggs Mar 23 '18 at 16:58
  • Nothing in the code you show resets pages numbers. – Ulrike Fischer Mar 23 '18 at 17:05
  • @UlrikeFischer That's what I thought. And yet the document I produce restarts page numbers for every chapter... – KBriggs Mar 23 '18 at 17:05
  • Well I wrote "the code you show". Probably the problem is in the part you didn't show. As long as you hide things inside \include we can't help you. – Ulrike Fischer Mar 23 '18 at 17:09
  • Is there \pagenumbering{arabic} in the includes? –  Mar 23 '18 at 17:10
  • @UlrikeFischer there really is nothing relevant in the includes. Just \chapters, \sections, \subsections, \bibliographies. Definitely no \pagenumberings. I'm wondering if maybe something internal to the sectionbib environment causes this? I have edited to show the entirety of one of the includes. – KBriggs Mar 23 '18 at 17:11
  • you make it hard for anyone to answer as you have not provided an example that anyone can run to see the problem. – David Carlisle Mar 23 '18 at 17:16
  • Put two \chapter{blub} directly after \begin{document}. If the second resets the page number you have a minimal example. If not you know that something later is the culprit. – Ulrike Fischer Mar 23 '18 at 17:18
  • OK, I will work on that. Please bear with me for a few minutes. – KBriggs Mar 23 '18 at 17:19
  • To make a test file you should not need \include (just put the content of a small dummy chapter directly in your main document, and you should be able to delete most of the packages, for example do you really need graphicx or placeins to demonstrate the problem? – David Carlisle Mar 23 '18 at 17:20
  • 4
    The problem is the abstract. In the report class, abstract resets the page number and you have an abstract for every chapter. – Marcel Krüger Mar 23 '18 at 17:20
  • @MarcelKrüger thank you. Is there a way to change that behavior? EDIT: this seems relevant: https://tex.stackexchange.com/questions/17887/prevent-abstract-environment-to-reset-pagenumbering – KBriggs Mar 23 '18 at 17:22
  • Yes, the solution is to add the notitlepage option to the report class as discussed in that question I linked. – KBriggs Mar 23 '18 at 17:24

0 Answers0