Page numbering left and right

What is the easiest way, to have a page numbering in the documentclass article (\documentclass[a4paper,12pt,twoside]{article}) on the left/right?

• Top or bottom? On the outer side of the page – Bernard Jul 26 '18 at 18:53
• bottom at the outer side – user115202 Jul 26 '18 at 18:53
• Any header/footer, or only the page numbers? – Bernard Jul 26 '18 at 18:55
• Any package or do you already employ one for header/footer? – Skillmon likes topanswers.xyz Jul 26 '18 at 18:55
• just the page numbers I don't have any header – user115202 Jul 26 '18 at 18:56

For me, the simplest consists in redefining the plain page style with titleps, which comes with titlesec. Add this to you preamble:

\usepackage{titleps}
\renewpagestyle{plain}{%
\setfoot[\thepage][][]{}{}{\thepage}
}%
\pagestyle{plain}


Explanation of the code: the 3 optional arguments of \setfoot (in brackets) are for the left, centre and right parts of the footer on even pages, the 3 mandatory arguments for the same parts of the footer on odd pages.

Note: If you already load titlesec, do not load titleps, just load titlesec with option [pagestyles].

I like scrlayer-scrpage from KOMA-script. With it the following does what you want:

\documentclass[a4paper,12pt,twoside]{article}

\usepackage{duckuments} % dummy content
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles % remove the defaults
\ofoot{\pagemark} % put the page number in the outer footer

\begin{document}
\duckument
\end{document}


Or an alternative could be fancyhdr for which you could use:

\documentclass[a4paper,12pt,twoside]{article}

\usepackage{duckuments} % dummy content
\usepackage{fancyhdr}
\pagestyle{fancy}