aboutsummaryrefslogtreecommitdiffstats
path: root/doc/user/mydefs
blob: 727bb27c010e76853d9d1ad3324da74953a3f597 (plain) (blame)
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

   ###################################################
   #                                                 #
   #  Lout keywords and @Code symbol.                #
   #                                                 #
   ###################################################

   def @Code right x
   { { Helvetica Base -1p } @Font lines @Break x }

   def @@BackEnd           { @Code "@BackEnd"           }
   def @@Begin             { @Code "@Begin"             }
   def @@Break             { @Code "@Break"             }
   def @@Case              { @Code "@Case"              }
   def @@Database          { @Code "@Database"          }
   def @@End               { @Code "@End"               }
   def @@Font              { @Code "@Font"              }
   def @@Char              { @Code "@Char"              }
   def @@Galley            { @Code "@Galley"            }
   def @@Graphic           { @Code "@Graphic"           }
   def @@HAdjust           { @Code "@HAdjust"           }
   def @@HContract         { @Code "@HContract"         }
   def @@HCover            { @Code "@HCover"            }
   def @@HExpand           { @Code "@HExpand"           }
   def @@HScale            { @Code "@HScale"            }
   def @@High              { @Code "@High"              }
   def @@HShift            { @Code "@HShift"            }
   def @@Include           { @Code "@Include"           }
   def @@Insert            { @Code "@Insert "           }
   def @@IncludeGraphic    { @Code "@IncludeGraphic"    }
   def @@Key               { @Code "@Key"               }
   def @@LClos             { @Code "@LClos"             }
   def @@LEnv              { @Code "@LEnv"              }
   def @@LInput            { @Code "@LInput"            }
   def @@LVis              { @Code "@LVis"              }
   def @@Moment            { @Code "@Moment"            }
   def @@Next              { @Code "@Next"              }
   def @@Null              { @Code "@Null"              }
   def @@OneCol            { @Code "@OneCol"            }
   def @@OneRow            { @Code "@OneRow"            }
   def @@Open              { @Code "@Open"              }
   def @@Outline           { @Code "@Outline"             }
   def @@PAdjust           { @Code "@PAdjust"           }
   def @@PrependGraphic    { @Code "@PrependGraphic"    }
   def @@Rotate            { @Code "@Rotate"            }
   def @@Scale             { @Code "@Scale"             }
   def @@SetColor          { @Code "@SetColor"          }
   def @@SetColour         { @Code "@SetColour"         }
   def @@Language          { @Code "@Language"          }
   def @@CurrLang          { @Code "@CurrLang"          }
   def @@Space             { @Code "@Space"             }
   def @@SysDatabase       { @Code "@SysDatabase"       }
   def @@SysInclude        { @Code "@SysInclude"        }
   def @@SysIncludeGraphic { @Code "@SysIncludeGraphic" }
   def @@SysPrependGraphic { @Code "@SysPrependGraphic" }
   def @@Tag               { @Code "@Tag"               }
   def @@Tagged            { @Code "@Tagged"            }
   def @@Use               { @Code "@Use"               }
   def @@VAdjust           { @Code "@VAdjust"           }
   def @@VContract         { @Code "@VContract"         }
   def @@VCover            { @Code "@VCover"            }
   def @@VExpand           { @Code "@VExpand"           }
   def @@VScale            { @Code "@VScale"            }
   def @@VShift            { @Code "@VShift"            }
   def @@Wide              { @Code "@Wide"              }
   def @@Yield             { @Code "@Yield"             }


   ###################################################
   #                                                 #
   #  Miscellaneous symbols used in the guide.       #
   #                                                 #
   ###################################################

   def @TeX
   { @OneCol { T &0.4fo {-0.2f @VShift E} &0.45fo X }
   }

   def @LaTeX
   { @OneCol { L &0.3fo { +0.1f @VShift 0.8f @Font A } &0.4fo @TeX }
   }

   import @BasicSetup
   def @Batlow { Batlow Food Distributors Pty. Ltd. }

   import @BasicSetup
   def @GreyBox right x { @Box paint { lightgrey } x }

   import @BasicSetup
   def @HeadingBox left x right y
   {
       @Box { @CentredDisplay @Heading x y }
   }

   def @FilledBox
   {
     @BackEnd @Case {
       PostScript @Yield {
         { "0 0 moveto xsize 0 lineto xsize ysize lineto 0 ysize lineto"
           "closepath fill"
         } @Graphic { 0.6f @High ^/ 0.4f @High 4f @Wide }
       }
       PDF @Yield {
         { "0 0 m __xsize 0 l __xsize __ysize l 0 __ysize l h f"
         } @Graphic { 0.6f @High ^/ 0.4f @High 4f @Wide }
       }
     }
   }

   import @Eq
   def epi { p sub i ` log sub 2 ` p sub i }
 
   import @Eq
   def ep right x { p sub x ` log sub 2 ` p sub x }
 
   def @Dbl left x right y
   { 1.95i @Wide
     { 1.25i @Wide { |1rt @Code x } |0.2i @Eq {non y} }
   }
 
   import @Eq
   def @ExA { 1 over sqrt { 1 - 4 x sup 2 } }

   def @@Diag { @Code "@Diag" }

   extend @DiagSetup @Diag
   macro @MyNode {
    @Node
	outline {
	    LR:: { xsize 0 }
	    LR:< 0d
	    UL:: { 0 ysize }
	    UL:< 270d
	    0 0 LR UL 0 0
	}
   }

   extend @DiagSetup @Diag
   macro @MyLink {
    @Link
	path {
	    FROM:: from
	    TO:: to
	    FROM TO
	}
   }

   def @ShowHMark
      named linewidth  { 0.015 cm }
      named linestyle  { dashed   }
      named dashlength { 0.15 cm  }
      named paint      { light    }
      right x
   {
      @Fig
      {
         @Figure
                 shape {
                   @BackEnd @Case {
                     PostScript @Yield {
                         -0.3 cm ymark
                         {xsize ymark} ++ {0.3 cm 0}
                     }
                     PDF @Yield { ""    #       VT: PDF currently has no output
                     }
                   }
                 }
                 linewidth { linewidth }
                 linestyle { linestyle }
                 dashlength { dashlength }
         x
      }
   }
 
   def @ZeroWidth right x { @OneCol { |0io x |0io } }
 
   def @SomeText
   {
Johnson suddenly uttered, in a strong determined tone, an apophegm, at
which many will start:  `Patriotism is the last refuge of a scoundrel.'
   }
 
   import @DiagSetup
   def @OpenCircle { @Diag { @Circle margin { 0.2f } } }
 
   import @DiagSetup
   def @ClosedCircle { @Diag { @Circle paint { black } margin { 0.2f } } }
 
   import @TblSetup @BasicSetup
   def @AmberLight
   {
       @OneRow @Tbl
           aformat { @Cell indentvertical { align } A }
           marginhorizontal { 0i }
           marginvertical { 0i }
           strut { no }
           rule { no }
           paint { no }
        {
            @Rowa A { @OpenCircle }
            @MarkRowa A { @ClosedCircle }
            @Rowa A { @OpenCircle }
        }
   }

   import @DiagSetup @Diag
   def @Four named code { } right x
   {
       3.8c @Wide @Code code    ||0.3c
       2.7c @Wide @StartRight x ||0.3c
       2.7c @Wide @StartUp    x ||0.3c
       2.7c @Wide @StartLeft  x ||0.3c
       2.2c @Wide @StartDown  x
   }