What I want is to extend my left and right margins and to have the page number outside the margin, but with the \leftmark or \rightmark (or name of the chapter/section) to align with the page margin.
For example, here is a crude way of doing it
Code: Select all
\documentclass[twoside]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyheadoffset[LE, RO]{1cm}
\fancyhead[RO]{%
\small\sffamily\sc\rightmark \hspace*{0.4cm} {\{\thepage\}} }
\fancyhead[LE]{%
\small\sffamily\sc {\{\thepage\}} \hspace*{0.4cm} \leftmark }
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
\begin{document}
\chapter{The name of the chapter}
\section{The name of the section}
\noindent Text goes here
\newpage
\noindent Text goes here
\newpage
\flushright Text goes here
\end{document}
I thought that perhaps I could use something like
Code: Select all
\parbox{extensionlength}{\thepage}
Any ideas?