1

I want to start new page numbering like \thepage-11.

 \fancyhead[R]{Annex-  \thepage-11}

Would appreciate if one help me for this. Thanks

3

EDITED. I initially suggested to use \the\numexpr\thepage-11 to evaluate the subtraction (with \numexpr) and present as text (with \the).

However, egreg points out that $\the\numexpr\value{page}-11$ is better. For one reason, depending on how your code is configured elsewhere, \thepage might be presented in roman numerals, which cannot be evaluated with a \numexpr. Thus, \value{page} will provide the result in integer form, regardless of whether \thepage is presented in arabic or roman. In addition, the use of the dollar signs will force the resulting page number to be presented in the math font, which will properly render negative numbers in math mode, when the page number is negative (as is the case in the MWE below.

\documentclass[oneside,12pt,a4]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lipsum}
\fancyhead[R]{Annex- $\the\numexpr\value{page}-11$}
\begin{document}
\lipsum[1-20]
\end{document}

enter image description here

  • Thanks a lot @steven for prompt and useful answer. Much appreciated. – MYaseen208 Apr 25 '16 at 15:33
  • Would appreciate if you guide me how to change (decrease) the position of header from top. – MYaseen208 Apr 25 '16 at 15:36
  • @MYaseen208 See, for example, tex.stackexchange.com/questions/253354/… for a description of the geometry lengths that define a page. In light of that, the header can be shifted up 10pt as follows (in the preamble): \topmargin=\dimexpr\topmargin-10pt\relax \headsep=\dimexpr\headsep+10pt\relax, which corresponds to decreasing dimension number 4 and increasing dimension number 6, in the figure, by 10pt. – Steven B. Segletes Apr 25 '16 at 15:46
  • Possibly $\the\numexpr\value{page}-11$ is better. – egreg Apr 25 '16 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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