[Tex/LaTex] Memoir changes page number from bottom to top-right in pages with heading

header-footermemoirpage-numbering

I'm using memoir with the companion page style and the madsen chapter style.

\documentclass[11pt, openany, oneside]{memoir}  %Start chapter in even or odd page
\usepackage[utf8]{inputenc} %Carácteres españoles
\usepackage[spanish]{babel} %Traducción de Título, Seccion, etc.

\setcounter{secnumdepth}{2} %Profundidad de Numeracion de titulos
\setcounter{tocdepth}{2}        %Profundidad de Numeracion de TOC

\pagestyle{companion}
\chapterstyle{madsen}       %Chapter style

\setcounter{chapter}{-1}        %Comenzar a numerar en 0

\usepackage{epsfig}         %??

%\setlength{\parindent}{0pt}    %Eliminar indent inicial
\nonzeroparskip         %Aumentar espacio entre párrafo

\tightlists                 %Less space betwenn item lists

On pages where there is no heading the page number is at the bottom, center position. On pages with heading the page number is at the top, left position.

Is this the default behaviour? I don't like it at all.

Is there a way to make it consistent through all document? I would prefer bottom-center.

Note: I have tried to read the Memoir class documentation but it is a bit hard for me.

Best Answer

It is standard to use another pagestyle on pages with a chapter heading. You can use same pagestyle on these pages by

\pagestyle{X}
\aliaspagestyle{chapter}{X}

where X is the pagestyle. If I understand you correctly you want something like this:

\documentclass{memoir}


%%% HEADER AND FOOTER 

\makepagestyle{standard} %Make standard pagestyle

\makeatletter                 %Define standard pagestyle
\makeevenfoot{standard}{}{\thepage}{} %
\makeoddfoot{standard}{}{\thepage}{}  %
\makeevenhead{standard}{\leftmark}{}{}
\makeoddhead{standard}{}{}{\rightmark}
\makeheadrule{standard}{\textwidth}{\normalrulethickness}
\makeatother                  %

\makeatletter
\makepsmarks{standard}{
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{ \quad }
\createmark{section}{right}{shownumber}{}{ \quad }
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
   }
\makeatother                               %


\nouppercaseheads
\pagestyle{standard}               %Choosing pagestyle and chapter pagestyle
\aliaspagestyle{chapter}{plain}    %Change plain to standard if you want the header on pages with chapter headings 



\usepackage{lipsum}

\begin{document}

\frontmatter
\chapter{Preface}
\lipsum

\mainmatter
\chapter{First Chapter}
\lipsum
\section{A section}
\lipsum

\section{Second Chapter}

\lipsum

\end{document}