7

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?

5

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.

  • 1
    Thanks very much. Sec 8.2 helped a lot. I now have \sectionfont{\normalfont\sffamily\large\bfseries\color{orange}\sectionrule{0pt}{0pt}{-4pt}{1pt}}. – Adam Pope Sep 13 '10 at 22:21
  • 3
    @Adam: You are welcome and I am glad it helped. I'm also glad to have my answer accepted. But, in future, it is better, I think, to wait a bit before accepting. You might find that an even better answer shows up if you do so. The acceptance does somewhat discourage others from adding answers. – vanden Sep 13 '10 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.