0

When I create a section, the section name replaces the chapter name in the header. I don't want this to happen. How can I keep the chapter name in the header (and ignore the section name)? It's not important that the section is in the TOC.

I'm using the memoir class, and the Fiction Novel template from Overleaf.

% universal settings
\documentclass[smalldemyvopaper,11pt,twoside,onecolumn,openright,extrafontsizes]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[osf]{Alegreya,AlegreyaSans}

% PACKAGE DEFINITION
% typographical packages
\usepackage{microtype} % for micro-typographical adjustments
\usepackage{setspace} % for line spacing
\usepackage{lettrine} % for drop caps and awesome chapter beginnings
\usepackage{titlesec} % for manipulation of chapter titles

% for placeholder text
 \usepackage{lipsum} % to generate Lorem Ipsum

% other
\usepackage{calc}
\usepackage{hologo}
\usepackage[hidelinks]{hyperref}
%\usepackage{showframe}

% PHYSICAL DOCUMENT SETUP
% media settings
\setstocksize{8.5in}{5.675in}
\settrimmedsize{8.5in}{5.5in}{*}
\setbinding{0.175in}
\setlrmarginsandblock{0.611in}{1.222in}{*}
\setulmarginsandblock{0.722in}{1.545in}{*}

% defining the title and the author
%\title{\LaTeX{} ePub Template}
%\title{\textsc{How I Started to Love {\fontfamily{cmr}\selectfont\LaTeX{}}}}
\title{Title}
\author{Name}
\newcommand{\ISBN}{0-000-00000-2}
\newcommand{\press}{Nonexistent Press - Hammond, Louisiana}

% custom second title page
\makeatletter
\newcommand*\halftitlepage{\begingroup % Misericords, T&H p 153
  \setlength\drop{0.1\textheight}
  \begin{center}
  \vspace*{\drop}
  \rule{\textwidth}{0in}\par
  {\Large\textsc\thetitle\par}
  \rule{\textwidth}{0in}\par
  \vfill
  \end{center}
\endgroup}
\makeatother

% custom title page
\thispagestyle{empty}
\makeatletter
\newlength\drop
\newcommand*\titleM{\begingroup % Misericords, T&H p 153
  \setlength\drop{0.15\textheight}
  \begin{center}
  \vspace*{\drop}
  \rule{\textwidth}{0in}\par
  {\HUGE\textsc\thetitle\par}
  \rule{\textwidth}{0in}\par
  {\Large\textit\theauthor\par}
  \vfill
  {\Large\scshape\press}
  \end{center}
\endgroup}
\makeatother

% chapter title manipulation
% padding with zero
\renewcommand*\thechapter{\ifnum\value{chapter}<10 0\fi\arabic{chapter}}
% chapter title display
\titleformat
{\chapter}
[display]
{\normalfont\scshape\huge}
{\HUGE\thechapter\centering}
{0pt}
{\vspace{18pt}\centering}[\vspace{42pt}]

% typographical settings for the body text
\setlength{\parskip}{0em}
\linespread{1.09}

% HEADER AND FOOTER MANIPULATION
  % for normal pages
  \nouppercaseheads
  \headsep = 0.16in
  \makepagestyle{mystyle} 
  \setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}
  \makerunningwidth{mystyle}{\headwidth}
  \makeevenhead{mystyle}{}{\textsf{\scriptsize\scshape\thetitle}}{}
  \makeoddhead{mystyle}{}{\textsf{\scriptsize\scshape\leftmark}}{}
  \makeevenfoot{mystyle}{}{\textsf{\scriptsize\thepage}}{}
  \makeoddfoot{mystyle}{}{\textsf{\scriptsize\thepage}}{}
  \makeatletter
  \makepsmarks{mystyle}{%
  \createmark{chapter}{left}{nonumber}{\@chapapp\ }{.\ }}
  \makeatother
  % for pages where chapters begin
  \makepagestyle{plain}
  \makerunningwidth{plain}{\headwidth}
  \makeevenfoot{plain}{}{}{}
  \makeoddfoot{plain}{}{}{}
  \pagestyle{mystyle}
% END HEADER AND FOOTER MANIPULATION

% table of contents customisation
\renewcommand\contentsname{\normalfont\scshape Contents}
\renewcommand\cftchapterfont{\normalfont}
\renewcommand{\cftchapterpagefont}{\normalfont}
\renewcommand{\printtoctitle}{\centering\Huge}

% layout check and fix
\checkandfixthelayout
\fixpdflayout











\begin{document}

\chapter{Fu}

\lipsum[1-8]

\section{Bar}


\end{document}

1 Answer 1

2

First of all never use titlesec with memoir it breaks a lot of stuff in memoir. I added the memoir way of getting the same chapter style.

Your're missing resetting the marks made by section etc. I've removed stuff from the MWE that are not relevant for this question

\documentclass[smalldemyvopaper,11pt,twoside,onecolumn,openright,extrafontsizes]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[osf]{Alegreya,AlegreyaSans}

\usepackage{microtype} % for micro-typographical adjustments

% for placeholder text
% USING AN ENGLISH PLACEHOLDER TEXT INSTEAD 
\usepackage{kantlipsum}

% PHYSICAL DOCUMENT SETUP
% media settings
\setstocksize{8.5in}{5.675in}
\settrimmedsize{8.5in}{5.5in}{*}
\setbinding{0.175in}
\setlrmarginsandblock{0.611in}{1.222in}{*}
\setulmarginsandblock{0.722in}{1.545in}{*}

% typographical settings for the body text
\setlength{\parskip}{0em}
\linespread{1.09}

% layout check and fix
\checkandfixthelayout

\title{Title}


% chapter title manipulation padding with zero
\renewcommand*\thechapter{\ifnum\value{chapter}<10\relax0\fi\arabic{chapter}}

% CHAPTER SETUP IN MEMOIR
\renewcommand*\printchaptername{}
\renewcommand*\chapternamenum{}
\renewcommand*\chapnumfont{\normalfont\HUGE\centering}
\renewcommand*\chaptitlefont{\normalfont\scshape\huge\centering}
\setlength\midchapskip{23pt}
\setlength\afterchapskip{84pt}

% HEADER AND FOOTER MANIPULATION
% for normal pages
\nouppercaseheads
\headsep = 0.16in
\makepagestyle{mystyle} 
\setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}
\makerunningwidth{mystyle}{\headwidth}
% DON'T USE \textsf HERE, USE ITS LONGFORM \sffamily
\makeevenhead{mystyle}{}{\sffamily\scriptsize\scshape\thetitle}{}
\makeoddhead{mystyle}{}{\sffamily\scriptsize\scshape\leftmark}{}
\makeevenfoot{mystyle}{}{\sffamily\scriptsize\thepage}{}
\makeoddfoot{mystyle}{}{\sffamily\scriptsize\thepage}{}
\makeatletter
\makepsmarks{mystyle}{%
  \createmark{chapter}{left}{nonumber}{\@chapapp\ }{.\ }
  \clearmark{section}
  \clearmark{subsection}
  \clearmark{subsubsection}
}
\makeatother
% for pages where chapters begin
% don't overwrite plain
\makepagestyle{plainplain}
\makerunningwidth{plainplain}{\headwidth}
\makeevenfoot{plainplain}{}{}{}
\makeoddfoot{plainplain}{}{}{}
\aliaspagestyle{chapter}{plainplain}
\pagestyle{mystyle}

\begin{document}


\chapter{Fu}

\kant[1-8]

\section{Bar}

\kant[1-8]


\end{document}

You must log in to answer this question.

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