File: sections.dtx

package info (click to toggle)
texlive-lang 2022.20230122-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,447,264 kB
  • sloc: perl: 61,377; xml: 53,781; makefile: 4,525; sh: 4,338; ansic: 2,892; python: 2,861; ruby: 1,031; lisp: 750; awk: 649; java: 159; sed: 142; csh: 25
file content (415 lines) | stat: -rw-r--r-- 15,999 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415

% \iffalse
%%% From File: sections.dtx
% \fi
%
%    \begin{macrocode}

%<*sections>
%    \end{macrocode}
% \subsection{  }
%
% \subsubsection{Section}
%
% \paragraph{    }
%
% \DescribeMacro{\tocprethesection}\index{!\verb*+\tocprethesection+}
% \DescribeMacro{\tocpostthesection}\index{!\verb*+\tocpostthesection+}
% \DescribeMacro{\tocsectionfill}\index{!\verb*+\tocsectionfill+}
% \DescribeMacro{\tocsectionfont}\index{!\verb*+\tocsectionfont+}
% \DescribeMacro{\tocsectionfillfont}\index{!\verb*+\tocsectionfillfont+}
% \DescribeMacro{\tocsectionnumfont}\index{!\verb*+\tocsectionnumfont+}
%    \begin{macrocode}
\providecommand\tocprethesection{}
\providecommand\tocpostthesection{.\@postskip}
\providecommand\tocsectionfill{\tocfill{.}}

\providecommand\tocsectionfont{\normalfont}
\providecommand\tocsectionfillfont{}
\providecommand\tocsectionnumfont{}
%    \end{macrocode}
% \DescribeMacro{\tocsectionindent}\index{!\verb*+\tocsectionindent+}
%     .
%    \begin{macrocode}
\providecommand\tocsectionindent{1.5em}
%    \end{macrocode}
% \DescribeMacro{\tocsectionnameindent}\index{!\verb*+\tocsectionnameindent+}
%   .
%    \begin{macrocode}
\providecommand\tocsectionnameindent{2.6em}

%    \end{macrocode}
% \paragraph{   }
%
% \DescribeMacro{\sectionfont}\index{!\verb*+\sectionfont+}
% \DescribeMacro{\prethesection}\index{!\verb*+\prethesection+}
% \DescribeMacro{\postthesection}\index{!\verb*+\postthesection+}
%    \begin{macrocode}
\providecommand\sectionfont{\normalfont\large\bfseries}

\providecommand\prethesection{}
\providecommand\postthesection{.~}

%    \end{macrocode}
% \DescribeMacro{\sectionindent}\index{!\verb*+\sectionindent+}
%      .
%    \begin{macrocode}
\providecommand\sectionindent{\z@}
%    \end{macrocode}
% \DescribeMacro{\beforesection}\index{!\verb*+\beforesection+}
%      .
%    \begin{macrocode}
\providecommand\beforesection{-3.5ex \@plus -1ex \@minus -.2ex}
%    \end{macrocode}
% \DescribeMacro{\aftersection}\index{!\verb*+\aftersection+}
%      .
%    \begin{macrocode}
\providecommand\aftersection{2.3ex \@plus.2ex}
%    \end{macrocode}
% \DescribeMacro{\sectionalign}\index{!\verb*+\sectionalign+}
%  .
%    \begin{macrocode}
\providecommand\sectionalign{\raggedright}

%    \end{macrocode}
% \subsubsection{Subsection}
% \paragraph{    }
%
% \DescribeMacro{\tocprethesubsection}\index{!\verb*+\tocprethesubsection+}
% \DescribeMacro{\tocpostthesubsection}\index{!\verb*+\tocpostthesubsection+}
% \DescribeMacro{\tocsubsectionfill}\index{!\verb*+\tocsubsectionfill+}
% \DescribeMacro{\tocsubsectionfont}\index{!\verb*+\tocsubsectionfont+}
% \DescribeMacro{\tocsubsectionfillfont}\index{!\verb*+\tocsubsectionfillfont+}
% \DescribeMacro{\tocsubsectionnumfont}\index{!\verb*+\tocsubsectionnumfont+}
% \DescribeMacro{\tocsubsectionindent}\index{!\verb*+\tocsubsectionindent+}
% \DescribeMacro{\tocsubsectionnameindent}\index{!\verb*+\tocsubsectionnameindent+}
%    \begin{macrocode}
\providecommand\tocprethesubsection{}
\providecommand\tocpostthesubsection{.\@postskip}
\providecommand\tocsubsectionfill{\tocfill{.}}

\providecommand\tocsubsectionfont{\normalfont}
\providecommand\tocsubsectionfillfont{}
\providecommand\tocsubsectionnumfont{}

\providecommand\tocsubsectionindent{4.1em}
\providecommand\tocsubsectionnameindent{3.5em}

%    \end{macrocode}
% \paragraph{   }
%
% \DescribeMacro{\subsectionfont}\index{!\verb*+\subsectionfont+}
% \DescribeMacro{\prethesubsection}\index{!\verb*+\prethesubsection+}
% \DescribeMacro{\postthesubsection}\index{!\verb*+\postthesubsection+}
% \DescribeMacro{\subsectionindent}\index{!\verb*+\subsectionindent+}
% \DescribeMacro{\beforesubsection}\index{!\verb*+\beforesubsection+}
% \DescribeMacro{\aftersubsection}\index{!\verb*+\aftersubsection+}
% \DescribeMacro{\subsectionalign}\index{!\verb*+\subsectionalign+}
%    \begin{macrocode}
\providecommand\subsectionfont{\normalfont\normalsize\bfseries}

\providecommand\prethesubsection{}
\providecommand\postthesubsection{.~}

\providecommand\subsectionindent{\z@}
\providecommand\beforesubsection{-3.25ex\@plus -1ex \@minus -.2ex}
\providecommand\aftersubsection{1.5ex \@plus .2ex}
\providecommand\subsectionalign{\raggedright}

%    \end{macrocode}
% \subsubsection{Subsubsection}
% \paragraph{    }
%
% \DescribeMacro{\tocprethesubsubsection}\index{!\verb*+\tocprethesubsubsection+}
% \DescribeMacro{\tocpostthesubsubsection}\index{!\verb*+\tocpostthesubsubsection+}
% \DescribeMacro{\tocsubsubsectionfill}\index{!\verb*+\tocsubsubsectionfill+}
%
% \DescribeMacro{\tocsubsubsectionfont}\index{!\verb*+\tocsubsubsectionfont+}
% \DescribeMacro{\tocsubsubsectionfillfont}\index{!\verb*+\tocsubsubsectionfillfont+}
% \DescribeMacro{\tocsubsubsectionnumfont}\index{!\verb*+\tocsubsubsectionnumfont+}
%
% \DescribeMacro{\tocsubsubsectionindent}\index{!\verb*+\tocsubsubsectionindent+}
% \DescribeMacro{\tocsubsubsectionnameindent}\index{!\verb*+\tocsubsubsectionnameindent+}
%    \begin{macrocode}
\providecommand\tocprethesubsubsection{}
\providecommand\tocpostthesubsubsection{.\@postskip}
\providecommand\tocsubsubsectionfill{\tocfill{.}}

\providecommand\tocsubsubsectionfont{\normalfont}
\providecommand\tocsubsubsectionfillfont{}
\providecommand\tocsubsubsectionnumfont{}

\providecommand\tocsubsubsectionindent{7.6em}
\providecommand\tocsubsubsectionnameindent{4.7em}

%    \end{macrocode}
% \paragraph{   }
%
% \DescribeMacro{\subsubsectionfont}\index{!\verb*+\subsubsectionfont+}
% \DescribeMacro{\prethesubsubsection}\index{!\verb*+\prethesubsubsection+}
% \DescribeMacro{\postthesubsubsection}\index{!\verb*+\postthesubsubsection+}
% \DescribeMacro{\subsubsectionindent}\index{!\verb*+\subsubsectionindent+}
% \DescribeMacro{\beforesubsubsection}\index{!\verb*+\beforesubsubsection+}
% \DescribeMacro{\aftersubsubsection}\index{!\verb*+\aftersubsubsection+}
% \DescribeMacro{\subsubsectionalign}\index{!\verb*+\subsubsectionalign+}
%    \begin{macrocode}
\providecommand\subsubsectionfont{\normalfont\normalsize\bfseries}

\providecommand\prethesubsubsection{}
\providecommand\postthesubsubsection{.~}

\providecommand\subsubsectionindent{\z@}
\providecommand\beforesubsubsection{-3.25ex\@plus -1ex \@minus -.2ex}
\providecommand\aftersubsubsection{1.5ex \@plus .2ex}
\providecommand\subsubsectionalign{\raggedright}

%    \end{macrocode}
% \subsubsection{Paragraph}
% \paragraph{    }
%
% \DescribeMacro{\tocpretheparagraph}\index{!\verb*+\tocpretheparagraph+}
% \DescribeMacro{\tocposttheparagraph}\index{!\verb*+\tocposttheparagraph+}
% \DescribeMacro{\tocparagraphfill}\index{!\verb*+\tocparagraphfill+}
%
%    \begin{macrocode}
\providecommand\tocpretheparagraph{}
\providecommand\tocposttheparagraph{.\@postskip}
\providecommand\tocparagraphfill{\tocfill{.}}

%    \end{macrocode}
% \DescribeMacro{\tocparagraphfont}\index{!\verb*+\tocparagraphfont+}
% \DescribeMacro{\tocparagraphfillfont}\index{!\verb*+\tocparagraphfillfont+}
% \DescribeMacro{\tocparagraphnumfont}\index{!\verb*+\tocparagraphnumfont+}
%    \begin{macrocode}
\providecommand\tocparagraphfont{\normalfont}
\providecommand\tocparagraphfillfont{}
\providecommand\tocparagraphnumfont{}

%    \end{macrocode}
% \DescribeMacro{\tocparagraphindent}\index{!\verb*+\tocparagraphindent+}
% \DescribeMacro{\tocparagraphnameindent}\index{!\verb*+\tocparagraphnameindent+}
%    \begin{macrocode}
\providecommand\tocparagraphindent{10em}
\providecommand\tocparagraphnameindent{5em}

%    \end{macrocode}
% \paragraph{   }
%
% \DescribeMacro{\paragraphfont}\index{!\verb*+\paragraphfont+}
%
% \DescribeMacro{\pretheparagraph}\index{!\verb*+\pretheparagraph+}
% \DescribeMacro{\posttheparagraph}\index{!\verb*+\posttheparagraph+}
%
% \DescribeMacro{\paragraphindent}\index{!\verb*+\paragraphindent+}
% \DescribeMacro{\beforeparagraph}\index{!\verb*+\beforeparagraph+}
% \DescribeMacro{\afterparagraph}\index{!\verb*+\afterparagraph+}
% \DescribeMacro{\paragraphalign}\index{!\verb*+\paragraphalign+}
%    \begin{macrocode}
\providecommand\paragraphfont{\normalfont\normalsize\bfseries}

\providecommand\pretheparagraph{}
\providecommand\posttheparagraph{.~}

\providecommand\paragraphindent{\z@}
\providecommand\beforeparagraph{3.25ex \@plus1ex \@minus.2ex}
\providecommand\afterparagraph{-1em}
\providecommand\paragraphalign{}

%    \end{macrocode}
% \subsubsection{Subparagraph}
% \paragraph{    }
%
% \DescribeMacro{\tocprethesubparagraph}\index{!\verb*+\tocprethesubparagraph+}
% \DescribeMacro{\tocpostthesubparagraph}\index{!\verb*+\tocpostthesubparagraph+}
% \DescribeMacro{\tocsubparagraphfill}\index{!\verb*+\tocsubparagraphfill+}
%    \begin{macrocode}
\providecommand\tocprethesubparagraph{}
\providecommand\tocpostthesubparagraph{.\@postskip}
\providecommand\tocsubparagraphfill{\tocfill{.}}

%    \end{macrocode}
% \DescribeMacro{\tocsubparagraphfont}\index{!\verb*+\tocsubparagraphfont+}
% \DescribeMacro{\tocsubparagraphfillfont}\index{!\verb*+\tocsubparagraphfillfont+}
% \DescribeMacro{\tocsubparagraphnumfont}\index{!\verb*+\tocsubparagraphnumfont+}
%    \begin{macrocode}
\providecommand\tocsubparagraphfont{\normalfont}
\providecommand\tocsubparagraphfillfont{}
\providecommand\tocsubparagraphnumfont{}

%    \end{macrocode}
% \DescribeMacro{\tocsubparagraphindent}\index{!\verb*+\tocsubparagraphindent+}
% \DescribeMacro{\tocsubparagraphnameindent}\index{!\verb*+\tocsubparagraphnameindent+}
%    \begin{macrocode}
\providecommand\tocsubparagraphindent{12em}
\providecommand\tocsubparagraphnameindent{6em}

%    \end{macrocode}
% \paragraph{   }
%
% \DescribeMacro{\subparagraphfont}\index{!\verb*+\subparagraphfont+}
%
% \DescribeMacro{\prethesubparagraph}\index{!\verb*+\prethesubparagraph+}
% \DescribeMacro{\postthesubparagraph}\index{!\verb*+\postthesubparagraph+}
%
% \DescribeMacro{\subparagraphindent}\index{!\verb*+\subparagraphindent+}
% \DescribeMacro{\beforesubparagraph}\index{!\verb*+\beforesubparagraph+}
% \DescribeMacro{\aftersubparagraph}\index{!\verb*+\aftersubparagraph+}
% \DescribeMacro{\subparagraphalign}\index{!\verb*+\subparagraphalign+}
%    \begin{macrocode}
\providecommand\subparagraphfont{\normalfont\normalsize\bfseries}

\providecommand\prethesubparagraph{}
\providecommand\postthesubparagraph{.~}

\providecommand\subparagraphindent{\parindent}
\providecommand\subparagraphalign{\raggedright}
\providecommand\beforesubparagraph{3.25ex \@plus1ex \@minus .2ex}
\providecommand\aftersubparagraph{-1em}

%    \end{macrocode}
% \subsubsection{ }
%
% \DescribeMacro{\@startsection}\index{!\verb*+"\"@startsection+}
% ,   .
%    \begin{macrocode}
\def\@startsection#1#2{%
  \if@noskipsec \leavevmode \fi
  \par
  \@tempskipa \csname before#1\endcsname\relax
  \@afterindenttrue
  \ifdim \@tempskipa <\z@
    \@tempskipa -\@tempskipa \@afterindentfalse
  \fi
  \if@nobreak
    \everypar{}%
  \else
    \addpenalty\@secpenalty\addvspace\@tempskipa
  \fi
  \@ifstar
    {\@ssect{\csname #1indent\endcsname}%
            {\csname before#1\endcsname}{\csname after#1\endcsname}%
            {\csname #1font\endcsname\csname #1align\endcsname}}%
    {\@dblarg{\@sect{#1}{#2}{\csname #1indent\endcsname}%
            {\csname before#1\endcsname}{\csname after#1\endcsname}%
            {\csname #1font\endcsname\csname #1align\endcsname}}}%
}

%    \end{macrocode}
% \DescribeMacro{\@ssect}\index{!\verb*+"\"@ssect+}
%   .
%    \begin{macrocode}
\def\@ssect#1#2#3#4#5{%
  \@tempskipa #3\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #4{%
        \@hangfrom{\hskip #1}%
          \interlinepenalty \@M #5\@@par}%
    \endgroup
  \else
    \def\@svsechd{#4{\hskip #1\relax #5}}%
  \fi
  \@xsect{#3}%
}

%    \end{macrocode}
% \DescribeMacro{\@sect}\index{!\verb*+"\"@sect+}
%   .
%    \begin{macrocode}
\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #6{%
        \@hangfrom{\hskip #3\relax\@svsec}%
          \interlinepenalty \@M #8\@@par}%
    \endgroup
    \csname #1mark\endcsname{#7}%
    \addcontentsline{toc}{#1}{%
      \ifnum #2>\c@secnumdepth \else
        \protect\numberline{\@tocseccntformat{#1}}%
      \fi
      #7}%
  \else
    \def\@svsechd{%
      #6{\hskip #3\relax
      \@svsec #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\@tocseccntformat{#1}}%
        \fi
        #7}%
    }%
  \fi
  \@xsect{#5}%
}

%    \end{macrocode}
% \DescribeMacro{\@tocline}\index{!\verb*+"\"@tocline+}
%    ,    .
%    \begin{macrocode}
\def\@tocline#1#2#3#4{%
  \ifnum #2>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip \csname toc#1indent\endcsname\relax%
     \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent \csname toc#1indent\endcsname\relax%
     \@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima \csname toc#1nameindent\endcsname\relax
     \csname toc#1font\endcsname
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {#3}\nobreak
     \csname toc#1fillfont\endcsname \csname toc#1fill\endcsname\hfill
     \nobreak\hb@xt@\@pnumwidth{\hfil\csname toc#1numfont\endcsname #4}%
     \par%
    }%
  \fi
}

%    \end{macrocode}
% ,         .
% \DescribeMacro{\section}\index{!\verb*+\section+}
% \DescribeMacro{\l@section}\index{!\verb*+"\l"@section+}
%    \begin{macrocode}
\newcommand\section{\@startsection{section}{1}}
\newcommand*\l@section{\@tocline{section}{1}}

%    \end{macrocode}
% \DescribeMacro{\subsection}\index{!\verb*+\subsection+}
% \DescribeMacro{\l@subsection}\index{!\verb*+"\l"@subsection+}
%    \begin{macrocode}
\newcommand\subsection{\@startsection{subsection}{2}}
\newcommand*\l@subsection{\@tocline{subsection}{2}}

%    \end{macrocode}
% \DescribeMacro{\subsubsection}\index{!\verb*+\subsubsection+}
% \DescribeMacro{\l@subsubsection}\index{!\verb*+"\l"@subsubsection+}
%    \begin{macrocode}
\newcommand\subsubsection{\@startsection{subsubsection}{3}}
\newcommand*\l@subsubsection{\@tocline{subsubsection}{3}}

%    \end{macrocode}
% \DescribeMacro{\paragraph}\index{!\verb*+\paragraph+}
% \DescribeMacro{\l@paragraph}\index{!\verb*+"\l"@paragraph+}
%    \begin{macrocode}
\newcommand\paragraph{\@startsection{paragraph}{4}}
\newcommand*\l@paragraph{\@tocline{paragraph}{4}}

%    \end{macrocode}
% \DescribeMacro{\subparagraph}\index{!\verb*+\subparagraph+}
% \DescribeMacro{\l@subparagraph}\index{!\verb*+"\l"@subparagraph+}
%    \begin{macrocode}
\newcommand\subparagraph{\@startsection{subparagraph}{5}}
\newcommand*\l@subparagraph{\@tocline{subparagraph}{5}}

%</sections>
%    \end{macrocode}