[texhax] Adding horizontal rules to section title

Lars Madsen daleif at imf.au.dk
Tue Nov 8 15:41:51 CET 2005

Konstantin Karapetyan :

> 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?
> Thanks for help in advance!
> KK.

There are several package for this sort of thing. Have a look at titlesec 
or sectsty (I think).


``You cannot help men permanently by doing for them 
what they could and should do for themselves. ''
  -- Abraham Lincoln

More information about the texhax mailing list