Debian Codegraph @

texmf-dist/tex/latex/section/section.sty

raw
1 % SECTION.STY
2 % (c) (1992-1994) Oliver Pretzel ([email protected])
3 % Created 29 Oct 94 version 1.4: 10 Mar 99.
4 % For use with Latex Standard Styles
5 % Adds control of section heading style to standard LaTeX.
6 % For LaTeX2.09 (OFSS and NFSS) and LaTeX2e.
7 %
8 % Optional features are set to standard.
9 %
10 % DOCUMENTATION at end of file
11 %
12 % WARNING: conflicts with REFMAN.STY.
13 %
14 % ALL RIGHTS RESERVED
15 %
16 % This file may be distributed freely.
17 % It may be modified for local use (please inform me of such modifications)
18 % Modified versions may only be distributed if
19 % 1. The name is changed
20 % 2. A statement acknowledging the modification heads the file.
21 %
22 % DO NOT USE \neq in this file
23 \chardef\neq\the\catcode`\@
24 \makeatletter\@makeother\"
25 %
26 \typeout{`section.sty' <1.4>}
27 %*************************
28 \ifx\reset@font\undefined\let\reset@font\relax\fi
29 %
30 % Options
31 %
32 \ifx\secindent\undefined
33 \newdimen\secindent
34 \newskip\secpreskp
35 \newskip\secpstskp
36 \newdimen\subindent
37 \newskip\subpreskp
38 \newskip\subpstskp
39 \newskip\parpstskp
40 \newcount\c@hddepth
41 \fi
42 %implict multiplication removes stretch
43 \secindent0pt% no indentation
44 \secpreskp1.2\baselineskip plus .35\baselineskip minus.07\baselineskip
45 %\secpreskp3.5ex plus 1 ex minus.2ex
46 \secpreskp-\secpreskp
47 \secpstskp.8\baselineskip plus .07\baselineskip
48 %\secpstskp2.3ex plus .2ex
49 \subindent0pt
50 \subpreskp1.13\baselineskip plus .35\baselineskip minus.07\baselineskip
51 %\subpreskp3.25ex plus 1 ex minus.2ex
52 \subpreskp-\subpreskp
53 \subpstskp.53\baselineskip plus.07\baselineskip
54 %\subpstskp1.5ex plus.2ex
55 \parpstskp-.8\baselineskip
56 %\parpstskp-1em
57 \ifx\chapter\undefined
58 \def\chsize{\Large}\def\hdsize{\huge}\else
59 \def\chsize{\huge}\def\hdsize{\Huge}
60 \fi
61 \let\ttsize\LARGE
62 \let\ausize\large
63 \let\dasize\large
64 \let\hdpos\raggedright
65 \c@hddepth\z@
66 \let\secsize\Large
67 \let\subsize\large
68 \let\fpind\relax
69 %
70 \def\nmdot{}
71 \def\cpdot{:}
72 \def\hdfnt{\reset@font\bf}
73 \def\ttfnt{\reset@font\rm}
74 \def\pgfnt{\reset@font\rm}
75 \def\mkfnt{\reset@font\sl}
76 \let\mkcse\uppercase
77 \def\hddot{}
78 \def\fefnt{\reset@font\bf}
79 \def\thfnt{\reset@font\it}
80 %
81 \def\fnum@figure{\figurename~\thefigure\cpdot}
82 \def\fnum@table{\tablename~\thetable\cpdot}
83 %
84 %
85 % theorems
86 %
87 \def\@begintheorem#1#2{%
88 \trivlist \item[\hskip \labelsep{\fefnt #1\ #2\hddot}]\thfnt}
89 \def\@opargbegintheorem#1#2#3{\trivlist
90 \item[\hskip \labelsep{\fefnt #1\ #2\ (#3)\hddot}]\thfnt}
91 %
92 {\@makeother\~
93 \long\gdef\@ifempty#1#2#3{\if~#1~#2\else#3\fi}
94 }
95 \long\def\@gobifnul#1#2{\@ifempty{#1}\@empty{#1#2}}
96 %\@Alph and \@alph \relax added to allow \@ifempty test when counter<=0
97 \def\@alph#1{%
98 \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
99 k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or
100 y\or z\else\@ctrerr\fi\relax}
101 \def\@Alph#1{%
102 \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
103 K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or
104 Y\or Z\else\@ctrerr\fi\relax}
105 %LaTeX 209
106 \ifx\@ialph\undefined\else\let\@ialph\undefined\let\@Ialph\undefined\fi
107 %
108 % Figures and Tables
109 %
110 \long\def\@makecaption#1#2{\vskip 10\p@
111 \setbox\@tempboxa\hbox{#1\ #2}\ifdim \wd\@tempboxa >\hsize
112 #1\ #2\par\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
113 %
114 % Modified LateX Sectioning Commands
115 %
116 \ifx\chapter\undefined
117 %
118 %Article
119 %
120 \def\part{\par\vskip1.4\baselineskip\@tempskipa\z@
121 \@tempskipb\baselineskip\@afterindentfalse\secdef\@part\@spart}
122 \def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne\@makesecdot{part}%
123 \addcontentsline{toc}{part}{\protect\numberline{\thepart\nmdot}{#1}}\else
124 \addcontentsline{toc}{part}{#1}\fi\@mkboth{}{}
125 {\parindent\z@\hdpos\interlinepenalty\@M\ifnum\c@secnumdepth>\m@ne
126 \@ifempty\thepart\@empty{\chsize\hdfnt\partname~\thepart\par\nobreak
127 \vskip\@tempskipa}\fi}\@spart{#2}}
128 \def\@spart#1{\@ifempty{#1}\removelastskip{\parindent\z@\hdpos
129 \interlinepenalty\@M\hdsize\hdfnt#1\par}\nobreak\vskip\@tempskipb
130 \fpind\@afterheading}
131 \def\maketitle{\par\begingroup\def\thefootnote{\fnsymbol{footnote}}%
132 \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
133 \if@twocolumn\twocolumn[\@maketitle]%
134 \else\newpage\global\@topnum\z@\@maketitle\fi
135 \thispagestyle{empty}\@thanks\endgroup
136 \setcounter{footnote}{0}\let\maketitle\relax\let\@maketitle\relax
137 \def\@thanks{}\def\@author{}\def\@title{}\let\thanks\relax}
138 \def\@maketitle{\null \vskip \tw@ em\begin{center}%
139 {\ttsize\ttfnt\@title\par}\vskip1.2\baselineskip{\ausize\ttfnt%1.5em
140 \lineskip.4\baselineskip\begin{tabular}[t]{c}\@author\end{tabular}\par}%.5em
141 \vskip.8\baselineskip{\dasize\ttfnt\@date}\end{center}% 1em
142 \par\vskip1.2\baselineskip}% 1.5em
143 \if@twoside
144 \def\ps@headings{\let\@mkboth\markboth
145 \def\@oddfoot{}\def\@evenfoot{}
146 \def\@evenhead{\pgfnt\thepage\hfil\mkfnt\leftmark}%
147 \def\@oddhead{\mkfnt\rightmark\hfil\pgfnt\thepage}%
148 \def\sectionmark##1{\markboth{\mkcse{\ifnum\c@secnumdepth>\z@\@gobifnul
149 \thesection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}{}}%
150 \def\subsectionmark##1{\markright{\ifnum\c@secnumdepth>\@ne\@gobifnul
151 \thesubsection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}}
152 \else
153 \def\ps@headings{\let\@mkboth\markboth
154 \def\@oddfoot{}\def\@evenfoot{}
155 \def\@oddhead{\mkfnt\rightmark\hfil\pgfnt\thepage}%
156 \def\sectionmark##1{\markright{\mkcse{\ifnum\c@secnumdepth>\z@
157 \@gobifnul\thesection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}}}
158 \fi
159 \def\ps@myheadings{\let\@mkboth\@gobbletwo
160 \def\@oddhead{\mkfnt\rightmark \hfil\pgfnt\thepage}\def\@oddfoot{}%
161 \def\@evenhead{\pgfnt\thepage\hfil\mkfnt\leftmark}\def\@evenfoot{}%
162 \def\sectionmark##1{}\def\subsectionmark##1{}}
163 \def\tableofcontents{\makeheading{\contentsname
164 \@mkboth{\mkcse{\contentsname}}{\mkcse{\contentsname}}}%
165 \@starttoc{toc}}
166 \def\listoffigures{\makeheading{\listfigurename
167 \@mkboth{\mkcse{\listfigurename}}{\mkcse{\listfigurename}}}%
168 \@starttoc{lof}}
169 \def\listoftables{\makeheading{\listtablename\@mkboth
170 {\mkcse{\listtablename}}{\mkcse{\listtablename}}}%
171 \@starttoc{lot}}
172 \def\thebibliography#1{\makeheading{\refname\@mkboth
173 {\mkcse{\refname}}{\mkcse{\refname}}}\list
174 {\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}%
175 \leftmargin\labelwidth\advance\leftmargin\labelsep
176 \usecounter{enumiv}\let\p@enumiv\@empty
177 \def\theenumiv{\arabic{enumiv}}}%
178 \def\newblock{\hskip .11em plus.33em minus.07em}%
179 \sloppy\clubpenalty4000\widowpenalty4000\sfcode`\.=\@m\relax}
180 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
181 \columnseprule \z@\columnsep 35\p@\twocolumn[\makeheading{\indexname}]%
182 \@mkboth{\mkcse{\indexname}}{\mkcse{\indexname}}%
183 \thispagestyle{plain}\parindent\z@
184 \parskip\z@ plus.3\p@\relax\let\item\@idxitem}
185 \def\l@part{\@tocheadline{0}{1.8\baselineskip}{3em}{\large\bf}}%2.25em
186 \def\l@section{\@tocheadline{1}{1em}{1.8em}{\bf}}
187 \def\makeheading{\section*}
188 \else
189 %
190 %Report/Book
191 %
192 \def\part{\cleardoublepage\thispagestyle{plain}%
193 \if@twocolumn\onecolumn\@tempswatrue\else \@tempswafalse\fi
194 \@tempskipa20\p@\@tempskipb\fill\hbox{}\vfil\secdef\@part\@spart}
195 \def\@part[#1]#2{\ifnum\c@secnumdepth>-2\@makesecdot{part}%
196 \addcontentsline{toc}{part}{\protect\numberline{\thepart\nmdot}#1}\else
197 \addcontentsline{toc}{part}{#1}\fi\@mkboth{}{}%
198 {\parindent\z@\hdpos\ifnum\c@secnumdepth>-2\@ifempty\thepart\@empty
199 {\chsize\hdfnt\partname~\thepart\par\vskip\@tempskipa}\fi
200 \@spart{#2}}}
201 \def\@spart#1{\@ifempty{#1}\removelastskip{\hdpos\hdsize\hdfnt#1\par}%
202 \vskip\@tempskipb\newpage\if@twoside\hbox{}\thispagestyle{empty}\newpage\fi
203 \if@tempswa\twocolumn\fi}
204 \let\@endpart\undefined
205 \def\@makeschapterhead#1#2#3#4{\vskip#2{\parindent\z@\hdpos
206 \if@nobreak\ifnum\c@secnumdepth>\m@ne\@ifempty\thechapter\@empty
207 {\chsize\hdfnt\@chapapp~\thechapter \par\nobreak\vskip#3}\fi\fi
208 \@ifempty{#1}\removelastkip{\hdsize\hdfnt#1\par}\nobreak\vskip#4}}
209 \def\@makechapterhead#1{\hbox{}\@makeschapterhead{#1}{50\p@}{20\p@}{40\p@}}
210 \def\@chapter[#1]#2{\ifnum\c@secnumdepth>\m@ne\@makesecdot{chapter}%
211 \typeout{\@chapapp\space\thechapter}\fi\@contmark{chapter}\z@{#1}%
212 \addtocontents{lof}{\protect\addvspace{10\p@}}%
213 \addtocontents{lot}{\protect\addvspace{10\p@}}\@nobreaktrue
214 \if@twocolumn\@topnewpage[\@makechapterhead{#2}]\else\@makechapterhead{#2}\fi
215 \fpind\@afterheading}
216 \def\@schapter#1{\@nobreakfalse\if@twocolumn
217 \@topnewpage[\@makechapterhead{#1}]\else
218 \@makechapterhead{#1}\fi\fpind\@afterheading}
219 \if@twoside
220 \def\ps@headings{\let\@mkboth\markboth\def\@oddfoot{}\def\@evenfoot{}%
221 \def\@evenhead{\pgfnt\thepage\hfil\mkfnt\leftmark}%
222 \def\@oddhead{\hbox{}\mkfnt\rightmark\hfil\pgfnt\thepage}%
223 \def\chaptermark##1{\markboth{\mkcse{\ifnum
224 \c@secnumdepth>\m@ne\expandafter\@gobifnul\@chapapp\ \@gobifnul
225 \thechapter{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}{}}%
226 \def\sectionmark##1{\markright{\mkcse{\ifnum \c@secnumdepth >\z@\@gobifnul
227 \thesection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi ##1}}}}
228 \else
229 \def\ps@headings{\let\@mkboth\markboth
230 \def\@oddfoot{}\def\@evenfoot{}%
231 \def\@oddhead{\mkfnt \rightmark \hfil\pgfnt\thepage}%
232 \def\chaptermark##1{\markright {\mkcse{\ifnum
233 \c@secnumdepth>\m@ne \expandafter\@gobifnul\@chapapp\ \@gobifnul
234 \thechapter{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}}}
235 \fi
236 \def\ps@myheadings{\let\@mkboth\@gobbletwo
237 \def\@oddhead{\mkfnt\rightmark \hfil\pgfnt\thepage}%
238 \def\@oddfoot{}\def\@evenhead{\pgfnt \thepage\hfil\mkfnt
239 \leftmark}\def\@evenfoot{}%
240 \def\chaptermark##1{}\def\sectionmark##1{}%
241 \def\subsectionmark##1{}}
242 \def\maketitle{\begin{titlepage}%
243 \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0}%
244 \null \vfil \vskip 5\baselineskip \begin{center}% 60pt
245 {\ttsize\ttfnt\@title\par}\vskip2.45\baselineskip {\ausize\ttfnt\lineskip
246 .62\baselineskip%3em .75em
247 \begin{tabular}[t]{c}\@author \end{tabular}\par}%
248 \vskip 1.25\baselineskip {\dasize \ttfnt \@date \par} \end{center} \par%1.5em
249 \@thanks \vfil \null \end{titlepage}%
250 \setcounter{footnote}{0} \let\thanks\relax
251 \def\@thanks{}\def\@author{}\def\@title{}\let\maketitle\relax}%
252 \def\tableofcontents{\@restonecolfalse
253 \if@twocolumn\@restonecoltrue\onecolumn\fi\makeheading{\contentsname
254 \@mkboth{\mkcse{\contentsname}}{\mkcse{\contentsname}}}%
255 \@starttoc{toc}\if@restonecol\twocolumn\fi}
256 \def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
257 \makeheading{\listfigurename\@mkboth{\mkcse{\listfigurename}}%
258 {\mkcse{\listfigurename}}}\@starttoc{lof}\if@restonecol\twocolumn\fi}
259 \def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
260 \makeheading{\listtablename\@mkboth{\mkcse{\listtablename}}%
261 {\mkcse{\listtablename}}}\@starttoc{lot}\if@restonecol\twocolumn\fi}
262 \def\thebibliography#1{\makeheading{\bibname\@mkboth
263 {\mkcse{\bibname}}{\mkcse{\bibname}}}\list
264 {\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}%
265 \leftmargin\labelwidth\advance\leftmargin\labelsep
266 \usecounter{enumiv}\let\p@enumiv\@empty
267 \def\theenumiv{\arabic{enumiv}}}%
268 \def\newblock{\hskip .11em plus.33em minus.07em}%
269 \sloppy\clubpenalty4000\widowpenalty4000\sfcode`\.=\@m}
270 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
271 \columnseprule\z@\columnsep 35\p@\twocolumn\makeheading{\indexname
272 \@mkboth{\mkcse{\indexname}}{\mkcse{\indexname}}}%
273 \thispagestyle{plain}\parindent\z@
274 \parskip\z@ plus .3\p@\relax\let\item\@idxitem}
275 \def\l@part{\@tocheadline{\z@}{1.8\baselineskip}{3em}{\large\bf}}%2.25em
276 \def\l@chapter{\@tocheadline{\@ne}{1em}{1.8em}{\bf}}
277 \def\makeheading{\chapter*}
278 \fi
279 %
280 %Article, Book, Report
281 %
282 \def\section{\@startsection
283 {section}{\@ne}{\secindent}{\secpreskp}{\secpstskp}{\secsize\hdfnt}}
284 \def\subsection{\@startsection
285 {subsection}{\tw@}{\subindent}{\subpreskp}{\subpstskp}{\subsize\hdfnt}}
286 \def\subsubsection{\@startsection
287 {subsubsection}{3}{\subindent}{\subpreskp}{\subpstskp}{\normalsize\hdfnt}}
288 \def\paragraph{\@startsection{paragraph}{4}{\subindent}%
289 {\subpreskp}{\parpstskp}{\normalsize\hdfnt}}
290 \def\subparagraph{\@startsection{subparagraph}%
291 {5}{\parindent}{\subpreskp}{\parpstskp}{\normalsize\hdfnt}}
292 %
293 % section layout
294 %
295 \def\@makesecdot#1{\expandafter\let\expandafter\@secdot\csname the#1\endcsname
296 \ifx\@secdot\@empty\else\refstepcounter{#1}\toks@\expandafter{%
297 \csname p@#1\endcsname}\edef\@secdot{%
298 \the\toks@\expandafter\@gobifnul\csname the#1\endcsname\nmdot}\fi}
299 %not \@secdot
300 \def\@makesvsec#1{\ifind #1<\z@\def\@svsec{\llap{\@secdot}\hskip-#1}\else
301 \def\@svsec{\@gobifnul\@secdot\quad}\fi}
302 \def\@contmark#1#2#3{\csname #1mark\endcsname{#3}\addcontentsline
303 {toc}{#1}{\ifnum #2>\c@secnumdepth\else\protect\numberline{\@secdot}\fi#3}}
304 \def\@startsection#1#2#3#4#5#6{\if@noskipsec\leavevmode\fi
305 \par\@tempskipa #4\@afterindenttrue
306 \ifdim\@tempskipa<\z@\@tempskipa-\@tempskipa\@afterindentfalse\fi
307 \fpind\if@nobreak\everypar{}\else
308 \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi\@ifstar
309 {\@ssect{#3}{#5}{#6}}{\@dblarg{\@sect{#1}{#2}{#3}{#5}{#6}}}}
310 \def\@sect#1#2#3#4#5[#6]#7{\@tempskipa #4\let\@svsec\@empty
311 \ifnum#2>\c@secnumdepth\else\@makesecdot{#1}\@makesvsec{#3}\fi
312 \ifdim\@tempskipa>\z@
313 \begingroup#5\@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty
314 \@M\ifnum#2>\c@hddepth\else\hdpos\fi#7\par}\endgroup
315 \@contmark{#1}{#2}{#6}\else
316 \def\@svsechd{\@contmark{#1}{#2}{#6}#5\hskip#3\@svsec
317 \@gobifnul{#7}\hddot}\fi\@xsect{#4}}
318 \def\@ssect#1#2#3#4{\@tempskipa #2\relax\ifdim \@tempskipa>\z@
319 \begingroup #3\@hangfrom{\ifind #1< \z@\else \hskip #1\fi}{\interlinepenalty
320 \@M\ifnum#2>\c@hddepth\else\hdpos\fi#4\par}\endgroup\else
321 \def\@svsechd{#3\ifind #1<\z@\else
322 \hskip #1\fi\@gobifnul{#4}\hddot}\fi\@xsect{#2}}
323 \let\ifind\ifdim
324 %
325 % contents lines
326 %
327 \def\@tocheadline#1#2#3#4#5#6{\ifnum#1>\c@tocdepth\else
328 \addpenalty\@secpenalty\vskip#2 plus\p@\begingroup
329 \interlinepenalty\@M\rightskip\@tocrmarg\parfillskip-\@tocrmarg
330 \secindent#3\noindent\leavevmode\hangindent\secindent
331 \reset@font\rm#4#5\@tocpagenum{#6}\par\endgroup
332 \penalty\@highpenalty\fi}
333 \def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
334 \vskip \z@ plus.2\p@\begingroup\leftskip#2\interlinepenalty\@M
335 \rightskip\@tocrmarg\parfillskip-\@tocrmarg\secindent#3%
336 \noindent\leavevmode\hangindent\secindent\reset@font\rm#4\nobreak\leaders
337 \hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}\hfill \nobreak
338 \hbox to\@pnumwidth{\hfil\reset@font\rm #5}\par\endgroup\fi}
339 \def\@tocpagenum#1{\nobreak\hfill\nobreak\hbox to\@pnumwidth{\hss#1}}
340 \def\numberline#1{\hbox to \secindent{#1\hfil} }
341 %
342 % REDEFINITIONS here:
343 %
344 % This line must be last line of code
345 \catcode`\@\neq\let\neq\ne\endinput
346
347 *******************
348 DOCUMENTATION
349 *******************
350 Leslie Lamport in writing LaTeX assumed that authors would write
351 complete .sty (.clo) files to implement the design decisions for their
352 publications. However, the overwhelming majority of LaTeX publications use the
353 standard styles supplied by Lamport. These implement a particular set of
354 typographic conventions, which while consistent are not of universal validity,
355 for instance many publishers and authors would like a full stop:
356 `4. Introduction'
357 rather than
358 `4 Introduction'.
359
360 This file modifies the standard classes so that other conventions can be
361 more easily implemented. Careful use of the file will allow a greater
362 variation in the appearance of LaTeX documents.
363
364 0. Changes to section implementation.
365 The file redefines the way LaTeX deals with negative indents for section
366 headings, placing the number in the margin and the heading itself flush
367 with the margin. With negative indents it sets starred section headings
368 flush (as it does when \thesection is empty.
369 Standard LaTeX indenting can be produced by typing
370 >> \let\ifind\iffalse
371 This file's version can be reestablished by typing
372 >> \let\ifind\ifdim
373
374 The file also changes the way LaTeX reacts to empty numbers when sections have
375 non-negative indents, placing the heading where the number would go, rather
376 than further indented (as in standard LaTeX).
377 This effect can be removed by redefining an internal macro \@makesvsec (see
378 below).
379
380 The indents, pre- and postskips for section headings are placed in registers
381 so that they are constant throughout a document and (just as the heading sizes)
382 do not react to surrounding size changes. You can change this back to ordinary
383 LaTeX behaviour by \def ing them as macros rather than setting the register
384 values (in that case you should probably use \smaller\larger from
385 SMALLER.STY for the \...size commands).
386
387 WARNING LaTeX typesets headings that run on by manipulating \everypar. If you
388 make local changes to the heading style of such a section inside braces or a
389 group you must ensure that a non-empty paragraph occurs before the closing
390 brace. Otherwise some strange effects may occur, because the \everypar tokens
391 will be evaluated outside the group (this is a feature of LaTeX, not of
392 SECTION.STY). If your group ends with an empty section of this type just
393 follow it with \leavevmode or an explicit space: \ .
394
395 A detailed description of the format of LaTeX sectioning commands is given
396 below (in paragraph 9). This is partially taken from the file LATEX.TEX.
397 We first list the macros for local control which you can use without knowing
398 this structure.
399
400 The file sets vertical distances that LaTeX expressed in terms of `em's and
401 `ex's in equivalent `\baselineskip's, as `em' is a measure of the horizontal
402 size of a font and `ex' is not a true measure of the full height of a line.
403 Earlier vesions used `ex's.
404
405 The original values are placed as comments.
406
407 1. Sizing commands for Parts, Chapters and Titles etc
408 These are set to \large or whatever
409
410 >> \chsize: Chapter, Part Heading (\LARGE\large)
411 >> \hdsize: Chapter, Part Title Text (\Huge\huge\LARGE)
412 >> \ttsize: Title of Document (\Huge\huge\LARGE)
413 >> \ausize: Author (\LARGE\Large)
414 >> \dasize: Date. (\Large\large)
415 >> \secsize: Section (\Large\large)
416 >> \subsize: Subsection (\large\normalsize)
417 subsubsection and below use \normalsize
418
419 2. Layout commands for headings.
420 >> \hdpos: Positioning of heading (\raggedright) (\centering \raggedleft)
421 (see section 9);
422 >> counter hddpth (default 0)
423 Maximum section level for \hdpos (chapters and parts ALWAYS use hdpos).
424 To centre section headings and above:
425 \let\hdpos\centering\setcounter{hddepth}{1}
426 >> \fpind: Indenting of first paragraph after \Part \Chapter
427 and also to override setting via preskip for sections.
428 \let to \@afterindenttrue to indent, \@afterindentfalse for flush,
429 \relax: flush after \Part \Chapter, negative preskips; indented otherwise
430 (LaTeX default behaviour).
431
432 3. Fonts
433 >> \ttfnt: font for title entries.
434 >> \hdfnt: font for all other headings (Part, Chapter..subparagraph).
435 >> \fefnt: font for theorem headings and description labels (fe=feature).
436 >> \thfnt: font for theorem statements.
437 >> \pgfnt: font for page numbers.
438 >> \mkfnt: font for page headings (mk=mark).
439 >> \mkcse: case for page headings.
440 These can also be used to add other initial commands such as spaces or
441 symbols.
442
443 4. Optional punctuation (standard|my preference)
444 These marks are transferred via auxiliary files for tables of contents etc.
445 They should be \def'd if their current value is to be transferred, and \let
446 if the value in force when the file auxiliary is read should be used.
447
448 >> \hddot ({}|.) (after inline headings, theorems etc)
449 >> \cpdot (:|.) (in figure/table captions - also apears in list of figures.
450 >> \nmdot ({}|.) (after section numbers etc)
451
452 If these are \let to a single letter they are not expanded in the
453 .toc.. files. So to remove \cpdot from list of figures:
454 \let\cpdot\relax\listoffigures\let\cpdot:
455
456 5. Spacing parameters.
457 The macros for chapters and parts have been altered so that all the
458 vertical spacing commands are in a single macro in each case.
459
460 >> \part inserts initial vertical space directly (preceded by \hbox{} if it
461 is to be immovable) and passes the space between Part n and title
462 in \@tempskipa and the space below the heading in \@tempskipb.
463 >> Both \chapter and \chapter* call \@makechapterhead{chaptertitle}.
464 This passes {chaptertitle} on to \@makeschapterhead together with the
465 vertical spacing. Default setting is
466 \def\@makechapterhead#1{\hbox{}\@makeschapterhead{#1}{50\p@}{20\p@}{40\p@}}
467 \hbox{} makes first skip immovable,
468 the first length is space above the heading,
469 The second is the space between Chapter nn and the chapter title
470 The third is the space below the heading.
471 For both Part and Chapter the middle space is removed if either the
472 section name or title are missing.
473 If both are missing, the first space is also removed
474
475 >> For sections and below the spaces are kept in registers:
476 \secpreskp and \secpsrskp \secindent used for \section
477 \subpreskp and \subpstskp \subindent used for \subsection/\subsubsection
478 \paragraph uses \subindent \subpreskp \parpstskp
479 \subparagraph uses \parindent \subpreskp \parpstskp
480
481 >> \secindent \subindent Heading indentation
482 >> \secpreskp \subpreskp Space before
483 >> \secpstskp \subpstskp \parpstskp Space after.
484
485 6. Internal modifications
486
487 Sections with negative indents have heading flush with margin.
488
489 If \thesection is \empty
490 \let\thesection\empty or \def\thesection{}
491 then section does not step the section counter.
492 If the section produces empty output for a value then
493 the section will start flush at the margin or \secindent if it is positive
494 and there will be no \nmdot.
495 It will produce (flush) page headings and a table of contents entry.
496 Similarly if \thechapter or \thepart are defined to be empty they will
497 suppress the heading line `Chapter..' and not step the counter.
498 To restore standard LaTeX behaviour temporarily define \thesection to be
499 \empty
500 \def\thesection{\empty}
501 In that case you can adjust post number spacing in the heading.
502 \section[Heading]{\hskip-1em Heading}
503 You can also redefine \@makesecdot see paragraph 7.
504
505 WARNING \letting \thesection etc to an unexpandable token (like \relax) will
506 cause strange effects under LaTeX because its value will not be expanded.
507
508 \maketitle suppresses page headings (\thispagestyle{empty}) and only resets
509 \@title etc locally. So place in a group if you want to preserve these for
510 later reference (eg. in headers).
511
512 7. New internal macros
513 Place any modifications in the section REDEFINITIONS of the main code
514
515 > \@secdot contains section number and \nmdot if the number is non-empty.
516 > \@makesecdot{NAME} defines \@secdot.
517 To make LaTeX step the section counter independently of the definition
518 of \thesection and always print \nmdot:
519 \def\@makesecdot#1{\refstepcounter{#1}%
520 \edef\@secdot{\csname the#1\endcsname}}
521 If you want \nmdot suppressed when \thesection produces no output:
522 \def\@makesecdot#1{\refstepcounter{#1}%
523 \edef\@secdot{\expandafter\@gobifnul\csname the#1\endcsname\nmdot}}
524 > \@makesvsec{INDENT} defines the \@svsec macro used by LaTeX to typeset the
525 section number.. Its parameter is the indent so that it can react
526 differently to negative indents. (it does NOT make the indent).
527 To obtain standard LaTeX behaviour:
528 \def\@makesvsec#1{\def\@svsec{\@secdot\quad}}
529 To make positioning commands apply to the heading ignoring the number:
530 \def\@makesvsec#1{\def\@svsec{\llap{@secdot\quad}}}
531 Do NOT forget the #1.
532 > \@contmark{NAME}{LEVEL}{HEADING} makes contents line and sectionmark.
533
534 Contents headlines are defined by
535 > \@tocheadline
536 This allows these lines to be adjusted similarly to the \@dottedtocline
537 commands for other contents lines. The format of these is defined below (in
538 paragraph 11).
539 >@tocpagenum#1 sets #1 flush right in \@tocheadline.
540 Redefine (\let\@tocpagenum\@gobble) to remove page numbers.
541 \def\l@part{\@tocheadline{0}{2.25em}{3em}{\let\@tocpagenum\@gobble
542 \centering\large\bf}}
543 Centres parts lines of contents but leaves chapters unchanged
544 \def\l@part{\@tocheadline{0}{2.25em}{3em}{\let\@tocpagenum\@gobble
545 \centering\def\numberline##1{\hskip-\secindent
546 \hbox to\secindent{##1\hfil}}\large\bf}}
547 Same but centring ignores part number.
548 \def\l@part{\@tocheadline{0}{2.25em}{3em}{\let\@tocpagenum\@gobble
549 \centering\def\numberline##1{\hfilneg
550 \hbox to\z@{##1\hss}\hfil}\large\bf}}
551 Centres heading with number flush left
552 Contents lines use \secindent as a temporary register
553
554 >\makeheading (set to \section*, \chapter*)
555 Makes headings for contents, index etc.
556 To put Contents itself in the contents list, redefine (locally):
557 \let\thesection\empty\let\makeheading\section
558
559 8. Additional macros
560 > \@ifempty{test}{yes}{no} like \@ifundefined but tests for empty
561 (fails iff test starts with ~ of catcode 12 (other) ).
562 > \@gobifnul{a}{b} = \@ifempty{a}{}{ab}.
563
564 9. Description of sectioning values
565
566 \@startsection {NAME}{LEVEL}{INDENT}{PRESKIP}{POSTSKIP}{STYLE}
567 optional * [ALTHEADING]{HEADING}
568 Generic command to start a section.
569
570 NAME : e.g., 'subsection' must be the name of a section counter
571 LEVEL : a number, denoting depth of section -- section=1;
572 number increases down the hierarchy.
573 INDENT : Indentation of heading from left margin
574 PRESKIP : Absolute value = skip to leave above the heading.
575 If negative, then paragraph indent of text following
576 heading is suppressed.
577 POSTSKIP : if positive, then skip to leave below heading, else
578 negative of skip to leave to right of run-on heading.
579 ALTHEADING : for page headings and contents.
580 STYLE : commands to set style
581 If '*' missing, then increments the counter. If it is present, then
582 there should be no [ALTHEADING] argument.
583 Uses the counter 'secnumdepth' whose value is the highest section
584 level that is to be numbered and entered into \@dottedtocline.
585
586 10. Treatment of Section Entries
587
588 NAME (fixed) Determines the counter to use.
589
590 LEVEL (fixed) If level is greater than \counter{secnumdepth} (default 2) no
591 indexentry or number
592
593 INDENTS: \secindent (sections), \subindent (subsections,...,paragraphs).
594 Subparagraphs have \parindent fixed. These are dimensions.
595
596 Recommended: +-\parindent or 0pt
597
598 If indent is negative then SECTION.STY causes the section number to be set
599 flush right that distance from margin. Heading or text follows at the margin
600 itself.
601
602 Unnumbered headings are set at the margin if indent is negative. If the
603 indent is non-negative they are set flush left with the number position.
604
605 PRESKIPS \secpreskp (sections), \subpreskp(subsections..subparagraphs)
606 POSTSKIPS \secpstskp (sections),\subpstskp(subsections,subsubsections)
607 \parpstskp (paragraphs,subparagraphs)
608
609 Recommended: leave PRESKIPS' abs values unchanged, They are set -ve to
610 have flush first paragraphs. Use \secpreskp-\secpreskp to indent them.
611 Recommended: set POSTSKIPS to -1em or -\parindent to make sections run on.
612
613 By assigning these values to registers SECTION.STY makes them independent of
614 the surrounding font and size. Set the registers if you want this, redefine
615 them as macros if you want them to be font and size dependent.
616
617 STYLE \secsize \subsize \hdfnt size and fonts.
618 \secsize for sections,
619 \subsize for subsections.
620 Subsubsections and below have \normalsize (fixed).
621 \hdfnt is universal for all headings.
622
623 11. Contents entries.
624
625 \@tocheadline{LEVEL}{PRESKIP}{INDENT}{STYLE}{ENTRY}{PAGENUM}
626 \@dottedtocline{LEVEL}{MARGIN}{INDENT}{ENTRY}{PAGENUM}
627
628 LEVEL : determines if entry made.
629 PRESKIP : vertical gap above.
630 INDENT : This must leave enough room for the chapter or section number
631 : It is added to the margin for the next level.
632 MARGIN : Left margin inherited from level above (zero for headlines).
633 STYLE : Font sizing and setting.
634
635 LaTeX assumes that the ENTRY for sections be defined by a macro \l@section.
636 These are defined in the standard document styles but can be changed.
637 All entries of the \l@section commands are fixed. SECTION.STY does not
638 change the commands using \@dottedtocline in the style file. Those that do
639 not do so (\l@part, \l@chapter) are modified to use \@tocheadline.
640
641 INDENT for sections in {article} and chapters in {report} is rather tight at
642 1.5em. If you increase it should also increase the MARGINS for lower
643 sections.
644
645 12. The following internal LaTeX macros are redefined:
646
647 \part\@part\@spart\@endpart
648 \@chapter\@schapter (also \fi moved)
649 \@makechapterhead functions of these have been significantly
650 \@makeschapterhead changed.
651
652 \ps@headings\ps@myheadings
653 \section\subsection
654 \subsubsection\paragraph
655 \subparagraph
656 \thebibliography
657 \theindex
658 \@begintheorem
659 \@oparbegintheorem
660 \@makecaption optional style features added
661 \@startsection \fpind and does not pass #4 to \@sect,\@ssect
662 \@sect,\@ssect ignored parameter removed
663 \llap \@secdot used to adjust spacing
664 if \p@section defined used for number style.
665 calls \@makesecdot
666 \@sect only: \@makesvsec and
667 \@contmark, which is moved in
668 \@svsechd so that \unskip in \@xsect works).
669 \maketitle\@maketitle suppress page number, reset \@title.. locally
670 \numberline adds space after number, so overfull box if
671 too close to heading.
672
673 CHANGES
674 Ver 1.3 (3.Apr 98)
675 If \secindent < 0, then \section* produces a flush heading, not outdented.
676 \hdpos takes level as parameter and is used for all sections, not just
677 \part and \chapter.
678 `ex' measurements replaced by \baselineskip equivalents.
679 Ver 1.31
680 Bugfix: \relax added to \@alph, \@Alph to enable use with \@ifempty test.
681 Ver 1.32
682 Bugfixes: \hdpos added to \@ssect, unused macro \secpos removed,
683 \nobreak added after \thechapter in \makechapterhead
684 Ver 1.4
685 \hdpos made simple macro again. Counter \hddepth determines when it
686 should be used. Functions of \@makechapterhead, \@smakechapterhead
687 changed to make editing vertical spacing of chapters easier.
688 \part\@part\@spart rewritten so that all spacing info in \part.
689 \part calls \@spart which finishes off the heading.
690 Memory use < 200 words.
691 End of SECTION.STY