Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to number the pages of an article from 1 to n inside the article (named here artpage), but also the pages included in a volume.

\newcounter{artpage}
\setcounter{artpage}{1}
\stepcounter{artpage}

%Redefine plain style to include standard RRP headers:
\if@twoside
\newcommand{\ps@headings}{%
%replace (c) with \copyright when needed!
\renewcommand{\@oddhead}{%
    \vbox{\hbox to \textwidth{\rmfamily\footnotesize%
    \rlap{\theartpage}\hfill\hbox{\rrp@headTitle}\hfill\thepage}%
%   \rlap{\color{black} \year@copy}\hfill\hbox{\rrp@headTitle}\hfill\thepage}%
  \rule[-1mm]{\textwidth}{0.4pt}%
}}%

\renewcommand{\@evenhead}{%
    \vbox{\hbox to \textwidth{\rmfamily\footnotesize%
    \thepage\hfill%
    \hbox{\rrp@headAuthors}%
    \hfill\llap{\theartpage}}%
    \rule[-1mm]{\textwidth}{0.5pt}%
}}%
%
\let\@evenfoot\@oddfoot%
%
}

The artpage does not advance.

share|improve this question
    
Welcome to TeX.SX. –  Claudio Fiandrino Jan 23 '13 at 18:40
add comment

2 Answers

In your code there is nothing that steps your counter (other than the \stepcounter at the very top which is executed once). So not surprising it doesn't change.

A simple solution would be to move the stepping into both \@oddhead and \@evenhead, e.g.,

\newcommand{\ps@headings}{%
%replace (c) with \copyright when needed!
\renewcommand{\@oddhead}{%
    \stepcounter{artpage}%
    \vbox{\hbox to \textwidth{\rmfamily\footnotesize%
    \rlap{\theartpage}\hfill\hbox{\rrp@headTitle}\hfill\thepage}%
%   \rlap{\color{black} \year@copy}\hfill\hbox{\rrp@headTitle}\hfill\thepage}%
  \rule[-1mm]{\textwidth}{0.4pt}%
}}%
%   <--- do not put an empty line into this macro 
\renewcommand{\@evenhead}{%
    \stepcounter{artpage}%
    \vbox{\hbox to \textwidth{\rmfamily\footnotesize%
    \thepage\hfill%
    \hbox{\rrp@headAuthors}%
    \hfill\llap{\theartpage}}%
    \rule[-1mm]{\textwidth}{0.5pt}%
}}%
%
\let\@evenfoot\@oddfoot%
%
}

Then at the beginning of each article you issue

\setcounter{artpage}{0}

0 because it is stepped when the page is made before it is used there. Of course the stepping could be done after it is used in the heading, then you would start with 1.

share|improve this answer
    
Thanks! It worked. –  Cristiana Dumitrache Jan 23 '13 at 22:02
    
If this provides a solution for you you might want to check mark it to indicate this. –  Frank Mittelbach Jan 23 '13 at 22:11
add comment

Sounds like you need to create a new counter that works in tandem with the current page. So if the first page of the article is on page 35 of the journal

\documentclass{article}
\usepackage{lipsum}
\newcounter{journalpage}\setcounter{journalpage}{35}
\usepackage{fancyhdr}\pagestyle{fancy}
\rhead{Article Page=\thepage\ Journal Page=\thejournalpage\stepcounter{journalpage}}
\begin{document}
\lipsum[1-150]

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.