TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a report with different geometry settings for the title page, so after finishing the latter with \end{titlepage}, I specified the new settings for the rest of the document using \restoregeometry and then \newgeometry{letterpaper,textwidth=7in,textheight=9.5in}.

Nevertheless, I am experiencing an issue with the page numbers: they are slightly shifted to the left. I can clearly see this by writing a centered number just over the page number (see the image below). How can I fix that?

\documentclass[12pt]{article} 

\usepackage[letterpaper,textwidth=6.5in,textheight=9in]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[c]{--~\thepage~--}

\begin{document}

\begin{titlepage}
\begin{center}
Title page here
\end{center}
\end{titlepage}

\restoregeometry
\newgeometry{letterpaper,textwidth=7in,textheight=9.5in}

\section*{Introduction}
\vfill
\begin{center}
1
\end{center}

\end{document}

enter image description here

share|improve this question
up vote 5 down vote accepted

Set the main geometry first and then use \newgeometry for the title page; fancyhdr sets the dimensions of headers and footers according to the current geometry values.

\documentclass[12pt]{article} 

\usepackage{geometry}
\geometry{letterpaper,textwidth=7in,textheight=9.5in}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[c]{--~\thepage~--}

\begin{document}
\newgeometry{textwidth=6.5in,textheight=9in}

\begin{titlepage}
\begin{center}
Title page here
\end{center}
\end{titlepage}

\restoregeometry

\section*{Introduction}
\vfill
\begin{center}
1
\end{center}

\end{document}

enter image description here

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.