[Tex/LaTex] Position of page numbers

header-footerpage-numbering

I want to move the position of my page numbers to the bottom right of the page. Is there a way to do it without using the fancyhdr package?

Right now I just use

\pagenumbering{roman}

and it does the job, but the default setting is to put the page number in the bottom middle. If it makes a difference, I am using TeXworks.

Best Answer

I assume, you are using pagestyle plain. The original definition can be found in source2e. It can be changed from centering to right aligning the page number:

\makeatletter
\renewcommand*{\ps@plain}{%
  \let\@mkboth\@gobbletwo
  \let\@oddhead\@empty
  \def\@oddfoot{%
    \reset@font
    \hfil
    \thepage
    % \hfil % removed for aligning to the right
  }%
  \let\@evenhead\@empty
  \let\@evenfoot\@oddfoot
}
\makeatother
\pagestyle{plain}

Remarks:

  • Some document classes might already contain support for configuring the footer.
  • The page headers and footers can be configured via package fancyhdr or package scrpage2 (from KOMA-Script).