# [texhax] Adding horizontal rules to section title

Konstantin Karapetyan kotya.karapetyan at gmail.com
Tue Nov 8 15:05:25 CET 2005

Hello texhax!

I am a little confused 'cause I don't know where to look for the
answer to the following question. Please redirect me in case I've just
missed it in some common online source.

I need to redefine the \section command so as to
1. add a thin (0.3pt) horizontal rule above the title
2. add a thick (1pt) horizontal rule below the title

So far I have been able to do nothing but introduce a new command:

\newcommand\doisection[1]{\noindent \rule{\textwidth}{0.3pt}
\vspace{-2em} \section{#1} \vspace{-1em} \rule{\textwidth}{1pt}}

Sure it's ugly. What is a better way?