3
\documentclass[12pt, a4paper]{article}
\usepackage[
top=3.5cm, 
bottom=2cm, 
left=3.5cm, 
right=2cm, 
headsep=1.5cm,
]{geometry}
\usepackage{fancyhdr}
\usepackage{sectsty}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[R]{\thepage}
\usepackage{mathptmx}
\usepackage{tocloft}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\begin{document}
    \tableofcontents 
    \newpage
\section{INTRODUCTION}
\subsection{Background}
LOREM IPSUM is a graphical bla bla bla and is a bla bla bla that starts with nothing but that.
\begin{itemize}
\item Coverage and Difficult to Interact: Wii wand is not interactive enough and works effectively only within the projected screen space which makes interacting with the screen difficult and not intuitive
\end{itemize}
\end{document}

enter image description here enter image description here enter image description here

Page numbers are to be placed two centimeters from the top and right hand margins on the page and must be 12 point. I have managed to get the page numbers to the right, I also have list of figures, list of figures and first page of table of contents, in these, the page numbers are being shown in default foot center.

  • You can place elements in then headers and footers using packages like scrlayer-scrpage or fancyhdr. Package showframe helps in understanding where the header/footer starts/ends. – Johannes_B Nov 19 '14 at 15:26
  • I have edited the MWE, I need some specific margin of 2cm at top and right of the page number, how does one achieve with fancyhdr? – tilaprimera Nov 19 '14 at 15:42
  • use geometry package like \usepackage[leftmargin=2cm,rightmargin=2cm,paperwidth=8in,paperheight=10in]{geometry}. – Balaji Nov 19 '14 at 15:49
  • I need to use a separate margin for the page number, in my MWE, the margins are for the overall document. Can I not specify a page number margin exclusively? – tilaprimera Nov 19 '14 at 15:50
  • What corner of the page number bounding box should be considered? – egreg Nov 19 '14 at 16:12
2

Your page number is already at 2cm from the right margin. In order to move it up, just add headsep=1.5cm, so its base will be at 2cm from the page margin. If it's the top that should be at 2cm from the page margin, then use

headsep=\dimexpr1.5cm-8.1pt\relax,

in the code that follows, because 8.1pt is the height of a digit for the Times font at a 12pt font size.

\documentclass[12pt, a4paper]{article}
\usepackage[
  top=3.5cm,
  bottom=2cm,
  left=3.5cm,
  right=2cm,
  headheight=14.5pt,
  headsep=1.5cm,%%%%%% or headsep=\dimexpr1.5cm-8.1pt\relax
]{geometry} % must go before \pagestyle{fancy}

\usepackage{newtxtext,newtxmath}
%\usepackage{mathptmx}% better than times

\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % no rule
\fancyhf{}
\fancyhead[R]{\thepage}

\begin{document}
\section{INTRODUCTION}
\subsection{Background}
LOREM IPSUM is a graphical bla bla bla and is a bla bla bla that starts with nothing but that.
\begin{itemize}
\item Coverage and Difficult to Interact: Wii wand is not interactive enough and works effectively
only within the projected screen space which makes interacting with the screen difficult and not
intuitive
\end{itemize}

\end{document}

enter image description here

Note that the times package is deprecated. Use what I added or mathptmx.

  • My table of contents is messed up, take a look at the MWE I have posted. I have edited my document based on your suggestions! – tilaprimera Nov 19 '14 at 16:40
  • @tilaprimera You need \usepackage[titles]{tocloft} (or remove the call to the package altogether). – egreg Nov 19 '14 at 16:51
  • How do I know if my font for the page number is 12 pt or not? – tilaprimera Nov 19 '14 at 16:56
  • @tilaprimera It's in the same font size as the rest of the text. – egreg Nov 19 '14 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.