2

I am using \pagestyle{myheadings} in a LaTeX document, which by default shows the page number in the top right corner of the page. How can I change the position of the page number to bottom right?

2
  • Use fancyhdr or titleps.
    – Bernard
    Oct 13, 2015 at 9:07
  • Or scrlayer-scrpage
    – Johannes_B
    Oct 13, 2015 at 9:31

2 Answers 2

3

Here's a solution without any other package, copied from article.cls and renamed to myotherheadings (The blindtext package is only for filling up the pages)

\documentclass[twoside]{article}

\usepackage{blindtext}
\makeatletter
\def\ps@myotherheadings{%
  \def\@evenfoot{\thepage\hfil}%  -> page number then fill
  \def\@oddfoot{\hfil\thepage} %  -> fill, then page number
  \def\@oddhead{{\slshape\rightmark}\hfil} % remove the page number
  \def\@evenhead{\hfil\slshape\leftmark}%
  \let\@mkboth\@gobbletwo
  \let\sectionmark\@gobble
  \let\subsectionmark\@gobble
}

\makeatother

\begin{document}
\pagestyle{myotherheadings}
\section{First}
\blindtext[10]
\end{document}

Here's a fancyhdr version:

\documentclass[twoside]{article}

\usepackage{blindtext}
\usepackage{fancyhdr}

\renewcommand{\headrulewidth}{0pt}
\fancyhead[RO]{}
\fancyfoot{}
\fancyfoot[RO,LE]{\thepage}

\pagestyle{fancy}

\begin{document}
\section{First}
\blindtext[10]
\end{document}
5
  • To be honest, i wouldn't recommend this to anybody. Especially not to people asking the question.
    – Johannes_B
    Oct 13, 2015 at 9:32
  • @Johannes_B: Why? It's pure LaTeX
    – user31729
    Oct 13, 2015 at 9:34
  • low-level. du sagst den Leuten doch auch nicht, dass sie mit nem Handbohrer Löcher machen können. Und wenn, dann erwähnst du zumindest die Bohrmaschine.
    – Johannes_B
    Oct 13, 2015 at 9:38
  • Or in other words, how would a starter begin to understand what's going on?
    – Johannes_B
    Oct 13, 2015 at 9:40
  • I wanted to provide a low-level way too ... feel free to use the high-level scrlayer stuff ;-)
    – user31729
    Oct 13, 2015 at 9:45
1

Alternative solutions with scrlayer-scrpage and titleps:

\documentclass{article}
\usepackage{blindtext}
\usepackage[automark,
    markcase=noupper%no uppercased headings
]{scrlayer-scrpage}
\clearpairofpagestyles%clear all defaults
\ihead*{\headmark}
\ofoot*{\pagemark}
\begin{document}
\Blinddocument
\end{document}
\documentclass{article}
\usepackage{blindtext}
\usepackage{titleps}
\newpagestyle{bawejakunal}{
    \sethead[][][]%empty, oneside
{\sectiontitle}{}{}
\setfoot[][][]%empty, oneside
{}{}{\thepage}
}
\pagestyle{bawejakunal}
\begin{document}
\Blinddocument
\end{document}

You must log in to answer this question.

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