0

For changing all heading styles up to paragraph, I can use the same process in memoir (seen in MWE below). However, this does not seem to work for paragraph, and no result is printed! I am not sure why paragraph is different, but how can I alter the heading style for it?

\documentclass[12pt,a4paper,twoside]{memoir} 
\renewcommand{\thechapter}{s. \arabic{chapter}}
\renewcommand{\thesection}{(\arabic{section})}
\renewcommand{\thesubsection}{(\emph{\alph{subsection}})}
\renewcommand{\thesubsubsection}{(\roman{subsubsection})}
\renewcommand{\theparagraph}{(\emph{\alph{paragraph}\alph{paragraph}})}

\setsecnumdepth{subparagraph}

\let\oldsection=\section
\let\oldsubsection=\subsection
\let\oldsubsubsection=\subsubsection
\let\oldparagraph=\paragraph
\renewcommand{\section}[1]{{%
  \setsecnumformat{\thechapter\thesection\quad}%
  \oldsection{#1}}}
 
\renewcommand{\subsection}[1]{{%
  \setsecnumformat{{\thechapter\thesection\thesubsection\quad}}%
  \oldsubsection{#1}}} 
  \renewcommand{\subsubsection}[1]{{%
  \setsecnumformat{{\thechapter\thesection\thesubsection\thesubsubsection\quad}}%
  \oldsubsubsection{#1}}} 
 
  \renewcommand{\paragraph}[1]{{%
  \setsecnumformat{{\thechapter\thesection\thesubsection\thesubsubsection\theparagraph\quad}}%
  \oldparagraph{#1}}} 
\begin{document}
\mainmatter % Begin numeric (1,2,3...) page numbering
\chapter{Heading}
\section{Heading}
\subsection{Heading}
\subsubsection{Heading}
\paragraph{Heading}
\end{document}
2
  • Why would not you take memoir chapter styles as a foundation, and only then customize the remainings? Should be easier. – Oleg Lobachev Nov 21 '20 at 17:45
  • @OlegLobachev Sure, that might be easier, but so would using a Word template. I can't speak for other TeXers, but I like building things myself. The joy of TeX is getting to be the architect. I find the joy in TeXing not just in the finished product but being able to actually build it myself. It's like baking one's own bread; even if a professional baker's bread would be better, the joy is in creating the recipe yourself – parasandgraphs Nov 21 '20 at 18:32
0

I don't know what causes the problem but I can fix it. At the end of your redefinition of \paragraph add \mbox{} like

\oldparagraph{#1} \mbox{} }}

and presumably the same if you are redefining \subparagraph.

You might also consider using \maxsecnumdepth{subparagraph} to get all the subdivisions numbered.

Please note that memoir's original sectional division macros take two optional and one required argument that you haven't catered for in your redefinitions.

As, according to your response to @OlegLobachev, you find joy in "creating the recipe itself" then look at the memoir definition of \paragraph.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.