summaryrefslogtreecommitdiff
path: root/info/german/tex-kurs/layout2.sty
blob: b8e5524e849075b6422a5735650df147434d144a (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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
% This is LAYOUT.STY from Kent McPherson, SLI Avionic Systems Corp.
%
% Eingetippt von S. Rimmelspacher am 27.05.88
% Geaendert und lauffaehig gemacht von Dietmar Heinrich
% und Harald Meyer, Uni Karlsruhe; 07. Juli 1988
 
% Define \bs if it is undefined, redefine
% it if it is already defined.
 
\@ifundefined{bs}{\newcommand\bs{\char '134 }}%
  {\renewcommand\bs{\char '134 }}
\newcount\hofset
\newcount\vofset
\newcount\hofref
\newcount\vofref
\newcount\omargin
\newcount\omarginref
\newcount\emargin
\newcount\emarginref
\newcount\marginref
\newcount\tmargin
\newcount\hheight
\newcount\hsep
\newcount\theight
\newcount\twidth
\newcount\mparsep
\newcount\mparwidth
\newcount\fskip
\newcount\fheight
\newcount\headref
\newcount\bodyref
\newcount\footref
\newcount\margnoteref
\newcount\oneinch
\newcount\eighthalfinch
\newcount\teninch
\newcount\eleveninch
\newcount\xworka        % hi
\newcount\yworka        %   lf
\newcount\xworkb        %     sv
\newcount\yworkb        %       ar
\newcount\xworkz        %         ia
\newcount\yworkz        %           bl
\newcount\xworkv        %             en
\newcount\yworkv        %               !!
%
%
% Constants
%
\oneinch=72
\eighthalfinch=615
\teninch=723
\eleveninch=795
%
% Define the calculations macro
%
\def\layout{
%
% \newpage % neue seite
%
% Convert dimensions to scalar values
% for use in the picture environment
\hofset=\hoffset
  \divide\hofset by 65536
\hofref=\hofset
\advance\hofset by \oneinch
\vofset=\voffset
  \divide\vofset by 65536
\vofref=\vofset
\vofset=\teninch
  \advance\vofset by -\vofref
%
\tmargin=\topmargin
  \divide\tmargin   by 65536
%
\hheight=\headheight
  \divide\hheight   by 65536
\headref=\teninch
  \advance\headref by -\vofref
\advance\headref by -\tmargin
  \advance\headref by -\hheight
%
\hsep=\headsep
  \divide\hsep      by 65536
%
\theight=\textheight
  \divide\theight   by 65536
\bodyref=\headref
  \advance\bodyref by -\hsep
  \advance\bodyref by -\theight
%
\fskip=\footskip
  \divide\fskip     by 65536
%
\fheight=\footheight
  \divide\fheight   by 65536
\footref=\bodyref
  \advance\footref by -\fskip
%
\omargin=\oddsidemargin
  \divide\omargin   by 65536
%\omarginref=\omargin
  \advance\omarginref by \oneinch
%\advance\omarginref by \hofref
%
\emargin=\evensidemargin
  \divide\emargin   by 65536
%\emarginref=\emargin
  \advance\emarginref by \oneinch
%\advance\emarginref by \hofset
%
\twidth=\textwidth
  \divide\twidth    by 65536
%
\mparsep=\marginparsep
  \divide\mparsep   by 65536
%
\mparwidth=\marginparwidth
  \divide\mparwidth   by 65536
%
\if@twoside
    \ifodd\count\z@
%
%Twosided, odd page
%
  \typeout{Two-sided document
    style, odd page.}
  \margnoteref=\oneinch
    \advance\margnoteref by \hofref
  \advance\margnoteref by \omargin
  \marginref\margnoteref
  \advance\margnoteref by \twidth
  \advance\margnoteref by \mparsep
 
    \else
%
% Twosided, even page
%
  \typeout{Two-sided document
    style, even page.}
  \margnoteref=\oneinch
    \advance\margnoteref by \hofref
  \advance\margnoteref by \emargin
  \marginref\margnoteref
  \advance\margnoteref by -\mparsep
  \advance\margnoteref by -\mparwidth
 
    \fi
\else
%
% Not twosided, do odd page
%
\typeout{One-sided document style.}
\margnoteref=\oneinch
  \advance\margnoteref by \hofref
\advance\margnoteref by \omargin
\marginref\margnoteref
\advance\margnoteref by \twidth
\advance\margnoteref by \mparsep
\fi
Gestrichelte Linien sollen
{\tt \bs hoffset} und
{\tt \bs voffset} verdeutlichen.
 
\medskip 
%
%
%Define the picture to be drawn
\setlength{\unitlength}{.5pt}
\begin{picture}(\eighthalfinch,\eleveninch)
\centering
\thicklines
%
% Pagebox and reference lines
%
\put(0,0){\framebox(\eighthalfinch,\eleveninch){\mbox{}}}
\put(0,\vofset){\dashbox{10}(\eighthalfinch,0){\mbox{}}}
\put(\hofset,0){\dashbox{10}(0,\eleveninch){\mbox{}}}
%
% Header 
%
\put(\marginref,\headref){\framebox
  (\twidth,\hheight){\footnotesize Header}}
%
% Body
%
\put(\marginref,\bodyref){\framebox
  (\twidth,\theight){Body}}
%
% zeichne \textwidth
\thinlines
\xworkz = \twidth                       % berechne die...
\divide\xworkz by 2                     % x-koordinate des...
\advance\xworkz by \marginref           % pfeilzentrums
\yworkz = \bodyref                      % pfeil liegt 25 pt ueber..
\advance\yworkz by 50                   % dem unteren ende der body-box
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 8}}
\xworkv = \twidth                       % berechne die...
\divide\xworkv by 2                     % laenge des..
\advance\xworkv by -10                  % pfeils
\advance\xworkz by -10                  % pfeilanfang
\put(\xworkz,\yworkz){\vector(-1,0){\xworkv}}
\advance\xworkz by 20                   % pfeilanfang
\put(\xworkz,\yworkz){\vector(+1,0){\xworkv}}
%
% zeichne \textheight
\yworkz = \theight                      % berechne die...
\divide\yworkz by 2                     % y-koordinate des...
\advance\yworkz by \bodyref             % pfeilzentrums
\xworkz = \marginref                    % pfeil teilt die box im..
\xworka = \twidth                       % verhaeltnis..
\divide\xworka by 5                     % 1:4
\advance\xworkz by \twidth              %
\advance\xworkz by -\xworka             %
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 7}}
\yworkv = \theight                      % berechne die...
\divide\yworkv by 2                     % laenge des..
\advance\yworkv by -10                  % pfeils
\advance\yworkz by -10                  % pfeilanfang
\put(\xworkz,\yworkz){\vector(0,-1){\yworkv}}
\advance\yworkz by 20                   % pfeilanfang
\put(\xworkz,\yworkz){\vector(0,+1){\yworkv}}
%
%
% zeichne \hoffset
\yworkz = \footref                      % y-koordinate des pfeilzentrums
\xworkz = \hofset                       % berechne die x-koordinate..
\divide\xworkz by 2                     % des pfeilzentrums
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 1}}
\xworkv = \hofset                       % berechne die...
\divide\xworkv by 2                     % laenge des..
\advance\xworkv by -10                  % pfeils
\advance\xworkz by -10                  % pfeilanfang
\put(\xworkz,\yworkz){\vector(-1,0){\xworkv}}
\advance\xworkz by 20                   % pfeilanfang
\put(\xworkz,\yworkz){\vector(+1,0){\xworkv}}
%
%
% zeichne \oddsidemargin bzw. \evensidemargin
\advance\yworkz by \fheight             % y-koordinate
\xworkz = \marginref                    % berechne die..
\advance\xworkz by \hofset              % x-koordinate
\divide\xworkz by 2                     % des pfeilzentrums
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 3}}
\xworkv = \marginref                    % berechne..
\advance\xworkv by -\hofset             % die..
\divide\xworkv by 2                     % pfeil-..
\advance\xworkv by -10                  % laenge
\advance\xworkz by -10                  % pfeilanfang
\put(\xworkz,\yworkz){\vector(-1,0){\xworkv}}
\advance\xworkz by 20                   % pfeilanfang
\put(\xworkz,\yworkz){\vector(+1,0){\xworkv}}
%
%
% zeichne \marginparwidth
\yworkz = \theight                      % berechne die..
\divide \yworkz by 4                    % y-koordinate..
\advance\yworkz by \bodyref             % des pfeilzentrums
\xworkz = \mparwidth                    % berechne die..
\divide \xworkz by 2                    % x-koordinate..
\advance\xworkz by \margnoteref         % des pfeilzentrums
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 10}}
\xworkv = \mparwidth                    % berechne die..
\divide\xworkv by 2                     % pfeil-..
\advance\xworkv by -10                  % laenge
\advance\xworkz by -10                  % pfeilanfang
\put(\xworkz,\yworkz){\vector(-1,0){\xworkv}}
\advance\xworkz by 20                   % pfeilanfang
\put(\xworkz,\yworkz){\vector(+1,0){\xworkv}}
%
%
% zeichne \marginparsep
\advance\yworkz by 30                   % y-koordinate
%
\if@twoside
    \ifodd\count\z@
%
%Twosided, odd page
%
    \xworkz = \margnoteref                  % pfeilanfang..
    \advance\xworkz by 20                   % rechts
    \put(\xworkz,\yworkz){\vector(-1,0){20}}% pfeil
    \advance\xworkz by 10                   % pfeilzentrum
    \put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
    \put(\xworkz,\yworkz){\makebox(0,0){\tiny 9}}
    \xworkz = \margnoteref                  % pfeilanfang..
    \advance\xworkz by -\mparsep            % links..
    \advance\xworkz by -20                  % berechnen
    \put(\xworkz,\yworkz){\vector(+1,0){20}}% pfeil
        \else
%
% Twosided, even page
%
    \xworkz = \marginref                    % pfeilanfang..
    \advance\xworkz by 20                   % rechts
    \put(\xworkz,\yworkz){\vector(-1,0){20}}% pfeil
    \advance\xworkz by 10                   % pfeilzentrum
    \put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
    \put(\xworkz,\yworkz){\makebox(0,0){\tiny 9}}
    \xworkz = \marginref                    % pfeilanfang..
    \advance\xworkz by -\mparsep            % links..
    \advance\xworkz by -20                  % berechnen
    \put(\xworkz,\yworkz){\vector(+1,0){20}}% pfeil
    \fi
\else
%
% Not twosided, do odd page
%
\xworkz = \margnoteref                  % pfeilanfang..
\advance\xworkz by 20                   % rechts
\put(\xworkz,\yworkz){\vector(-1,0){20}}% pfeil
\advance\xworkz by 10                   % pfeilzentrum
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 9}}
\xworkz = \margnoteref                  % pfeilanfang..
\advance\xworkz by -\mparsep            % links..
\advance\xworkz by -20                  % berechnen
\put(\xworkz,\yworkz){\vector(+1,0){20}}% pfeil
\fi
%
%
% zeichne \footskip
\xworka = \twidth
\divide\xworka by 8
\xworkz = \marginref                    % berechne die...
\advance\xworkz by \xworka              % x-koordinate des pfeilzentrums
\yworkz = \footref                      % zeichne..
\advance\yworkz by -20                  % unteren..
\put(\xworkz,\yworkz){\vector(0,+1){20}}% pfeil
\advance\yworkz by -10                  %
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 11}}
\yworkz = \bodyref                      % zeichne..
\advance\yworkz by 20                   % oberen..
\put(\xworkz,\yworkz){\vector(0,-1){20}}% pfeil
%
%
% zeichne \footheight
\advance\xworkz by \xworka              % x-koordinate des pfeilzentrums
\yworkz = \footref                      % zeichne..
\advance\yworkz by -20                  % unteren..
\put(\xworkz,\yworkz){\vector(0,+1){20}}% pfeil
\advance\yworkz by -10                  %
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 12}}
\yworkz = \footref                      % zeichne..
\advance\yworkz by \fheight             % den..
\advance\yworkz by 20                   % oberen..
\put(\xworkz,\yworkz){\vector(0,-1){20}}% pfeil
%
%
% zeichne \voffset
\xworkz = \eighthalfinch                % x-koordinate des
\advance\xworkz by -50                  % pfeilzentrums
\yworkz = \eleveninch                   % berechne..
\yworkv = \eleveninch                   % die..
\advance\yworkz by \vofset              % y-koordinate..
\divide\yworkz by 2                     % des pfeilzentrums..
\yworka = \yworkz                       % und..
\advance\yworkv by -\vofset             % die..
\divide\yworkv by 2                     % laenge des..
\advance\yworkv by -10                  % pfeils
\put(\xworkz,\yworkz){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworkz){\makebox(0,0){\tiny 2}}
\advance\yworkz by -10                  % pfeilanfang
\put(\xworkz,\yworkz){\vector(0,-1){\yworkv}}
\advance\yworkz by 20                   % pfeilanfang
\put(\xworkz,\yworkz){\vector(0,+1){\yworkv}}
%
%
% zeichne \topmargin, headheight, headsep
\xworka = \twidth                       % berechne die
\divide\xworka by 8                     % x-schrittweite
\xworkz = \marginref                    %
\advance\xworkz by \xworka              % x-koordinate des pfeilzentrums
\put(\xworkz,\yworka){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworka){\makebox(0,0){\tiny 4}}
\advance\xworkz by \xworka              % x-koordinate des pfeilzentrums
\put(\xworkz,\yworka){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworka){\makebox(0,0){\tiny 5}}
\advance\xworkz by \xworka              % x-koordinate des pfeilzentrums
\put(\xworkz,\yworka){\circle{20}}      % erzeuge einen kringel..
\put(\xworkz,\yworka){\makebox(0,0){\tiny 6}}
\advance\yworka by -10                  % verschiebe..
\xworkz = \marginref                    % den pfeil-..
\advance\xworkz by \xworka              % anfangspunkt
\yworkv = \yworka
\advance\yworkv by -\vofset
\put(\xworkz,\yworka){\vector(0,-1){\yworkv}}
\advance\xworkz by \xworka              % anfangspunkt
\yworkv = \yworka
\advance\yworkv by -\headref
\advance\yworkv by -\hheight
\put(\xworkz,\yworka){\vector(0,-1){\yworkv}}
%
\advance\xworkz by \xworka              % anfangspunkt
\advance\yworkv by \hheight
\put(\xworkz,\yworka){\vector(0,-1){\yworkv}}
%
%
\xworkz = \marginref                    % definiere x-..
\advance\xworkz by \xworka              % anfangspunkt
\yworkv = \headref
\advance\yworkv by \hheight
\advance\yworkv by -20
\put(\xworkz,\yworkv){\vector(0,+1){20}}
%
\advance\xworkz by \xworka              % anfangspunkt
\yworkv = \headref
\advance\yworkv by -20
\put(\xworkz,\yworkv){\vector(0,+1){20}}
%
\advance\xworkz by \xworka              % anfangspunkt
\yworkv = \headref
\advance\yworkv by -20
\advance\yworkv by -\hsep
\put(\xworkz,\yworkv){\vector(0,+1){20}}
%
%
%
\thicklines
% Footer 
%
\put(\marginref,\footref){\framebox
  (\twidth,\fheight){\footnotesize Footer}}
%
% Marginal notes
%
\put(\margnoteref,\bodyref){\framebox
  (\mparwidth,\theight)%
{\footnotesize
\shortstack{Margin\\Notes}}}
%
\end{picture}
 
\medskip 
%
% Display the settings used to make
% the picture.   Note: fractional
% points are truncated, i.e.,
% 72.27pt is displayed as 72pt
%
{\tt
\begin{tabular}{l@{\hspace{20pt}}l}
1 \bs hoffset = \number\hofref pt &
2 \bs voffset = \number\vofref pt \\
  \typeout{hoffset = \number\hofref  pt}
  \typeout{voffset = \number\vofref  pt}
3 \bs
   \if@twoside
     \ifodd\count\z@ oddsidemargin
     \else evensidemargin
     \fi 
   \else oddsidemargin
   \fi
= \number
   \if@twoside
     \ifodd\count\z@ \omargin
     \else \emargin
     \fi 
   \else \omargin
   \fi
pt & 4 \bs topmargin = \number\tmargin pt \\
5 \bs headheight = \number\hheight pt &
  6 \bs headsep = \number\hsep pt \\
  \typeout{textheight = \number\theight  pt}
  \typeout{textwidth  = \number\twidth  pt}
7 \bs textheight = \number\theight pt &
  8 \bs textwidth = \number\twidth pt \\
9 \bs marginparsep = \number\mparsep pt &
10 \bs marginparwidth = \number\mparwidth pt \\
11 \bs footskip = \number\fskip pt &
12 \bs footheight = \number\fheight pt \\ [10pt]
\multicolumn{2}{c}{72pt $\approx$ 1 inch = 2.54 cm}
\end{tabular}}
%
\newpage % neue seite
%
}  % end of \def\layout