4

I would like my document to have section headings that look like this:

enter image description here

How can I achieve this in LaTeX?

6

For your final solution define the dark red color as desired and replace it with 'red' in my proposal. Note that in the below example the given design is also apllied to the section format.

The Code

\documentclass[11pt]{article}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{titlesec}
  \titleformat{\section}
  {\normalfont\Large\itshape\color{red}}{%
    \hspace*{-4.5em}\rule[-1.35mm]{4.5em}{1.25em}
    {\color{white}\hspace{-1cm}\normalfont\thesection\hspace{5pt}}
  }{1em}{}
  \titleformat{\subsection}
  {\normalfont\large\itshape\color{red}}{%
    \hspace*{-4.5em}\rule[-1.35mm]{4.5em}{1.25em}
    {\color{white}\hspace{-1cm}\normalfont\thesubsection\hspace{5pt}}
  }{1em}{}

\begin{document}
\section{Introduction}
\lipsum[1]
\subsection{Laplace Transformation}
\lipsum[2-4]
\end{document}

Output

enter image description here

  • Hey thanks so much for your answer, this is exactly what I was looking for! – Slugger Dec 23 '13 at 0:06
  • Glad to hear this. Note the minimal edit. I guess it is closer to your source of inspiration. (?) – Ruben Dec 23 '13 at 0:10

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.