# How to center page numbers in KOMAScript scrbook document with custom margins?

I want to make heavy use of margins (Tufte-style) but I don't want to use Tufte-LaTeX because I got the impression that in the long run, it is better to use KOMAScript classes. I used the package geometry to adjust the margins but this also affects the page number in the footer i.e. the page number is not centered relative to the whole page but relative to the body. (Is that the correct term?)

I tried to fix that with the package fancyhdr and it almost works but not on pages where a chapter begins.

Minimal working example (Page 1 - page number centered relative to the body, Pages 2-5 - page numbers centered relative to the whole page):

%! TEX program = xelatex

\RedeclareSectionCommand[beforeskip=0cm,afterskip=0.5cm]{chapter}

\usepackage{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{nonumonpart}

\usepackage{lipsum}

\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\title{\hspace{0pt}\vfill This is a title}
\author{Scrooge McDuck}
\date{\today\vfill\hspace{0pt}}

\begin{document}

\pagenumbering{gobble}

\maketitle

\frontmatter

\mainmatter

\newgeometry{left=1.8cm, right=5.6cm, top = 3cm, bottom = 3cm, marginpar=4.85cm, footskip = 1cm}

\chapter{Test}

\section{Test}

\lipsum
\lipsum
\lipsum
\backmatter

\end{document}


Here is a picture of the problem: (page 2 is what i want)

Found the answer in the KOMAScript manual (fancyhdr not necessary).

\KOMAoption{footwidth}{17.4cm:0cm}


Final document:

%! TEX program = xelatex

\RedeclareSectionCommand[beforeskip=0cm,afterskip=0.5cm]{chapter}

\usepackage{geometry}

\usepackage{nonumonpart}

\usepackage{lipsum}

\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\title{\hspace{0pt}\vfill This is a title}
\author{Scrooge McDuck}
\date{\today\vfill\hspace{0pt}}

\begin{document}

\pagenumbering{gobble}

\maketitle

\frontmatter

\mainmatter

\newgeometry{left=1.8cm, right=5.6cm, top = 3cm, bottom = 3cm, marginpar=4.85cm, footskip = 1cm}