blob: eb0fa885bbba2b7fc44b9e605f9bca3a1477adc6 (
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
\def\blankstyle{
\headline={}
\footline={}}
\def\frontmatterstyle{
\headline={}
\footlinedist=14pt
\footline={\_hss\rmfixed \romannumeral\_folio \_hss}}
\def\headlinefont{\_scalemain\_typoscale[800/]\caps\it}
\def\mainstyle{
\headline={{}}
\footlinedist=24pt
\footline={\_hss\rmfixed \_folio \_hss}}
% ---------- functionality mimicking "figures" from latex
\_refdecl{%
\_def\lotlist{} \_def\loflist{}^^J
\_def\Xtab#1#2#3{\_addto\lotlist{\lline{#1}{#2}{#3}}\_ea\_addto\_ea\lotlist\_ea{\_currpage}}^^J
\_def\Xfig#1#2#3{\_addto\loflist{\lline{#1}{#2}{#3}}\_ea\_addto\_ea\loflist\_ea{\_currpage}}
}
\def\captionT [#1]#2{\caption/t[#1]\_ewref\Xtab{{#1}{\_thetnum}{#2}}\ignorespaces}
\def\captionF [#1]#2{\caption/f[#1]\_ewref\Xfig{{#1}{\_thefnum}{#2}}\ignorespaces}
\def\lline#1#2#3#4#5{\line{\hskip2em\llap{\bf#2\enspace}#3 \_tocdotfill\ \_ilink[pg:#4]{#5}}}
\def\makell#1#2{\par
\ifx#1\undefined \opwarning{no data for list of #2, try to run TeX again}\openref
\else #1\fi
}
\def\makeLOF{\makell\loflist{figures}}
\def\makeLOT{\makell\lotlist{tables}}
% ----------
\def\photopage#1#2#3#4{{
\break\hbox to 0.9\hsize{\hfill\vbox{\leftskip=0.2in\rightskip=0.2in
\picw=4in\inspic{#1}
\scalemain\typoscale[800/]
\vskip 1em
\noindent #2 \hfill {\it (photo by #4)}\vskip 1em
\captionF [label]{#3} #3\par}
\hfill\break}}}
\def\essaytitle#1{\ul{#1}}
% --- strikeouts
% --- TODO this should be moved into sal.otx probably
\def\cancel#1#{\isempty{#1}\iftrue \afterfi{\cancel/}
\else
\lowercase{\casesof #1}
/ {\let\cancline=\drawFslash}
\\ {\let\cancline=\drawBslash}
x {\def\cancline{\drawBslash\drawFslash}}
- {\let\cancline=\drawHline}
\_finc {}%
\ea\cancelA
\fi
}
\def\cancelA{\ifmmode \ea\cancelM \else \ea\cancelT \fi}
\def\cancelT#1{\setbox0=\hbox{#1}\cancelF} % text mode
\def\cancelM#1{\mathstyles{\setbox0=\hbox{$\currstyle#1$}\cancelF}} % math mode
\def\cancelF{\edef\tmp{\cancline}\quitvmode\box0 \pdfliteral{q \useit{\cancelparams} \tmp S Q}}
\def\drawFslash{\bp{-\wd0} \bp{-\dp0} m 0 \bp{\ht0} l } % forward slash
\def\drawBslash{\bp{-\wd0} \bp{\ht0} m 0 \bp{-\dp0} l } % backward slash
\def\drawHline {\bp{-\wd0} \bp{.5ex} m 0 \bp{.5ex} l } % horizontal line
\def\cancelparams{1 0 0 RG 1 J .6 w} % color RG linetype J linewidth w
% ---------
% --- "parts" as higher sections
\newcount\partnum
\eoldef\part#1{\vfil\break
\incr\partnum \_chapnum=0 \_chapx % reset counters
\vglue100pt
\incr\tocrefnum \dest[toc:\the\tocrefnum] % destination from TOC and outlines
\centerline{\typosize[20/]\bf Part \the\partnum:\quad #1} % Title
\_ewref\_Xtoc{{0}{part}{}{}#1} % TOC line, \part has level 0
{\nopagenumbers \vfil\break} % single page without pageno
}
% ---- division title styles
\_def \_chapfont {\_scalemain\_typoscale[1800/]\caps\rm}
\_def\_printchap #1{{\_vfill\_supereject \_prevdepth=0pt
\_vglue\_medskipamount % shifted by topkip+\medskipamount
{\_chapfont \_noindent \_printrefnum[@]
\hskip 0.15in plus 0.75in\leaders\hrule\hfill #1\_nbpar}\_mark{}%
\_nobreak \_belowtitle{\_bigskip}%
\_firstnoindent}}
% ---
\def\afternote#1{{\narrower\it #1}}
\def\inlineaside#1{{\it (#1)}}
% ---
\sdef{_item:b}{{\bf\_the\_itemnum.\hskip 0.5em}}
\sdef{_item:Z}{{\bf\uppercase\_ea{\_athe\_itemnum}.\hskip 0.5em}}
\def\unstep{\advance\leftskip by -\parindent}
% ---
\fontfam[Pagella]
\typosize[11/13]
\def\headtitle{Blueprint for a Higher Civilization}
\def\Qs#1{\rightline{---{\it #1}}}
|