0

enter image description here 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

1 Answer 1

1

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}
\renewcommand*\headrulewidth{0pt}
\fancyhf{}
\fancyfoot[RO]{\thepage}

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

Result:

enter image description here

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

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

\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\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.

2
  • 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.
    – Teepeemm
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.