Page Layoutchange or delete the page number of chapterstyle (memoir)

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
mariscal
Posts: 1
Joined: Mon Mar 29, 2010 1:59 pm

change or delete the page number of chapterstyle (memoir)

Post by mariscal »

Hi...
I created a style file to create a page style to use with the memoir class. The problem is that I am unable to change the numbering of the page for the chapter style. I know that the fancyhdr package can change this behavior, but I am unable to do so with the memoir class, and I find no reference to this point in the documentation of memoir. How can I get remove this singularity of the style of the chapters? I tested the macro \thispagestyle{empty}, but does not work. The code is as follows:

Code: Select all

\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{Cabeceras}[2010/03/27 controlling the header and footer. Only to use with the memoir class]

\makepagestyle{Estiloi}

%\renewcommand\chaptermark[1]{%
% \markboth{%
%  \ifnum \c@secnumdepth >\m@ne
%	\if@mainmatter
%		\thechapter. \ %
%	\fi
%  \fi
%    #1}{}% ..emarkboth..
%}% ..echaptermark..

\makeheadrule	{Estiloi}{\textwidth}{.5\normalrulethickness}
%\makefootrule	{Estiloi}{.7\paperwidth}{.5\normalrulethickness}{\footruleskip}

\makeevenhead	{Estiloi}{\small\itshape\leftmark}{}{}
\makeevenfoot	{Estiloi}{\thepage}				{}{}

\makeoddhead	{Estiloi}{}{}{\small\itshape\rightmark}
\makeoddfoot	{Estiloi}{}{}{\thepage}

\makepsmarks	{Estiloi}{%
	\nouppercaseheads
	
	\createmark	{chaper} 			{both}	{nonumber}{}{. \space}
	\createmark	{section}			{right}	{nonumber}{}{. \ }
	\createmark	{subsection}		{right}	{nonumber}{}{. \ }
	\createmark	{subsubsection}	{right}	{nonumber}{}{. \ }

	\createplainmark	{toc}			{right}	{\contentsname}
	\createplainmark	{lof}			{right}	{\listfigurename}
	\createplainmark	{lot}			{right}	{\listtablename}
	\createplainmark	{bib}			{right}	{\bibname}
	\createplainmark	{index}		{right}	{\indexname}
	\createplainmark	{glossary}{right}	{\glossaryname}
}% ..emakepsmarks..
And main document contents:

Code: Select all

\documentclass[showtrims, a4paper, 10pt]{memoir}

\usepackage{Cabeceras}

\begin{document}

\setcounter{chapter}{68}
\chapter{A single proof}

\input{tufte}

\clearpage
\setcounter{page}{25}

%\dots

\end{document}
I leave you two images that you may see where the problem:
Attachments
the problem
the problem
img01.jpg (46.26 KiB) Viewed 6591 times
without problem
without problem
img02.jpg (138.23 KiB) Viewed 6591 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: change or delete the page number of chapterstyle (memoir

Post by daleif »

and you are aware that chapter styles has nothing to do with the page numbers? It is page styles that are controlling those. In this case the page style chapter controls the page style of the first page in a chapter, as is well documented in the memoir manual.
desche
Posts: 1
Joined: Thu Apr 08, 2010 6:58 pm

change or delete the page number of chapterstyle (memoir)

Post by desche »

If your idea is just to remove the page number on chapter title pages, you can do the following:

1st: add

Code: Select all

\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
on the preamble of your document (or in the Cabeceras.sty file).

2nd: add

Code: Select all

\let\footruleskip\relax
just after the calling of the memoir class. You have to do this (or something similar) in order to prevent a conflict with the fancyhdr package.

And voilà, now there's no more page numbering on chapter title pages. In any cases, I encourage you to take a look on the fancyhdr guide (available on http://www.ctan.org/tex-archive/macros/ ... /fancyhdr/).

Modified code for Cabeceras.sty

Code: Select all

\NeedsTeXFormat{LaTeX2e}

\usepackage{fancyhdr}

\ProvidesPackage{Cabeceras}[2010/03/27 controlling the header and footer. Only to use with the memoir class]

\makepagestyle{Estiloi}

%\renewcommand\chaptermark[1]{%
% \markboth{%
%  \ifnum \c@secnumdepth >\m@ne
%   \if@mainmatter
%      \thechapter. \ %
%   \fi
%  \fi
%    #1}{}% ..emarkboth..
%}% ..echaptermark..

\makeheadrule   {Estiloi}{\textwidth}{.5\normalrulethickness}
%\makefootrule   {Estiloi}{.7\paperwidth}{.5\normalrulethickness}{\footruleskip}

\makeevenhead   {Estiloi}{\small\itshape\leftmark}{}{}
\makeevenfoot   {Estiloi}{\thepage}            {}{}

\makeoddhead   {Estiloi}{}{}{\small\itshape\rightmark}
\makeoddfoot   {Estiloi}{}{}{\thepage}

\makepsmarks   {Estiloi}{%
   \nouppercaseheads
   
   \createmark   {chaper}          {both}   {nonumber}{}{. \space}
   \createmark   {section}         {right}   {nonumber}{}{. \ }
   \createmark   {subsection}      {right}   {nonumber}{}{. \ }
   \createmark   {subsubsection}   {right}   {nonumber}{}{. \ }

   \createplainmark   {toc}         {right}   {\contentsname}
   \createplainmark   {lof}         {right}   {\listfigurename}
   \createplainmark   {lot}         {right}   {\listtablename}
   \createplainmark   {bib}         {right}   {\bibname}
   \createplainmark   {index}      {right}   {\indexname}
   \createplainmark   {glossary}{right}   {\glossaryname}
}% ..emakepsmarks..

\fancypagestyle{plain}{
\fancyhf{}
%\fancyhead[R]{{\small \thepage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
and for main.tex

Code: Select all

\documentclass[showtrims, a4paper, 10pt]{memoir}
\let\footruleskip\relax


\usepackage{lipsum}

\usepackage{Cabeceras}

\begin{document}

\setcounter{chapter}{68}
\chapter{A single proof}

\lipsum[1-10]

\clearpage
\setcounter{page}{25}

%\dots

\end{document}
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

change or delete the page number of chapterstyle (memoir)

Post by daleif »

why so much trouble?

Code: Select all

\aliaspagestyle{chapter}{empty}
does the same thing for chapters, no need (at all) for fancyhdr

it is all in the manual
Post Reply