0

I know that this question has been answered before for section and chapter titles, but I cannot seem to apply it to subsection titles. I would like to globally change the format of subsection titles to the one presented in the MWE:

\documentclass[]{article} 
\usepackage[T1]{fontenc}  

\newcommand\ruleafter{\vspace*{-.5cm}\noindent\rule{\textwidth}{1pt}\vspace*{-.2cm}}

%opening
\title{}
\author{}

\begin{document}

\subsection{\textsc{Subsection title}}\ruleafter

\end{document}

I have tried using titlesec, but without success. Any suggestions? Thanks in advance!

PS: The questions considering the section and the chapter format, respectively:

How can I make a bold horizontal rule under each section title?

Add a rule after chapter title using titlesec

Sebastiano
  • 54,118

1 Answers1

3

If you don't mind using titlesec then:

\documentclass[]{article}
\usepackage[T1]{fontenc}

\usepackage{titlesec}

\titleformat{\subsection}
  {\scshape\bfseries} % format
  {\thesection}% label
  {1pt}% sep
  {\hspace{1ex}} % before-code
  [\rule{\textwidth}{1pt}]

%opening
\title{}
\author{}

\begin{document}

\subsection{Subsection title}

\end{document}