# Custom Page numbering with different style

Hi, i want to make a report for my paper. I don't know how to make different style of page numbering. Here's the configuration based on the picture

For every chapter i want to use arabic style but,

If the section/chapter appear, the alignment of page number at the middle-bottom. If there's no section/chapter, the alignment of page number at the right-bottom. Thank you

You could use packages like fancyhdr or scrlayer-scrpage to change footer (and header).

Example using fancyhdr (assuming a onesided document):

\documentclass{report}
\usepackage{lipsum}% only for dummy text

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[RO]{\thepage}

\begin{document}
\chapter{First}
\lipsum[1-10]
\chapter{Second}
\lipsum[11-20]
\end{document}


Result:

Example using scrlayer-scrpage (assuming a onesided document):

\documentclass{report}
\usepackage{lipsum}% only for dummy text

\clearpairofpagestyles
\cfoot[\pagemark]{}
\ofoot{\pagemark}

\begin{document}
\chapter{First}
\lipsum[1-10]
\chapter{Second}
\lipsum[11-20]
\end{document}


The result is nearly the same as above.

• I believe that when the chapter heading appears, tex will switch to the plain pagestyle so that the page number will be centered as desired. But I don't think that happens automatically for section headings. Nov 5, 2021 at 16:08
• @Teepeemm There was no MWE in the question. I am not sure, if the OP really meant sections as well, or if the OP simply referred to chapters as sections. But if all sections should start on a new page, you can use \AddToHook{cmd/section/before}{\clearpage\thispagestyle{plain}}.
– esdd
Nov 7, 2021 at 13:07