General ⇒ Pagenumbering
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Pagenumbering
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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Pagenumbering
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
Re: Pagenumbering
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Re: Pagenumbering
Pagenumbering
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: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Pagenumbering
welcome to the board!
I would use the capital C.
Stefan
-
- Posts: 9
- Joined: Sat Dec 13, 2008 10:33 pm
Pagenumbering
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