[texhax] section* and chapter* commands

Philip G. Ratcliffe philip.ratcliffe at fastwebnet.it
Sat Mar 3 07:49:34 CET 2007


> How does report.cls name the both section* and chapter* 
> command? Where are they defined? or What file are they?
> 
> 
> What I want to do is modify the form how LaTeX uses those 
> commands. I mean to change the format (font color, font size, 
> ...). So, How can I modify them (both section* and chapter* command).
> 
> 
> I was able to modify the both chapter and section command. 
> Now I need to modify the respective asterisk commands.

The short answer is that there is no definition as such of \chapter*,
\section* etc.; the presence of the star is detected by \chapter, \section
etc. themselves.  What you are trying to do is some relatively serious
hacking.  So what you'll need is some relatively serious manual reading!

A possible simple solution for you may lie in the memoir class.

The longer answer, to help start you off, is again to look inside latex.ltx
and (in your case) report.cls; there you'll see that \section and co. call
\@startsection (note that it may be sufficient for you to alter one of the 6
arguments) and in latex.ltx you'll find its definition.  You will see that
one of the last things it does is call \@ifstar, which, not surprisingly,
checks for the presence of a star and acts accordingly: calling \@sect or
\@ssect and these are probably what you should work on.  The workings of
\chapter (and \part) are a little different, but look for the \secdef
command.

>From here on you're on your own and, as I said, this is fairly serious
hacking.

Cheers,  Phil



More information about the texhax mailing list