I am trying to have a one sided layout for a book in memoir
(that is: each page shall have the same right and left margins) but I want the header and the footer to have different margins as well: the header shall be always on the left on a smaller left margin while the page numbering, appearing in the footer, shall be on the extreme right for odd pages and extreme left for the even ones.
So far, so good, I was able to use fancyhdr
(and the ifthenelse
package) to mimic this behaviour. However I am not able to define a principled margins for the page numbers: what I am trying to accomplish is to have the left margin equal the right margin as if they were on a two sided layout.
Here is the code I wrote so far:
% !TEX encoding = UTF-8 Unicode
\documentclass[oneside]{memoir}
\usepackage{polyglossia}
\setmainlanguage{italian}
\setmainfont{Plantin MT Pro}
\usepackage{anyfontsize}
\usepackage{ragged2e}
\usepackage{titlesec}
\usepackage[head=10mm]{geometry}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{showframe}
\usepackage{ifthen}
\usepackage[all]{nowidow}
\let\footruleskip\undefined
\usepackage{fancyhdr}
\newcommand{\footerfont}{\fontsize{9}{10}\selectfont\setmainfont{Founders Grotesk}}
\newcommand{\headerfontii}{\fontsize{7}{8}\selectfont}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\uppercase{#1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\uppercase{#1}}}
\fancyhead{}
\fancyheadoffset{16mm}
\fancyfootoffset{17mm}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
\fancyhead[LO]{\ifthenelse{\isodd{\value{page}}}{\colorbox{White}{\raisebox{6mm}[0cm][0cm]{\headerfontii\rightmark}}}{\colorbox{White}{\raisebox{6mm}[0cm][0cm]{\headerfontii\leftmark}}}}
\fancyfoot[L]{\ifthenelse{\isodd{\value{page}}}{}{\colorbox{White}{\raisebox{-23mm}[0cm][0cm]{\footerfont\thepage}}}}
\fancyfoot[R]{\ifthenelse{\isodd{\value{page}}}{\colorbox{White}{\raisebox{-23mm}[0cm][0cm]{\footerfont\thepage}{}}}}
\setstocksize{225mm}{160mm} %Finale
\settrimmedsize{\stockheight}{\stockwidth}{*}
\settrims{0cm}{0cm}
\setlrmarginsandblock{26mm}{42mm}{*}
\setulmarginsandblock{25mm}{42mm}{*}
%\settypeblocksize{152mm}{92mm}
%\setlrmargins{5mm}{*}{*}
%\setlrmargins{*}{*}{1}
\checkandfixthelayout
\fixpdflayout
\title{Italic. Identità Nazionale Regionale, nuovi codici visivi di rappresentazione}
\author{}
\date{} % Delete this line to display the current date
% \markboth{\thesection}{pisello}
%%% BEGIN DOCUMENT
\begin{document}
\fontsize{12}{14.4}\selectfont
\RaggedRight
\end{document}
%%% Local Variables:
%%% mode: xelatex
%%% TeX-master: t
%%% End:
And this is what it looks like: as you can see the margin on the left of the first page number is smaller than the one on the right of the number in the second page. What is a way to accomplish this?
UPDATE:
What I want is to have the red margins to have the same length (the smaller one that is on the left page) and different from the green margin, which is the text margin (this is alredy accomplished by setting the fancyheadoffset
parameter)
fancyhdr
withmemoir
, I'm not quire sure what it is you are trying to do. Your code is very confusing.