1

How to show chapterNo/TotalChapterCount in the Chapter title of memoir document.

\documentclass{memoir}

\usepackage{lipsum}

\begin{document}


    \tableofcontents

    \chapter{First}

    \lipsum

    \chapter{Second}

    \lipsum     


\end{document}

I want the chapter title as

Chapter 1/2 First

I dont need any changes in tableofcontents.

ChapterTitle

2 Answers2

2

Just an addition to Milos answer, the same in just memoir

\documentclass{memoir}

\usepackage{lipsum}
\usepackage{totcount}
\regtotcounter{chapter}
\renewcommand\printchapternum{\chapnumfont \thechapter/\total{chapter}}


\begin{document}


    \tableofcontents

    \chapter{First}

    \lipsum

    \chapter{Second}

    \lipsum     


\end{document}

You'll need to adapt it to what ever chapter style you are using.

daleif
  • 54,450
1

Disclaimer: This isn't a pure memoir solution as it uses the titlesec package to customise the appearance of the titles. Also, thanks to @egreg for pointing out that titlesec and memoir don't always play well together. See About memoir and titlesec incompatibility. For a memoir solution see the answer of @daleif.

Using the totcount package (as described in How to get the number of chapters in a document).

enter image description here

\documentclass{memoir}
\usepackage{lipsum}

\usepackage{titlesec}
\usepackage{totcount}
\regtotcounter{chapter}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter/\total{chapter}}{20pt}{\Huge}

\begin{document}
\tableofcontents
\chapter{First}
\lipsum
\chapter{Second}
\lipsum     
\end{document}
Milo
  • 9,440