0

I need to have in my memoir the titles of the chapters that appear just with their roman numerals. In the ToC instead i need to have the the roman numerals with the roman numeral of the chapter and the name of the chapter.

I tried all my best by playing with the few commands i know, like \addcontentsline… but nothing comes out.

To be clearer I simulated in the figure an example of what i’m not able to do…

enter image description here

Thank you all

Emanuele

1
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – DG'
    Jan 15, 2020 at 11:12

2 Answers 2

1

A purely memoir based solution

We create our own chapter style which disables printing the title of the chapter unless it is un numbered (for ToC etc). This is independent of the writing to the toc, so no need for \chapter[...]{}

\documentclass{memoir}
\usepackage{lipsum}
\renewcommand{\thechapter}{\Roman{chapter}}

\newif\ifchapternonum

\makechapterstyle{Roman}{
  % don't print the chapter title unless it is un-numbered (e.g. ToC)
  \renewcommand\printchaptertitle[1]{%
    \ifchapternonum%
      \chaptitlefont ##1
    \fi
  }
  \renewcommand\printchaptername{}
  \renewcommand\chapnumfont{\LARGE\bfseries\centering}
  \renewcommand\afterchapternum{}
  \renewcommand\afterchaptertitle{\par\bigskip}
  % a chapter is executed inside a group so the toggle below is local
  % to that group
  \renewcommand\printchapternonum{\chapternonumtrue}
}

\chapterstyle{Roman}

\renewcommand\cftchapteraftersnum{.}
\addtolength\cftchapternumwidth{1em}

\pagestyle{plain}

\begin{document}
    \tableofcontents*
    \chapter{Chapter A}
    \lipsum
    \chapter{Chapter B}
    \lipsum
    \chapter{Chapter C}
    \lipsum
 \end{document}
3
  • Thank you very much. It works! I just don't know how to make my toc such that has no bold font and less space between lines Jan 16, 2020 at 13:21
  • @EmanueleBottazziGrifoni it is all in the memoir manual. \cftchapterpagefont (redefine to be empty), \cftchapterfont (redefine to be empty). The space above chapter items in the toc are controlled by \cftbeforechapterskip
    – daleif
    Jan 16, 2020 at 13:40
  • thank you so much, I'm so lazy with LaTeX... it's so many years that I steal commands around from internet and colleagues... only today i've understood the concept of renewcommand, thanks to you Jan 25, 2020 at 11:57
0

The package titlesec will work for the roman chapter numbers, while using the short chapter title might help with a different chapter name in TOC than in the main body.

\documentclass{memoir}
\usepackage{titlesec}
\usepackage{lipsum}
\renewcommand{\thechapter}{\Roman{chapter}}
\titleformat{\chapter}[block]
{\centering\normalfont\huge\bfseries}{\thechapter.}{1em}{\Huge}

\begin{document}
    \chapter[Chapter1]{}
    \lipsum
    \chapter[Chapter2]{}
    \lipsum
    \chapter[Chapter3]{}
    \lipsum
    \tableofcontents
\end{document}

EDIT

As daleif pointed out, you shouldn't use titlesec with memoir. Here is an edited version, without titlesec:

\documentclass{memoir}
\usepackage{lipsum}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\chaptername}{}


\begin{document}
    \chapter[Chapter1]{}
    \lipsum
    \chapter[Chapter2]{}
    \lipsum
    \chapter[Chapter3]{}
    \lipsum
    \tableofcontents
\end{document}

enter image description here

3
  • titlesec should not be used with memoir
    – daleif
    Jan 15, 2020 at 14:20
  • @daleif Why not?
    – bmv
    Jan 15, 2020 at 14:31
  • You loose many of the build in memoir features, see page 2 of the titlesec manual
    – daleif
    Jan 15, 2020 at 14:34

You must log in to answer this question.

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