I'm writing a paper in LaTeX, and I wanted to use titlesec for custom title styling, when I tried to apply my custom styling to my chapter title, it worked.

However, when I tried to apply custom styling to my section, the section-title disappeared like in the following picture:

This is the code in my header:

%header information
\usepackage{blindtext, array, color}

\titleformat{\chapter}[block]{\Huge\bfseries}{\color{gray75}\thechapter}{20pt}{\begin{tabular}[t]{@{\color{gray75}\vrule width 2pt}>{\hsp}l}#1\end{tabular}}




I don't understand what is happening!

  • 1
    Welcome to TeX.SX! Since you use the explicit option, the last argument in \titleformat{\section} should be {#1}, rather than {} – egreg Apr 2 '17 at 9:45
  • Thank you! It worked, I totally looked over that, thanks for the quick answer, what a great community! – Diederik Apr 2 '17 at 9:55
  • We do our best for helping! Welcome again! – egreg Apr 2 '17 at 9:55

Since you're using explicit, the code for the section should be


However, I usually prefer not using the option: it's easier if you define a suitable one argument macro and keep the code in a different place, reducing clutter.






  \begin{tabular}[t]{@{\color{gray75}\vrule width 2pt}>{\hspace{20pt}}l}


\chapter{State of the art}

\section{First section}


enter image description here

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.