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 set the size of the text using \fontsize, but this seems to have no effect on the page number. I want to keep the pagestyle as plain. How can I make the font used to print the page number "grow" in size according to the text font size?

This is a good place to ask another, more embarrassing question: What is the meaning of the arguments to \fontsize? I understand that they are the font size in points, but then why two arguments? I currently use it as \fontsize{12}{12} to select font size 12pt, but I'm unsure why the number is mentioned twice.

share|improve this question
1  
It's not necessry to open your question with a greeting nor sign it (since your name appears at the bottom.) I've edited these out. –  Alan Munn Apr 15 '11 at 23:50

2 Answers 2

up vote 5 down vote accepted

The best way to adjust headers and footers is to use the fancyhdr package. With it, you can easily redefine the plain page style. In the example below, I've just used the \large command in the redefinition to make the page number larger than the fontsize set by the documentclass. If you use an exact number with fontsize it will not adjust with different document class sizes.

With respect to the two arguments of the \fontsize command, the first argument is the fontsize and the second argument is the leading. Remember that when you change the font size you also need to issue a \selectfont command to make the change active. For the 12pt standard classes, the leading is set to 14.5 pt which gives some spacing between lines. If you make it 12pt you will get very cramped looking lines. I've added some sample texts in the document below:

\documentclass[12pt]{article}
\newcommand{\sometext}{This is some text to show what happens when you change the
different parameters of the fontsize command in LaTeX. }
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields 
\fancyfoot[C]{\large\thepage} % except the center
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\pagestyle{plain}
\begin{document}
\section{Standard leading}
\sometext\sometext\sometext\sometext\par
\section{12pt on 12pt}
\fontsize{12}{12}\selectfont\sometext\sometext\sometext\par
\section{12 pt on 13.5pt}
\fontsize{12}{13.5}\selectfont\sometext\sometext\sometext\par
\end{document}

output of codocument

share|improve this answer

A really simplistic solution that you may already have considered --- if you just want to change the font size for the whole document, just give the parameter to the document class:

\documentclass[12pt]{article}

or

\documentclass[48pt,extrafontsizes]{memoir}

The page number (and everything else) is adjusted to match.

share|improve this answer

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.