# How to set page numbers within left/right margins using classicthesis and geometry [duplicate]

I'm using classicthesis and the geometry package for the margins. The page numbers are top outer, but should be within ALL of the margins. I've successfully got the page numbers within the top and bottom margins,

What I've tried that doesn't work: 1) I've tried includeall and includeemp in the geometry package -- it shifts the page number successfully but then reduces the text width as if making room for margin notes 2) I tried \marginparwidth 0pt, \marginparsep 0pt to remove space for margin notes and that didn't work either.

Here's a working example:

\documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude, footinclude=true,cleardoublepage=empty,dottedtoc, BCOR=5mm,paper=a4,fontsize=11pt, fontsize=11pt, ngerman,american, ]{scrreprt}

\input{classicthesis-config}

\deftripstyle{pgnumbottomcenter}{}{}{}{}{\pagemark}{}
\pagestyle{pgnumbottomcenter}
\deftripstyle{pgnumtopouter}{}{}{\pagemark}{}{}{}
\renewcommand{\chapterpagestyle}{pgnumtopouter}

\begin{document}

\pagenumbering{roman}

\section{hello}
\newpage
\section{what's up}

\end{document}


And a screenshot of the second page, showing what I'd like to achieve:

## marked as duplicate by Mensch, Stefan Pinnow, Sebastiano, Zarko, TeXnicianDec 21 '18 at 20:44

\documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude, footinclude=true,cleardoublepage=empty,dottedtoc, BCOR=5mm,paper=a4,fontsize=11pt, fontsize=11pt, ngerman,american, ]{scrreprt}

\input{classicthesis-config}

\begin{document}

\pagenumbering{roman}

\section{hello}
xxxxxxxxxx\hfill xxxxxxxx

\newpage
\section{what's up}
xxxxxxxxxx\hfill xxxxxxxx

\newpage
\pagenumbering{arabic}
\section{Hello}
xxxxxxxxxx\hfill xxxxxxxx

\newpage
\noindent xxxxxxxxxx\hfill xxxxxxxx

\end{document}

• Thank you so much! Could you please link me to a resource that covers your solution so that I can study commands like these? – user3625380 Dec 21 '18 at 18:09
• I checked the code of classicthesis and removed the code that put the page numbers in the margin. – Ulrike Fischer Dec 21 '18 at 18:17