GeneralPage number on all pages

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Roger
Posts: 7
Joined: Tue May 13, 2008 11:17 am

Page number on all pages

Post by Roger »

Hi!

Using a template i found for my Bachelor's thesis but I can't get it to add pagenumbers on all page. Have tried google with no luck. It only places page number on page with a new chapter but I would like page numbers on all page after toc. Any suggestions?

Here's the current page style code as it was in the template:

Code: Select all

\documentclass[11pt,a4paper,twoside,bibtotoc,idxtotoc]{scrbook}

\usepackage[latin1]{inputenc}
\usepackage{ifthen,graphicx,color}
\usepackage[swedish]{babel}
%\usepackage[english]{babel}
\usepackage{color}
\usepackage{graphicx}
\usepackage{scrpage2}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{harvard_swedish}
\usepackage{amssymb}
\usepackage{mathpazo}
\usepackage{listings}
\usepackage{subfigure}
\usepackage{anysize}
%\usepackage{hyperref}
\usepackage[absolute]{textpos}

%\usepackage[pdftex, linkbordercolor=000, citebordercolor=000, pdfkeywords={Keyword 1, Keyword 2, Keyword 3, Keyword 4}, pdftitle={The Title}, pdfauthor={The Author}, plainpages=false, pdfpagelabels, hypertexnames=false]{hyperref} % activate for PDF links

\marginsize{3cm}{3cm}{3cm}{3cm}

\pagestyle{scrheadings}
\ifoot{\pagemark}
\ofoot{CHALMERS, Kandidatrapport 2008}
\ohead{}
\chead{}
\ihead{}

\renewcommand{\baselinestretch}{1.1}
\pagenumbering{roman}

\begin{document}

\include{title}
\include{titelsida}

\renewcommand{\thechapter}{\Roman{chapter}}
\include{sammanfattning}
\include{abstract}
\include{forord}
\include{toc}
\include{notations}

\cleardoublepage
\renewcommand{\thechapter}{\arabic{chapter}}
\setcounter{chapter}{0}
\pagenumbering{arabic}

\include{<files>}

\end{document}

/Roger
Last edited by Roger on Thu May 22, 2008 3:31 pm, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Page number on all pages

Post by Stefan Kottwitz »

Hi Roger,

this code fragment is not compilable. I completed it to make it compilable and added some pages for testing. But with this code there are page numbers at the bottom of each page. Perhaps you made something different inside your own document, but this code example you posted above does show page numbers when I add pages.

Do you have a \pagestyle command inside your document other than \pagestyle{scrheadings}? \pagestyle{empty} suppresses the page numbers.

Stefan
LaTeX.org admin
Roger
Posts: 7
Joined: Tue May 13, 2008 11:17 am

Page number on all pages

Post by Roger »

Stefan_K wrote:Hi Roger,

this code fragment is not compilable. I completed it to make it compilable and added some pages for testing. But with this code there are page numbers at the bottom of each page. Perhaps you made something different inside your own document, but this code example you posted above does show page numbers when I add pages.

Do you have a \pagestyle command inside your document other than \pagestyle{scrheadings}? \pagestyle{empty} suppresses the page numbers.

Stefan
Thank you! Forgot I had \pagestyle{empty} on a page in the beginning, changed it to \thispagestyle{empty} and it fixed the problem.
Roger
Posts: 7
Joined: Tue May 13, 2008 11:17 am

Page number on all pages

Post by Roger »

Hi again,

still have some problems with page numbering. The toc is on page ix when looking in the footer but in the toc it says viii. Before the toc there's a preface with page number vii in both the footer and in the toc. Between the preface and toc there's a blank page to get the toc on an odd page. What has gone wrong?

toc.tex:

Code: Select all

\addcontentsline{toc}{chapter}{Innehaallsfoerteckning}
\tableofcontents

forord.tex (preface):

Code: Select all

\chapter*{Forord}
\addcontentsline{toc}{chapter}{Foerord}
Some text...
Hope you can understand this :)


/Roger
Last edited by Roger on Thu May 22, 2008 2:57 pm, edited 5 times in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Page number on all pages

Post by Stefan Kottwitz »

Hi Roger,

perhaps you have special characters like the german "umlauts" inside your code. Remove them (or replace by ascii chars) and try posting again.

Stefan
LaTeX.org admin
Roger
Posts: 7
Joined: Tue May 13, 2008 11:17 am

Page number on all pages

Post by Roger »

Stefan_K wrote:Hi Roger,

perhaps you have german "umlauts" inside your code. Remove them (or replace ae, ue, oe etc.) and try posting again.

Stefan
It didn't like the swedish characters... Thank you.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Page number on all pages

Post by Stefan Kottwitz »

Hi Roger,

try it this way:

Code: Select all

\addtocontents{toc}{\protect\addcontentsline{toc}{chapter}{Innehaallsfoerteckning}}
Stefan
LaTeX.org admin
Roger
Posts: 7
Joined: Tue May 13, 2008 11:17 am

Page number on all pages

Post by Roger »

Stefan_K wrote:Hi Roger,

try it this way:

Code: Select all

\addtocontents{toc}{\protect\addcontentsline{toc}{chapter}{Innehaallsfoerteckning}}
Stefan
Thank you again! You're a lifesaver!
Post Reply