1

\frontmatter blocks the propagation of the \titleformat from the preface to the first chapter. Is there a way to avoid that ?

  \documentclass[11pt,A4]{book}
  \usepackage{titlesec}

  \titleformat{\chapter}[display]
  {\bfseries}{Title Above}{20pt}{\Huge}[\vspace{2ex}\titlerule\vspace{0.2ex}\titlerule]

  \begin{document}
  \chapter{Preface (before frontmatter)}
  \frontmatter% blocks the propagation of the titleformat to the first chapter
  \chapter{Chapter 1 (after frontmatter)}
  \end{document}  

enter image description here

The upper title of Chapter 1 is shown only if \frontmatter is absent.

enter image description here

enter image description here

3
  • 2
    Chapters in \frontmatter are really \chapter*, so your "Title above" definition won't apply there. Depending on what you want to achieve, you can add \titleformat{name=\chapter,numberless}[display] {\bfseries}{Title Above}{20pt}{\Huge}[\vspace{2ex}\titlerule\vspace{0.2ex}\titlerule] Apr 8, 2014 at 0:33
  • 1
    And I'd use \mainmatter for the main body of the document (which puts the chapter titles back to normal). Not sure if Chapter 1 is supposed to be in the main matter or the front matter. Apr 8, 2014 at 0:35
  • 1
    But if anything is supposed to be in \frontmatter, surely the preface should be!
    – cfr
    Apr 8, 2014 at 0:55

1 Answer 1

1

Here is the corrected code, thanks to all the comments above.

  \documentclass[11pt,A4]{book}
  \usepackage{titlesec}

  \titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{Title Above}{20pt}{\Huge}[\vspace{2ex}\titlerule\vspace{0.2ex}\titlerule]

  \begin{document}
  \frontmatter
  \chapter{Preface (after frontmatter)}
  \mainmatter
  \chapter{Chapter 1 (with ``mainmatter")}
  \backmatter
  \chapter{Chapter after ``backmatter")}
  \end{document}  

enter image description here

enter image description here

enter image description here

You must log in to answer this question.

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