[texhax] simple manuscript

Samuel Lelievre samuel.lelievre.tex at free.fr
Tue Jan 16 18:31:27 CET 2007


Sean Sieger wrote:

>  Another thing I would like to accomplish is to move
>  the page numbers to top center.

One way to go is to use:

\usepackage{fancyhdr}

and then

\begin{document}

\pagestyle{fancy}
\chead{\thepage/\pageref{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\cfoot{}

Use \lhead, \chead, \rhead, \lfoot, \cfoot, \rfoot
to specify what you want at the left, centre, right
headers and footers; here \cfoot{} is used to kill
the usual page number in the \cfoot.
By default fancyhdr add a horizontal line below the
header; setting headrulewidth to 0pt removes it by
making it of zero width.
The lastpage package allows eg "page 3 of 28".

My preamble often looks like in the following example:

\documentclass[a4paper]{article}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc} % | These two lines make copy-paste from
\usepackage{lmodern}     % | the pdf document deal with accents ok
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{vmargin}
\usepackage{amsmath,amssymb}
\usepackage{upref}
\usepackage{url}
\usepackage{paralist}

%% Set margins
\setmarginsrb{25mm}{20mm}{25mm}{20mm}{5mm}{5mm}{0mm}{0mm}

%% No paragraph indent
\setlength\parindent{0pt}

\begin{document}

\pagestyle{fancy}
\lhead{New year resolutions}
\rhead{[2007-01-02] \thepage/\pageref{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\cfoot{}

Cette ann\'ee, ...

\end{document}


More information about the texhax mailing list