1

I have the following code in my preamble (with added document environment to obey Tex.SE's format):

\documentclass[a4paper,12pt]{article}
\usepackage[margin=1in]{geometry}
\setlength\parindent{0.5in}
\usepackage{setspace} \doublespacing 

\usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhf{} % clear all header and footer fields
 \fancyhead[R]{\thepage} % page number in the upper right-hand corner
 \renewcommand{\headrulewidth}{0pt} % remove the header rule

\begin{document}
 Place holder.
\end{document}

Now my page number is flush with my right margin, which is great, because I need 1.0" of distance from the right side of the page to the page number. However, I also need 0.5" of distance from the top of the page to the page number, which is not the case here. How do I define the distance between the top of the page and the page number in my header?

P.S. My end goal here is to have an MLA formatted document, thus the question.

0

1 Answer 1

2

You can use the already used geometry package to setup the top margin, either using several options to set the margin above the page head, the height of the page head and the distance below it or just set the top margin and include the page head to the text area instead of the margin:

\documentclass[a4paper,12pt]{article}
\usepackage[margin=1in,top=0.5in,includehead]{geometry}
\setlength\parindent{0.5in}% I recommend to use package parskip.
\usepackage[doublespacing]{setspace}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyhead[R]{\thepage} % page number in the upper right-hand corner
\renewcommand{\headrulewidth}{0pt} % remove the header rule

\begin{document}
Test
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .