24

In page 2 of the titlesec documentation, Javier Bezos writes

titlesec works with the standard classes and with many others, including the AMS ones, and it runs smoothly with hyperref. Unfortunately, it is not compatible with memoir, which provides its own tools with a limited subset of the features available in titlesec.

I don't use the memoir document class so I am not familiar with its features, but I've made a few simple tests (really few and simple) using it together with titlesec and couldn't detect any problems. To what extent can titlesec be safely used with memoir? Which exactly are the incompatibilities mentioned?

lockstep
  • 250,273
Gonzalo Medina
  • 505,128
  • 5
    See this answer here Examples of styles for section headings for a parallel quote from the memoir manual. As I understand it, they're not really incompatible, but you can't really mix and match their respective ways of redefining the sectioning commands. – Alan Munn Oct 29 '11 at 01:22
  • 7
    memoir defines sectioning commands with two optional arguments and this will be lost with titlesec. – egreg Oct 29 '11 at 12:37
  • @egreg: but something like \usepackage{titlesec}\titleformat{\chapter}[display] {\normalfont\huge\itshape}{\chaptertitlename\ \thechapter}{20pt}{\Huge} will still allow using the two optional arguments of \chapter. – Gonzalo Medina Nov 04 '11 at 16:20
  • As long as you consistently use only titlesec commands for specifying titles, you should have no problems with memoir. But you cannot mix and match. – Seamus Nov 04 '11 at 17:51
  • I have brought this thing up with the memoir maintainer and asked to replace memoir's rather limited algorithms with those of titlesec. Unfortunately, he wouldn't listen... The titlesec way of doing things is far superior to the may memoir does it. But I still use memoir since it is getting a long way in the right direction. –  Dec 24 '13 at 00:51
  • Exactly when have you brought this up? But, no I would not change it. I do not like making memoir depend on other packages. Plus as far as I know you loose memoir features by using titlesec. Yes it is harder to use, but I still find it more flexible. – daleif Dec 24 '13 at 12:12
  • @daleif Yah! Very relieved that I should be able to keep using Memoir. For some reason, I'm allergic to titlesec. I have discovered no case in which it is not easier to do without titlesec what I was trying to do with it - usually much easier. Even where I initially wrote code with titlesec, I've eventually had to eliminate it when debugging. Plus, you can get Memoir sections to play nicely with microtypography (like the standard classes), but not titlesec. I have no fix for titlesec sectioning, but my fix works fine with Memoir. – cfr Jul 10 '18 at 23:43

1 Answers1

21

For chapters the incompatibility is not evident, as \titleformat{\chapter}... will redefine \@makechapterhead and \@makeschapterhead. However

\documentclass{memoir}
\usepackage{titlesec}

will redefine \section in such a way that the second optional argument is not accepted; indeed

\section[section toc][section head]{section title}

will produce the correct entry in the table of contents, but

1.1 [
section header]section title

in the document in contrast to what memoir's documentation advertises.

egreg
  • 1,121,712