1

By default TeX prints the page number at the bottom of the page. I added a custom header so that the page number appears in the top right hand corner.

So I have the page number in two places, at the bottom of the page and in my header.

How do I get rid of the page number that is at the bottom of the page?

2
  • 1
    This depends on how you place the page number in the top right. Is it done using fancyhdr? Then you can add \fancyhf{} at the start of your fancy page style definition to clear everything before setting only the header.
    – Werner
    Dec 20, 2012 at 20:09
  • 2
    Note that the default for chapter-style pages (in the supported document classes, like report and book) set the first page of each chapter as plain. So which \documentclass are you using?
    – Werner
    Dec 20, 2012 at 20:11

2 Answers 2

3

I would suggest using the fancyhdr package. It allows you to set the headers and footers.

\documentclass{article}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
%%
\lfoot{Left footer}
\cfoot{Center of footer}
\rfoot{Right of footer}
%%
\lhead{Left of header}
\chead{center of header (on page \thepage)}
\rhead{Right of header}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}

\lipsum[1-2]

\end{document}

enter image description here

1
  • What do you do if you want at the right side the page number just on even pages? Sep 19, 2017 at 22:18
0

How do I get rid of the page number that is at the bottom of the page? R: Just write after \pagestyle{fancy}:

\cfoot{}

Here you have an MWE:

\documentclass[twoside]{article}

\usepackage[utf8]{inputenc}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{txfonts}
\usepackage{mathdots}
\usepackage{lipsum}
\usepackage{bmpsize}
\usepackage[classicReIm]{kpfonts}
\usepackage{scrextend}
\usepackage{graphicx}
\usepackage[affil-it]{authblk}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{titling}

\setlength\headheight{20pt}

\pagestyle{fancy}
\cfoot{}
\newcommand\authors{\textit{Rui S. Camps}}
\fancyhead[LE,RO]{\textit{\thepage}}
\fancyhead[LO]{\textit{\nouppercase{\leftmark}}}
    \fancyhead[RE]{\authors} % Move this line after \author command
\renewcommand{\headrulewidth}{0.4pt}

% Custom command to set running head for odd and even pages
\newcommand{\oddhead}{\markright{Running Head}}
\pagestyle{fancy}
\begin{document}
    
    \title{Relative Advantage of Latex}
    \date{}
    \author{Rui de S. Camphos\thanks{Univ of Porto: \texttt{[email protected]}}}
    
    \maketitle
    \thispagestyle{empty}
    

    
    \begin{small}
        \textbf{Abstract}
        \\  
        \noindent bla bla.
    \end{small}
    
    \newpage
    
    \section{Introduction}
    
    \textbf{1st paragraph}\\
    \lipsum[1]
    
    \textbf{2nd paragraph}\\
    \lipsum[2]
    \lipsum[2]
    \lipsum[3]
    \lipsum[3]
    
    \newpage
    \lipsum[5]
    \lipsum[6]
    \lipsum[7]
    
\end{document}

You must log in to answer this question.

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