Page LayoutNumbering problem with report class

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Numbering problem with report class

Post by M.A »

Hello,

I have two problems occurring with both pdflatex and latex-dvips-ps2pdf:

The first:
The page numbering in report class has two counters, the first is for the first introductory pages, and the second starts with the first chapter.

When I use the environment "abstract" in the beginning, the page numbering will reset at abstract, and at the first chapter twice!
How to fix that?

This is a minimum code:

Code: Select all

\documentclass[12pt]{report}
\begin{document}
\title{title}
\author{author}
\maketitle
\newpage
\pagenumbering{roman}
\addcontentsline{toc}{chapter}{Test1}
test1
\newpage
\addcontentsline{toc}{chapter}{TOC}
\tableofcontents
\newpage
\addcontentsline{toc}{chapter}{Abstract}
\begin{abstract}
test
\end{abstract}
\newpage
\pagenumbering{arabic}
\chapter{Introduction}
\end{document} 
The problem is highlighted in the following image:
p1.png
p1.png (22.13 KiB) Viewed 7244 times
====================================
Problem 2:
In addition to the previous problem, there is a problem when I use babel package.
I have assigned the first pages in the report to roman numbering, while the rest of the report (starting from chapter 1) to arabic numbering
Now, when I use babel, the numbering of the table of contents will become arabic and not roman!
How to fix that?
This is a minimum example:

Code: Select all

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

\begin{document}


\title{title}
\author{author}
\maketitle

\newpage
\pagenumbering{roman}
\addcontentsline{toc}{chapter}{Test1}
test1
\newpage
\addcontentsline{toc}{chapter}{TOC}
\tableofcontents
\newpage
\addcontentsline{toc}{chapter}{Abstract}
\begin{abstract}
test
\end{abstract}
\newpage
\pagenumbering{arabic}
\chapter{Introduction}
\end{document} 
The problem is highlighted in the following image:
Attachments
p2.png
p2.png (19.9 KiB) Viewed 7244 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Re: Numbering problem with report class

Post by M.A »

Are the questions unclear ? :roll:
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Numbering problem with report class

Post by frabjous »

The first problem can be solved by using the notitlepage option for the report class (otherwise the abstract is treated like a titlepage). You will need to make up for it, however, with adding \thispagestyle{empty} right after you have \maketitle.

The other problem seems to be some kind of weird bug with the arabic option for babel ‒ I don't see the problem if I remove that option. If you can get away without that option, I would. (It certainly isn't needed just for arabic numerals.) It perhaps should be reported to the babel maintainers.

But if you need to keep it, it seems like the problem has something to do with it screwing up the plain page style. You can bypass it using fancyhdr.

Here's a sample which I believe fixes both problems.

Code: Select all

\documentclass[12pt,notitlepage]{report}
\usepackage[arabic,french,english]{babel}

 \usepackage{fancyhdr}
 \fancypagestyle{plain}{%
 \fancyhf{}%
 \fancyfoot[C]{\thepage}%
 \renewcommand{\headrulewidth}{0pt}%
 \renewcommand{\footrulewidth}{0pt}%
 }


\begin{document}


\title{title}
\author{author}
\maketitle
\thispagestyle{empty}

\newpage
\pagenumbering{roman}
\addcontentsline{toc}{chapter}{Test1}
test1
\newpage
\addcontentsline{toc}{chapter}{TOC}
\tableofcontents
\newpage
\addcontentsline{toc}{chapter}{Abstract}
\begin{abstract}
test
\end{abstract}
\newpage
\pagenumbering{arabic}
\chapter{Introduction}
\end{document}
M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Re: Numbering problem with report class

Post by M.A »

Thank you very much.
Everything went fine after applying your changes.

Best Regards,
Post Reply