[texhax] Regarding {BEFORESKIP}{AFTERSKIP}{ parameters in \@startsection

Uwe Lueck uwe.lueck at web.de
Tue Mar 22 17:50:02 CET 2011


Let's just answer the question, as I don't understand this anyway 
and always must look up in the LaTeX companion for \@startsection ...

Or first, the orginal poster might try other packages that help modifying 
section titles:

    http://ctan.org/pkg/nccsect
    http://ctan.org/pkg/sectsty
    http://ctan.org/pkg/titlesec
    http://ctan.org/pkg/memoir
    http://ctan.org/pkg/koma-script

"Philip Taylor (Webmaster, Ret'd)" , 21.03.2011 12:01:17:
> gpn return0 wrote:
>
>> I could not able to understand the definition of the
>> {BEFORESKIP}{AFTERSKIP} parameters in
>> % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
>> % optional * [ALTHEADING]{HEADING}
>> \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus
>> -.2ex}{2.3ex plus .2ex}{\Large\bf\centering}}
>
> The "plus ..." and "minus ..." components indicate what Knuth calls
> "stretchability" and "shrinkability"; thus the default BEFORESKIP
[...]
>> Please help me in setting the {BEFORESKIP}{AFTERSKIP} values for my
>> section levels.
>>
>> I have three levels - section/subsection/subsubsection with font size
>> 12/10/9 pt. I need to set {AFTERSKIP} to zero for all the levels and
>> {BEFORESKIP} to 2 blank lines for level one and 1 blank line for level
>> two and three. So how I have to set the {BEFORESKIP}{AFTERSKIP} value.
>>
>> (blank line have to be of respective levels font size. so have to use ex
>> unit)
>
> Let's deal with AFTERSKIP first, since that is simple : the AFTERSKIP
[...]

Two possible real problems:

1. We don't know what baselineskips your headings actually use. 
Neither 12/10/9 tell this, nor gives the ex unit a hint on the actual baseline skip.

The baseline skip can be seen by about 

    \Large\bf \showthe\baselineskip

2. Do you use a \parskip greater than 0pt? You could see it with

    \showthe\parskip

If it is greater than 0pt, there is a real problem that, I think, was discussed 
here before -- but I think, with one of the packages above ... You could 
search

    http://tug.org/pipermail/texhax/

for `titlesec', `sectsty', `nccsect' -- you may find a better solution there 
than I can offer.

You might show your document preamble so we see the relevant settings. 

3. You also should tell whether the text line after the heading should be 
indented or not, for the sign of BEFORESKIP.

Finally, some guesses that could work:

Level 1:
replace `BEFORESKIP' by `-28pt', replace `AFTERSKIP' by `1sp' 

Level 2:
replace `BEFORESKIP' by `-12pt', replace `AFTERSKIP' by `1sp'

Level 3:
replace `BEFORESKIP' by `-11pt', replace `AFTERSKIP' by `1sp'

So I have omitted stretch and shrink that Phil explained. 
They must have the same sign as the `fixed' components.

Hope this helps, 

    Uwe.


More information about the texhax mailing list