This repository has been archived by the owner on Jul 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
macros.tex
103 lines (85 loc) · 2.6 KB
/
macros.tex
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
\font\bigfont=cmssdc10 at 48pt
\font\mediumfont=cmssdc10 at 24pt
\font\sectionfont=cmssdc10 at 14pt
\def\startcenter{%
\par
\begingroup
\leftskip=0pt plus 1fil
\rightskip=\leftskip
\parindent=0pt
\parfillskip=0pt
}
\def\stopcenter{%
\par
\endgroup
}
\def\sporthcode #1{
{
\bigskip
\begingroup \narrower
\input sp/#1
\endgroup
\bigskip
}
}
\def \sword #1 {
{\hbox{\tt#1}}
}
\def \subsec #1 {
{\medskip \noindent \sectionfont #1 \smallskip}
}
% Slightly redefined macros from cwebmac
\def\MN#1{\par % common code for \M, \N
{\xdef\secstar{#1}\let\*=\empty\xdef\secno{#1}}% remove \* from section name
\ifx \secno\secstar \onmaybe \else \ontrue \fi
\mark{{{\tensy x}\secno}{\the\gdepth}{\the\gtitle}}
}
\def\stsec_alt{\rightskip=0pt % get out of C mode (cf. \B)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
%\noindent{\let\*=\lapstar\bf\secstar.\quad}%
\ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
\let\*=\empty\pdfdest num \secstar fith}}
\else\ifpdf\smash{\raise\baselineskip\hbox to0pt{%
\let\*=\empty\special{%
pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}
\outer\def\M#1{\MN{#1}\ifon\vfil\penalty-100\vfilneg % beginning of section
\vskip\intersecskip\startsection\ignorespaces}
\outer\def\N#1#2#3.{% beginning of starred section
\ifacro{\toksF={}\makeoutlinetoks#3\outlinedone\outlinedone}\fi
\gdepth=#1
\gtitle={#3}
\MN{#2}%
\ifon\ifnum#1<\secpagedepth \vfil\eject % force page break if depth is small
\else\vfil\penalty-100\vfilneg\vskip\intersecskip\fi\fi
\message{*\secno} % progress report
\def\stripprefix##1>{}\def\gtitletoks{#3}%
\edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
\edef\next{\write\cont{\ZZ{\gtitletoks}{#1}{\secno}% write to contents file
{\noexpand\the\pageno}{\the\toksE}}}\next % \ZZ{title}{depth}{sec}{page}{ss}
\ifpdftex\expandafter\xdef\csname curr#1\endcsname{\secno}
\ifnum#1>0\countB=#1 \advance\countB by-1
\advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi\fi
\ifpdf\special{pdf: outline #1 << /Title (\the\toksE) /Dest
[ @thispage /FitH @ypos ] >>}\fi
\ifon\stsec_alt{\bigheader{#3} {\rm (#2) }\quad \smallskip}\ignorespaces}
\def\bigheader#1{\noindent {\mediumfont #1}}
\let\url\relax
\def\begincodecomment{
\medskip
\begingroup
\leftskip=1in
\rightskip=1in
\sl
}
\def\endcodecomment{
\par
\medskip
\endgroup
}
% display figures from gnuplot
\def \displayfig #1 {
\startcenter
\epsfxsize=180pt
\epsfbox{#1}
\stopcenter
}