Text Formattingsetting page numbers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
paulvdsterren
Posts: 5
Joined: Tue Jun 09, 2009 12:56 pm

setting page numbers

Post by paulvdsterren »

Dear Latex pro's,

I have questions concerning page numbers. I made a resaerch report for
my master thesis in texniccenter using apa-style template.

For this thesis i made a coverpage, preface and some very long tables in word. The pdf document is placed in the middle after about 7 pages. I'd like to know
how i can manipulate the page numbers in such a way that they start in the pdf
from page 7 instead of page 1. What command do I need to use to get this done?

Thanks in advance,

Paul

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

setting page numbers

Post by fatra2 »

Hi there,

Do you want to start the counter on page 7 with page 7 or with page one???

If you want to have it with page 7 on page 7, then you just need to \usepackage{fancyhdr} and:

Code: Select all

\pagestyle{empty}
until you want the page number to show, and then add:

Code: Select all

\pagestyle{plain}
.

Otherwise, you will have to restart the page number on page 7. For this I would need to go back into some examples that I have, to give you a complete answer.

Cheers
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

setting page numbers

Post by gmedina »

Hi paulvdsterren,

the command \setcounter lets you change the value of an existing counter. In your case, you could use something like

Code: Select all

\setcounter{page}{6}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
paulvdsterren
Posts: 5
Joined: Tue Jun 09, 2009 12:56 pm

Re: setting page numbers

Post by paulvdsterren »

So i tried to do the /setcounter{page}{7}, however it still starts off
with page 1, instead of page 7 as i want. Could it be a problem that i use apa
style?

here is my setup btw:

\documentclass[jou,oneside]{apa}
\usepackage{apacite}
\usepackage{graphicx}
\usepackage{a4wide}
\title {The importance of sexual self-disclosure and perceived partner responsiveness in sexual intimacy: the proposition of an interpersonal process model.}
\author{Paul G.S. van der Sterren and Marjolein J.W. Verheij}
\affiliation{}

i put /setcounter above the title, but it doesnt seems to use it?
i also used /addtocounter {page} {7}, but this also doesnt seem to work.
I suspect that apa.cls hardwires the page numbers or something. Any ideas anyone?

thanks
Keta
Posts: 63
Joined: Tue Nov 25, 2008 1:00 pm

setting page numbers

Post by Keta »

paulvdsterren wrote:/setcounter{page}{7}
Is this a typo or did you actually use /setcounter? Commands go with a backslash, i.e. \setcounter.

This works for me:

Code: Select all

\documentclass[jou,oneside]{apa}

\usepackage{apacite}
\usepackage{graphicx}
\usepackage{a4wide}

\setcounter{page}{7}

\begin{document}
Hello world!
\end{document}
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

setting page numbers

Post by localghost »

paulvdsterren wrote:So i tried to do the /setcounter{page}{7}, however it still starts off with page 1, instead of page 7 as i want. Could it be a problem that i use apa style?

[...]

i put /setcounter above the title, but it doesnt seems to use it?
i also used /addtocounter {page} {7}, but this also doesnt seem to work.
I suspect that apa.cls hardwires the page numbers or something. Any ideas anyone? [...]
Build a minimal working example (MWE) that shows the difficulties.


Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
paulvdsterren
Posts: 5
Joined: Tue Jun 09, 2009 12:56 pm

Re: setting page numbers

Post by paulvdsterren »

So i tried the suggestions, still no effect.
I tried to make a mwe, i hope its minimal enough

\documentclass[jou,oneside]{apa}
\usepackage{apacite}
\usepackage{graphicx}
\usepackage{a4wide}
\setcounter{page}{7}
\title {The importance}
\author{Paul}
\affiliation{Faculty \\ Utrecht }
\abstract{abstract}
\rightheader{Paul}
\shorttitle{intimacy}
\leftheader{sexual}
\note{\today; in development}
\begin{document}
\maketitle %{model.}
text
\clearpage %this command is nit in the normal doucment its only here to get a 2nd page
text and a few figures and tables
\clearpage %this command is nit in the normal doucment its only here to get a 2nd page
\bibliography{ref}
\end{document}

also in this small doc setting page doesnt work, niether does \addtocounter {page}{7}

Can some look at this problem again?

thanks in advance

paul
Keta
Posts: 63
Joined: Tue Nov 25, 2008 1:00 pm

setting page numbers

Post by Keta »

After checking the apa.cls file, I think I spotted the problem. After \maketitle, there is a use of \pagenumbering on line 1247. I don't know exactly how \pagenumbering works, but it seems like, in addition to making the counter be typeset in arabic numerals (or whatever is requested), it sets the page back to 1. From what I know, I can suggest 2 options:
  1. Make a copy of apa.cls file into your working directory. This way, when compiling LaTeX will use this file. There, comment out line 1247, i.e.

    Code: Select all

    % \pagenumbering{arabic}
  2. Write \setcounter{page}{7} right after \maketitle. It works in your MWE:

    Code: Select all

    \documentclass[jou,oneside]{apa}
    \usepackage{apacite}
    \usepackage{graphicx}
    \usepackage{a4wide}
    \title {The importance}
    \author{Paul}
    \affiliation{Faculty \\ Utrecht }
    \abstract{abstract}
    \rightheader{Paul}
    \shorttitle{intimacy}
    \leftheader{sexual}
    \note{\today; in development}
    \begin{document}
    \maketitle %{model.}
    \setcounter{page}{7}
    text
    \clearpage %this command is nit in the normal doucment its only here to get a 2nd page
    text and a few figures and tables
    \clearpage %this command is nit in the normal doucment its only here to get a 2nd page
    \bibliography{ref}
    \end{document}
Not very elegant, but they work as a quick solution. I also tried to make \pagenumbering not work, by writing \let\pagenumbering\relax, but then "arabic" appears at the start of the document as text. I guess somebody might know how to do it...

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

setting page numbers

Post by phi »

I'd prefer tht following solution: Redefine \pagenumbering so that it doesn't reset the counter:

Code: Select all

\makeatletter
\renewcommand*{\pagenumbering}[1]{%
  \gdef\thepage{\csname @#1\endcsname\c@page}%
}
\makeatother
Keta
Posts: 63
Joined: Tue Nov 25, 2008 1:00 pm

setting page numbers

Post by Keta »

phi wrote:I'd prefer tht following solution: Redefine \pagenumbering so that it doesn't reset the counter:
Brilliant, better solution by far :mrgreen: Where is the original definition of \pagenumbering located?
Post Reply