2

I saw this format in a book and was wondering how to create the varying thickness horizontal rules above the section headers. I am assuming an MWE isn't necessary here. I got some idea here but I think there's probably something more simple than TikZ for this. enter image description here

Zack Fair
  • 471

1 Answers1

7

That doesn't look like a varying width rule, just two rules:

enter image description here

\documentclass{article}

\begin{document}

\noindent\rule{\textwidth}{.5pt}

\nointerlineskip
\noindent\rule{3cm}{5pt}
\end{document}

For example using the section format mentioned in comments:

\documentclass{article}
\usepackage{titlesec}

\titleformat{\section}
  {\normalfont\Large\bfseries}{\thesection}{1em}{}[{\titlerule}]

\renewcommand\titlerule{%
\parbox{\textwidth}{%
\noindent\rule{\textwidth}{.5pt}%
\par
\nointerlineskip
\noindent\rule{3cm}{5pt}\par}}
\begin{document}

\section{Test Section}

\end{document}
David Carlisle
  • 757,742
  • I tried using what I found in https://tex.stackexchange.com/questions/84061/how-can-i-make-a-bold-horizontal-rule-under-each-section-title to make it do this for each section but I get an error. I tried

    \titleformat{\section}{\LARGE\sffamily\slshape}{\noindent\rule{\textwidth}{.5pt}\nointerlineskip\noindent\rule{3cm}{5pt}\thesection}{1em}{}

    – Zack Fair May 22 '17 at 22:20
  • @FahimAbdullah I updated the answer – David Carlisle May 22 '17 at 22:42