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 have the following LaTeX code to format page numbers:

\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\thepage}     
\fancyheadoffset{0mm}
\fancyfootoffset{0mm}
\setlength{\headheight}{17pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{ 
    \fancyhf{}
    \rhead{\thepage}}
\setcounter{page}{5} 

They work well with using the default font size. I want to change the font size (using \Large) with the following code:

\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\Large\thepage}       
\fancyheadoffset{0mm}
\fancyfootoffset{0mm}
\setlength{\headheight}{17pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{ 
    \Large
    \fancyhf{}
    \rhead{\thepage}}
\setcounter{page}{5} 

The changes in size are only visible on pages following the starting page of the chapter.

share|improve this question
1  
Starting pages of chapters use the plain style, you have to define the pagenumber as \Large there, too. \fancypagestyle{plain}{ \fancyhf{} \rhead{\Large\thepage}} –  Johannes_B Dec 2 '13 at 17:05
    
I tried use your solution, but it do not work. When i define the pagenumber i get a lot of errors. –  Infernion Dec 2 '13 at 17:20
    
You should define headers/footers in the preamble. If you really have to set page numbers, this is done in the document. –  Johannes_B Dec 2 '13 at 17:28

1 Answer 1

up vote 1 down vote accepted

Chapters in reports and books start a new page with the page style plain. If you want to change the font size there as well, you have to modify the plain style.

You should define headers and footers in the preamble of your document.

\documentclass[a4paper]{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\Large\thepage}       
\fancyheadoffset{0mm}
\fancyfootoffset{0mm}
\setlength{\headheight}{17pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{ 
    \Large
    \fancyhf{}
    \rhead{\Large\thepage}
}
\usepackage{blindtext}
\begin{document}
\blinddocument
\setcounter{page}{1}
\blinddocument
\blinddocument
\end{document}

Setting page numbers by hand is a dangerous activity, as this can lead to wrong page numbers. Please be aware, that this in only done in the document, i.e. after \begin{document}.

share|improve this answer
    
I just write like you, thank for solution! –  Infernion Dec 2 '13 at 17:31

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.