General ⇒ Pagenumbering
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Pagenumbering
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.
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Pagenumbering
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:
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}}
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Re: Pagenumbering
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
Re: Pagenumbering
Yes, with the \fancyfoot command, please look at the fancyhdr manual for details
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Re: Pagenumbering
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.
Pagenumbering
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}
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Pagenumbering
Hi ChosSimbaOne,
welcome to the board!
I would use the capital C.
Stefan
welcome to the board!
I would use the capital C.
Stefan
LaTeX.org admin
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Pagenumbering
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
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