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

1 Answer 1

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}
2
  • I tried using what I found in tex.stackexchange.com/questions/84061/… 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, 2017 at 22:20
  • @FahimAbdullah I updated the answer May 22, 2017 at 22:42

You must log in to answer this question.

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