GeneralPagenumbering

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
ChosSimbaOne
Posts: 9
Joined: Sat Dec 13, 2008 10:33 pm

Pagenumbering

Post by ChosSimbaOne »

Hi all.
Hope this is the right subforum to post this in, else i'm sorry for the mod that must move it.
I got a problem with my preamble i my LaTeX document, or more correct, i don't know what to do to make it right.

What i want is, that i want the page numbering of my pages in the foreword, table of content etc. to be with Roman numbers, centered it bottom of the page saying "Page X of Y".
Hereafter, when the Report itself start i would like to change it to arabic numbering, where the number swich from left to right side of the pages, as the report will be printeted in full dupex, so that the number of the right page will be out in the right side of the page, same goes for left side.

I uses the fancyhdr package, for headers, and have tired to use that, for the numbering, but hadn't had any luck getting it to work probaly.

My preable is like this atm:
\usepackage[danish]{babel}%Danske
\usepackage[T1]{fontenc} %sprogpakker
\usepackage[latin1]{inputenc} %sprogpakker
\usepackage[top=3cm, bottom=3cm, left=3cm, right=3cm]{geometry} %margin breder
\bibliographystyle{plainnat} %plain natbib litteraturliste
\usepackage[numbers, square]{natbib}% style i litteraturliste
\usepackage{palatino} %Palantino skrifttype
\usepackage{url} %URL med i litteraturlisten
\usepackage{fancyhdr} %fancyheader
\setlength{\headheight}{15pt} % tegn størrelse i fancyheader
\pagestyle{fancy}
\usepackage{longtable} % tabeller kan strække sig over 2 sider
\usepackage{setspace} % linie afstand
\setcounter{secnumdepth}{2} % dybte i nummerering af overskrifter i rapporten
\setcounter{tocdepth}{2} % dybte i indholdsfortegnelsen
\onehalfspacing % 1½ linie afstand

And within the document where i swiches from Roman to arabic numbering is looking like this:
\setcounter{page}{0}
\renewcommand{\thepage}{\Roman{page}}

\setcounter{page}{1}
\renewcommand{\thepage}{\arabic{page}}

Hope that you can help me, as it would make my report perfect.

//ChosSimbaOne

EDIT: One last thing, thoug it's not exactly LaTeX related. When you refer to the programming language C, would you use a small letter c or a capital letter C. Me and my friend doesn't think the same. Hope that you can help us with that.

Recommended reading 2024:

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

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

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Pagenumbering

Post by phi »

Hello,
use \pagenumbering{Roman} and \pagenumbering{arabic} instead of the explicit redefinition of the \thepage command. This also resets the page counter automatically. For the "Page X of Y" part, use the lastpage package in combination with fancyhdr, like this:

Code: Select all

\cfoot{Side \thepage\ af \pageref{LastPage}}
ChosSimbaOne
Posts: 9
Joined: Sat Dec 13, 2008 10:33 pm

Re: Pagenumbering

Post by ChosSimbaOne »

Okay, i Will try that, and get back.. do you know how i make the numbers move from center to left and right side of the pages
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Pagenumbering

Post by phi »

Yes, with the \fancyfoot command, please look at the fancyhdr manual for details
ChosSimbaOne
Posts: 9
Joined: Sat Dec 13, 2008 10:33 pm

Re: Pagenumbering

Post by ChosSimbaOne »

Hi, i now got the following problems. The pages numbering now says, page II of 62, why isnt it all in Roman numbering, and how do i get the pages to be page 1 instead of page 2.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Pagenumbering

Post by phi »

Put the \pagenumbering command exactly on the page where you want to have page I, e.g., the page after the title page. To get roman numbers for the last page number, use something like the following:

Code: Select all

\newcounter{lastpage}
\renewcommand*\thelastpage{\Roman{lastpage}}
\AtBeginDocument{\setcounter{lastpage}{\pageref{LastPage}}}
% end of preamble
\cfoot{Page \thepage\ of \thelastpage}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Pagenumbering

Post by Stefan Kottwitz »

Hi ChosSimbaOne,

welcome to the board!
I would use the capital C.

Stefan
LaTeX.org admin
ChosSimbaOne
Posts: 9
Joined: Sat Dec 13, 2008 10:33 pm

Pagenumbering

Post by ChosSimbaOne »

Hi. i gave up, couldn't get it right, and have to hand it in by tomorrow, and it's really nothing, but one last thing i'm wondering about is why some of the pages seems to be in with a thicker font then others, like on pdf page 16 and 17, i can see a differens between those two pages, but why?
The font on page seems to be a bit thicker.

I don't get any errors, warnings when i compile my LaTeX document, but get some bad boxes.

the PDF can be seen on http://www.madsboye.dk/P1_main_B215.pdf
Post Reply