blob: 2c6a4163167d98539e87c4b8cae1fcc8c166e863 (
plain)
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
|
% sections
\makeatletter
\outer\def\section #1\par{%
\global\advance\secno by 1 \global\subsecno=0
\global\subsubsecno=0
\vskip0pt plus.4\vsize\penalty-120
\vskip0pt plus-.4\vsize\bigskip\vskip\parskip
{\noindent \titlefont{sec}
\the\secno.\enskip #1\par}\nobreak
\tocentry{\the\secno}\sec
% \ifgathercontents \edef\temp{{\the\secno}}%
% \expandafter\writecontents\temp{#1}\sec\fi
\nobreak
\medskip
\nobreak
\noindent
}
% The starred version does not introduce a breakpoint, so that an
% immediately preceeding section heading is not orphaned.
\def\subsection{\pst@ifstar\sub@section}
\def\sub@section #1\par{%
\global\advance \subsecno by 1
\global\subsubsecno=0
\if@star
\else
\vskip0pt plus.1\vsize\penalty-100
\vskip0pt plus-.1\vsize
\fi
\bigskip\vskip\parskip
{\noindent \titlefont{sub}%
\the\secno .\the\subsecno.\enskip \ignorespaces #1}\par\nobreak
\tocentry{\the\secno.\the\subsecno}\subsec{#1}
\par\nobreak\medskip\nobreak\noindent
}
\outer\def\subsubsection #1 \par{%
\global\advance \subsubsecno by 1 \global\subsubsubsecno=0
\vskip0pt plus.1\vsize\penalty0
\vskip0pt plus-.1\vsize\bigskip\vskip\parskip
{\noindent \titlefont{subsub}
\the\secno .\the\subsecno.\the\subsubsecno \enskip #1}\par\nobreak
% \tocentry{\the\secno.\the\subsecno.\the\subsubsecno}\subsubsec{#1}
\medskip\nobreak\noindent
}
\def\tocentry#1#2#3{%
\ifgathercontents \edef\temp{{#1}}%
\expandafter\writecontents\temp{#3}#2\fi
}
\def\writecontents#1#2#3{%
\write@contents{\noexpand#3{#1} {#2}
\noexpand\writefill \the\pageno \noexpand\par}%
}
\def\writefill{%
\leaders\hbox to 2ex{\hfil.\hfil}\hfill\enspace
}
\outer\def\appendix#1#2\par{%
\vskip0pt plus.4\vsize\penalty-20
\vskip0pt plus-.4\vsize\bigskip\vskip\parskip
\def\app@name{#1}\subsecno=0%
{\noindent \titlefont{sec}
Appendix #1.\enspace
\ignorespaces#2\par}\nobreak
\ifgathercontents \edef\temp{{#1}}%
\expandafter\writecontents\temp{#2}\sec\fi
\medskip\nobreak\noindent
}
\def\subappendix#1\par{%
\medskip
\noindent
\advance\subsecno by 1
{\titlefont{sub}\app@name.\the\subsecno.\enspace
\ignorespaces#1\medskip\noindent}%
\ifgathercontents \edef\temp{{\app@name.\the\subsecno}}%
\expandafter\writecontents\temp{#1}\subsec\fi \nobreak
}
\def\currsec{\ifnum\secno>0 \the\secno
\ifnum\subsecno>0 .\the\subsecno
\ifnum\subsubsecno>0 .\the\subsubsecno \fi\fi\fi}
\def\deftagsec#1{\deftag\currsec{#1}}
%\newif\iftracingtagrefs
\resetatcatcode
|