3

I'm using Memoir for a book, and I am having some difficulty with the running heads. I obviously need to change something, but I can't figure out where to make the change.

The headers display correctly after \chapter{chaptername}, but the first page of the Preface is a starred \chapter*{Prefácio}, and it puts "Lista de Figuras" (list of figures) in the header.

So, how do I get it configured correctly so no header will be used on “matter” opening pages, like the first page of the Preface or the first page of the Table of Contents?

I'm still a raw noob at LaTeX, so any help is welcome. Thanks!

% The minimal example %
%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{memoir}
\usepackage{lipsum}

\newenvironment{dedication}
{
   \cleardoublepage
   \thispagestyle{empty}
   \vspace*{\stretch{1}}
   \hfill\begin{minipage}[t]{0.66\textwidth}
   \raggedright
}
{
   \end{minipage}
   \vspace*{\stretch{3}}
   \clearpage
}


\makeatletter
\renewcommand{\@chapapp}{}
\newenvironment{chapquote}[2][2em]
  {\setlength{\@tempdima}{#1}
   \def\chapquote@author{#2}
   \parshape 1 \@tempdima \dimexpr\textwidth-2\@tempdima\relax
   \itshape}
  {\par\normalfont\hfill--\ \chapquote@author\hspace*{\@tempdima}\par\bigskip}
\makeatother


% Book's title and subtitle
\title{\Huge \textbf{Book Title}}
% Subtitle \\ \huge Suntitle
% Author 
\author{\textsc{Author's Name}\thanks{\url{www.example.com}}}

\begin{document}

\frontmatter
\maketitle


\begin{dedication}
Dedicated to...
\end{dedication}

\tableofcontents
\listoffigures
%\listoftables


\mainmatter


\chapter*{Preface}
\markboth{Preface}{Preface} %%%==>this doesn't keep the header style.
\lipsum


\chapter{Introduction Chapter}

\begin{chapquote}{Edward J. Phelps, \textit{Source of this quote}}
``The man who makes no mistakes does not usually make anything.''
\end{chapquote}

\section{Section heading}
\lipsum[4]


\section{Another section heading}
\lipsum[4]


\bibliographystyle{bababbrv}
\bibliography{refs}
\nocite{*}

\end{document}
17
  • 1
    \markboth{}{} would be empty arguments. You can also define a page style: \makepagestyle{claud} \makeevenhead{claud}{}{}{} \makeoddhead{claud}{}{}{} \makeevenfoot{claud}{}{}{} \makeoddfoot{claud}{}{}{}` (where the three {} respectively indicate the 'left', 'centre', and 'right' side of the header or footer); then you issue \pagestyle{claud} where you want empty headers and footers. But remember that \chapter commands usually issue a \thispagestyle{plain} behind the scenes.
    – jon
    Commented Apr 3, 2016 at 23:12
  • 1
    By the way, it will be helpful in the future if you post only a minimal example (or see here).
    – jon
    Commented Apr 3, 2016 at 23:14
  • 1
    No problem. I am not sure how your headers look now, but you could experiment one time (in a different memoir-based document) try filling the braces like so: {LEFT}{middle}{RIGHT} or what you like to see what they do. Note that the command \chapterstyle{<whatever>} will have absolutely no bearing on how your headers and footers appear. \chapterstyle and \pagestyle are completely independent -- they must be: not every document has a \chapters.
    – jon
    Commented Apr 4, 2016 at 2:49
  • 1
    Pagestyles are not an easy thing to tackle when you are just starting out. If you just want them to be empty, then \markboth{}{} is a simple hack; if you want manual text, it is easy to include that; if you want to emulate the default style, it becomes tricker. What you need to know for now is that \chapter* (the starred form!) does not update the 'mark' information, which is why you are getting the older headers carrying over into the new section; and \markboth{}{} then gives 'empty' marks to the headers; when you do \chapter{New Chapter} (no star!), the marks are updated again.
    – jon
    Commented Apr 4, 2016 at 3:45
  • 1
    \chapter*{Prefácio} \markboth{}{} \pagestyle{plain} \thispagestyle{plain} then your regular content until the next chapter, at which point you put: \chapter{Capítulo de Introção} \pagestyle{headings}.
    – jon
    Commented Apr 4, 2016 at 6:54

1 Answer 1

1

Here is jon's answer from the comments placed in the example document, providing empty headers in the Preface and running headers af the first chapter:

\documentclass{memoir}

\usepackage{lipsum}
\usepackage{hyperref}

\newenvironment{dedication}
{
   \cleardoublepage
   \thispagestyle{empty}
   \vspace*{\stretch{1}}
   \hfill\begin{minipage}[t]{0.66\textwidth}
   \raggedright
}
{
   \end{minipage}
   \vspace*{\stretch{3}}
   \clearpage
}

\makeatletter
\renewcommand{\@chapapp}{}
\newenvironment{chapquote}[2][2em]
  {\setlength{\@tempdima}{#1}
   \def\chapquote@author{#2}
   \parshape 1 \@tempdima \dimexpr\textwidth-2\@tempdima\relax
   \itshape}
  {\par\normalfont\hfill--\ \chapquote@author\hspace*{\@tempdima}\par\bigskip}
\makeatother

\title{\Huge \textbf{Book Title}}
\author{\textsc{Author's Name}\thanks{\url{www.example.com}}}

\begin{document}

\frontmatter
\maketitle


\begin{dedication}
Dedicated to...
\end{dedication}

\tableofcontents
\listoffigures

\mainmatter

\chapter*{Preface}
\markboth{}{}
\pagestyle{plain}
\thispagestyle{plain}

\lipsum

\chapter{Introduction Chapter}
\pagestyle{headings}

\begin{chapquote}{Edward J. Phelps, \textit{Source of this quote}}
``The man who makes no mistakes does not usually make anything.''
\end{chapquote}

\section{Section heading}
\lipsum[4]

\section{Another section heading}
\lipsum[4-10]

\nocite{*}
\bibliographystyle{bababbrv}
\bibliography{refs}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .