[Tex/LaTex] Underline a section header the full width of the page

sectioningsectstytitlesec

How do I get a full page width underline or bottom-border on a section title?

At the moment I'm using

\usepackage{sectsty}  
\sectionfont{\normalfont\sffamily\large\underline\bfseries\color{orange}}

but that only underlines the text. I want the line to stretch the entire width of the page. Can I do it in the font definition or do I have to play with the rendering of \section?

Best Answer

The sectsty package provides mechanisms to add rules, rather than to use underlining as you have done. See section 8.2 of the manual.

Alternatively, the titlesec package seems to offer like facilities, described in section 3.4 of the manual.

Related Question