[OS X TeX] How to reformat a heading

Herb Schulz herbs at wideopenwest.com
Sun Jun 13 01:05:48 CEST 2004


On 6/11/04 12:24 PM, "Richard Burton" <burtonr at nortelnetworks.com> wrote:

> I want to understand how to redefine a heading so that
> *    the heading starts at the top of a new page,
> *    and a horizontal rule is added below the heading title, running the
> width of the text area and whose thickness is configurable.
> 
> I have just reviewed section 2.2.2 in The LaTeX Companion 2nd edition where
> emphasis is placed on using the @startsection command to reformat headings.
> Example 2-2-9 shows how to add a horizontal rule above the heading title
> using the following.
> 
> 
> \makeatletter
> \newcommand\Hsub{\@startsection{subsection}{2}%
> {0pt}{-\baselineskip}{.2\baselineskip}%
> {hrule\medskip\itshape}}
> \makeatother
> 
> 
> It is not clear to me how I can force a pagebreak and add a horizontal rule
> below the heading text using the @startsection command. Is this possible?
> Would it be better to just create a new command by wrapping commands around
> the existing heading command. For example,
> 
> 
> \newcommand{\Mysection}[1]{%
> \newpage%
> \section{#1}%
> \rule[\baselineskip]{\linewidth}{0.25pt}%
> }
> 
> 
> This new command works, but I am wondering if it is an advisable way to do
> things. Any help would be appreciate. Thanks.
> 
> sincerely,
> Richard Burton
> 

Howdy,

Hmmm... I think you're correct in assuming that \@startsection isn't the way
to go here. You've got to get to a more fundamental level and redefine the
\section command usinf \secdef and new commands for regular and starred form
of sectioning. You should look into ``The LaTeX Companion'' (TLC) and I
think the information is there in either the First or Second Editions -
maybe better in the Second Edition.

You might also try the titlesec package. The Second Edition of TLC has a
very detailed section with lots of examples of its use.

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)

-----------------------------------------------------
Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the macostex-archives mailing list