# Format page numbers

How can I control look of the page numbers? For example, in the MWE below:

\documentclass[12pt]{article}
\usepackage[backend=biber]{biblatex}
\usepackage{fancyhdr}
\usepackage[top=2.54cm,bottom=2.54cm,left=3.81cm,right=2.54cm]{geometry}
\usepackage{setspace}
\doublespacing
\pagenumbering{roman}
\setcounter{page}{11}

\begin{document}
\begin{flushright}
\begin{singlespace}
John Doe \\
March 2012 \\
Department of Computer Science \\
\end{singlespace}
\end{flushright}
\begin{center}
Some Generic Title \\
\bigskip
\textbf{\underline{Abstract}}
\end{center}
\vspace{-13pt}
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah.

Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah.

Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah.

\end{document}}


I would like to have the page number look like:

-xi-

xi

-
You could also use \usepackage[margin=1in,left=1.5in]{geometry}, since 1in=2.54cm. –  Werner Jan 5 '12 at 6:55
Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  doncherry Jan 5 '12 at 18:06
Also, note that this is by no means an MWE (Minimal Working Example), have a look at meta.tex.stackexchange.com/questions/228/…. For your problem, an MWE might look like: \documentclass{article} \usepackage{fancyhdr} \usepackage[top=2.54cm,bottom=2.54cm,left=3.81cm,right=2.54cm]{geometry} \pagenumbering{roman} \setcounter{page}{11} \begin{document} Foo. \end{document} –  doncherry Jan 5 '12 at 18:07

In your example, replace (loaded before geometry)

\usepackage{fancyhdr}


with (loaded after geometry)

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{--~\thepage~--}


\fancyfoot[C]{--~\thepage~--} ("C" stands for "centered") will change the formatting of the page number in the footer as desired. (\pagestyle{fancy} is simply necessary to activate the features of the fancyhdr package; loading fancyhdr after geometry is needed to make fancyhdr recognize the margin changes effected by geometry.)

Note that redefining \thepage itself by, e.g., writing

\renewcommand*{\thepage}{--~\roman{page}~--}


is a bad idea because this will also affect the page number format in, e.g., cross-references.

\documentclass[12pt]{article}
% \usepackage[backend=biber]{biblatex}
\usepackage[top=2.54cm,bottom=2.54cm,left=3.81cm,right=2.54cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{--~\thepage~--}
\usepackage{setspace}
\doublespacing
\pagenumbering{roman}
\setcounter{page}{11}

\begin{document}
\begin{flushright}
\begin{singlespace}
John Doe \\
March 2012 \\
Department of Computer Science \\
\end{singlespace}
\end{flushright}
\begin{center}
Some Generic Title \\
\bigskip
\textbf{\underline{Abstract}}
\end{center}
\vspace{-13pt}
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah.

Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah.

Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah.

\end{document}

-
You may need to remove the header rule using \renewcommand{\headrulewidth}{0pt}. –  Werner Jan 5 '12 at 6:52
Werner - you are the genius! –  Bob Alexander Jan 5 '12 at 6:55