0

I want to repeat certain code block on every page on top starting from second page. This is assuming that header is defined. There is a package that can detect the number of page?

Thanks

  • 1
    Do you just need a way to determine the current page number? Some answers to that is available https://tex.stackexchange.com/questions/11962/how-to-determine-current-page-number If the answers there do not address your question, please edit your question to give more details. – Willie Wong Dec 02 '19 at 16:33
  • Finding out the page number is not that difficult, but requires either using \labels, or tapping into the shipout routine (through page styles or otherwise). Can you be a bit more specific about your needs? – Werner Dec 02 '19 at 17:58

1 Answers1

0

Use two pagestyles called, for example first and main. Then in your document do something along the lines:

\documentclass...
% define the first and main pagestyles, or use existing ones
%   ...
\pagestyle{main}
\begin{document}
% some text (which might set its own page style)
\thispagestyle{first} % for the first page
% more text on the first page then \pagestyle{main} comes into effect on the following pages
Peter Wilson
  • 28,066
  • Sorry about my ignorance, but there is a way to define new pagestyles without overwriting fancyhdr pagestyles? – benjujo Dec 02 '19 at 20:58
  • @benjujo Yes. fancyhdr lets you define as many pagestyles as you want. Please read the manual (> texdoc fancyhdr). It is up to you not to overwrite any predefined styles. – Peter Wilson Dec 03 '19 at 18:45