summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/otherformats/lollipop/manual/mandefs.tex
blob: e952bea1ebb349758d894aa2795ff45ae70eb0b8 (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
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
% mandefs.tex style definition for the Lollipop manual
% copyright 1992/3 Victor Eijkhout
% copyright 2014 Vafa Khalighi
%
%
%    This program is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
%
\def\con#1{{\tt#1}}
\def\n#1{{\tt#1}}
\def\file#1{{\tt#1}}

\def\Lollipop{Lollipop}

\Distance:rightmarginstretch={0cm plus 2.54cm}
\Distance:whitebefore={6pt plus 3pt minus 2pt}
\Distance:whiteafter=whitebefore
\FlushRight:no

\DefineExternalFile:contents=toc

\DefineHeading:Chapter
    breakbefore:yes whiteafter:20pt
    line:start PointSize:14 Style:bold literal:Chapter 
        Spaces:1 ChapterCounter line:stop
    vwhite:15pt
    line:start PointSize:16 Style:bold title line:stop
    external:contents title external:stop
    Stop

\AdaptiveDistance:WidestLabel=15pt
\def\MeasureLabel{\ifdim\BlockWidth>\WidestLabel
    \global\WidestLabel\BlockWidth\fi}
\StartCommand{\Distance:parindent=WidestLabel }
\DefineHeading:Section
    whitebefore:{20pt plus 2pt} whiteafter:14pt
    line:start PointSize:14 Style:italic 
        block:start block:start ChapterCounter . SectionCounter
              Spaces:1 block:stop MeasureLabel
              fillupto:WidestLabel
        title line:stop
    external:contents title external:stop
    label:start ChapterCounter . SectionCounter label:stop
    Stop
\GoverningCounter:Section=Chapter

\DefineHeading:SubSection
    whitebefore:{14pt plus 2pt} whiteafter:8pt
    line:start PointSize:10 Style:italic 
        ChapterCounter . SectionCounter . SubSectionCounter 
        Spaces:1 title line:stop
    label:start ChapterCounter . Spaces:.2 SectionCounter 
        . Spaces:.2 SubSectionCounter label:stop
    Stop
\GoverningCounter:SubSection=Section

\DefineExternalFile:impnotes=imp
\DefineHeading:iSection
    whitebefore:{10pt plus 1pt} whiteafter:8pt
    line:start PointSize:12 Style:bold I - 
        Style:italic iSectionCounter
        Spaces:1 title line:stop
    label:start I - iSectionCounter label:stop
    external:impnotes title external:stop
    Stop
%\GoverningCounter:iSection=Chapter
\DefineExternalItem:iSection file:impnotes PushIndentLevel
    item:left I - Style:italic iSectionLabel item:stop
    title begingroup Spaces:2 Style:italic Page endgroup
    Stop

\DefineExternalItem:Chapter file:contents
    item:left ChapterLabel item:stop
    title begingroup Spaces:2 Style:italic Page endgroup
    Stop
\DefineExternalItem:Section file:contents PushIndentLevel 
    item:left ChapterLabel . SectionLabel item:stop
    title begingroup Spaces:2 Style:italic Page endgroup
    Stop

\def\impnotetxt{Implementor's Note}
\DefineTextBlock:ImpNote PushIndentLevel 
    whitebefore:12pt whiteafter:11pt
    line:start PointSize:12 Style:italic impnotetxt line:stop
    SansFace PointSize:9 SetFont text
    Stop
\excludecomment{ImpNote}

\DefineTextBlock:WizNote
  PushIndentLevel PointSize:9 SetFont text
  Stop

\DefineList:Description
  item:left description Spaces:2 item:stop whitebetween:6pt
  Stop

\DefineList:cDescription
  item:left tt char busje description Spaces:2 item:stop 
  whitebetween:6pt
  Stop

\DefineList:Enumerate
  item:left itemCounter item:stop
  Stop

\DefineList:Itemize
  item:left itemsign item:stop
  Stop

\DefineBBL 
  item:left [ - itemCounter - ] item:stop
  Stop

\SerifFace \SetFont

\newwrite\exfile
\def\HereAndOut#1{\immediate\write\exfile{#1}}
\specialcomment{Example}
   {\EExample
    \immediate\openout\exfile=example.tex\relax 
    \let\ThisComment\HereAndOut}
   {\immediate\closeout\exfile 
    \begingroup \tt \SetFont 
                \verbatimfile{example.tex}\endgroup
    \SaveAlloc \input example.tex\relax \RestoreAlloc
    \EExampleStop}
\DefineTextBlock:EExample whiteafter:{6pt plus 5pt}
    noimplicitclose rule:h vwhite:3pt
    line:start literal:Example Spaces:1.5 
                   ChapterCounter . EExampleCounter 
               line:stop
    vwhite:3pt rule:h vwhite:3pt text vwhite:3pt rule:h
    Stop
\GoverningCounter:EExample=Chapter

\specialcomment{OutExample}
 {\EExample
    \immediate\openout\exfile=example.tex\relax 
    \let\ThisComment\HereAndOut}
   {\immediate\closeout\exfile 
    \begingroup \tt \SetFont 
                \verbatimfile{example.tex}\endgroup
    \par\penalty0\relax
    \SaveAlloc \SuspendOutput \begingroup \CountSheetsno 
        \global\setbox\PageRow\hbox{}%
               \let\CurrentShipout\ToPageRow
        \xInputFile:example
        \endgroup
    \ResumeOutput \RestoreAlloc 
    \noindent\unhbox\PageRow\hbox{}\par
    \EExampleStop}
\newbox\PageRow\newbox\RowPage
\def\ToPageRow{\setbox\RowPage\box\WholePage \xToPageRow}
\def\xToPageRow{\global\setbox\PageRow
    \hbox{\unhbox\PageRow\box\RowPage\hfill}}

\def\opt#1{{\tt#1}}
\DefineExternalFile:optindex=oix
\def\refopt#1{\OptToIdx #1\par}
\DefineHeading:OptToIdx embedded:yes
    block:start tt title block:stop
    external:optindex title external:stop 
    nomarks Stop
\DefineExternalItem:OptToIdx file:optindex
    embedded:yes
    begingroup tt title endgroup 
    nobreak Spaces:1.5 Page Spaces:2.5 Stop

\DefineExternalFile:csindex=cix
\def\refcs#1{\CsToIdx #1\par}
\DefineHeading:CsToIdx embedded:yes
    block:start tt char busje title block:stop
    external:csindex title external:stop 
    nomarks Stop
\DefineExternalItem:CsToIdx file:csindex
    embedded:yes
    begingroup tt char busje title endgroup
    nobreak Spaces:1.5 Page Spaces:2.5 Stop

\topskip20pt
\OptionsMacro:PageDims=width:page=15cm height:page=23cm Stop
\DefinePageGrid:LeftPage macro:PageDims
    band:start block:start PointSize:9 Style:italic
               FirstPlaced:ChapterCounter Spaces:2 stickout:left
         FirstPlaced:ChapterTitle band:stop
    textband:start text textband:stop
    band:invisible block:start PointSize:9 Style:bold
         PageCounter Spaces:2 stickout:left band:stop
    NextPageGrid:RightPage Stop
\DefinePageGrid:RightPage macro:PageDims
    band:start fillup PointSize:9 Style:italic
        LastPlaced:SectionTitle
        block:start Spaces:2 LastPlaced:ChapterCounter . 
            LastPlaced:SectionCounter stickout:right
        band:stop
    textband:start text textband:stop
    band:invisible fillup 
        block:start PointSize:9 Style:bold Spaces:2
            PageCounter stickout:right band:stop
    NextPageGrid:LeftPage Stop
\DefinePageGrid:EmptyPage macro:PageDims
    textband:start text textband:stop
    NextPageGrid:LeftPage Stop

\AdaptiveCounter:LastInPage \CounterRepresentation:LastInPage=i
\AdaptiveCounter:LastRegPage \CounterRepresentation:LastRegPage=1
%\SetCounter:LastInPage=PageValue -- at the end of prelim.tex
%\SetCounter:LastRegPage=PageValue -- at the end of manual.tex

\endinput

% 92/11/05 stretch added
% 92/11/18 adaptive label width
% 92/11/19 adaptive last page