summaryrefslogtreecommitdiff
path: root/info/laan/pwt/pwt.cus
blob: 2e713ac06e24a8946f941c2b43e213300c2a5c39 (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
\input blue.tex \loadindexmacros \report

\bluepictures\bluepagepic

\bluechapter Customization

\beginsummary
Adaptation of BLUe's format with respect to the look-and-feel
has been discussed, i.e., adapting
the page size, 
the headlines and footlines,
and the various headings.
Transformation of a BLUe script into a MAPS submission 
has been touched upon.
At the end a quick look  has been given
into the Pandora box of processing
scripts in other languages.  
\endsummary

The first thing to do is to personalize the format. Make yourself known.
In order to do so look in the file \bluetex{} for the comment line that
starts with |%Personalization|, and adjust what follows.

Customization comes down to adapting \TeX's and \bluetex's parameters.
The big deal of ^{customization} is to adapt BLUe's format for processing 
scripts in your language. 
Apart from trivia this is beyond the scope of this guide.

\bluehead Changing the look-and-feel

Much of the ^{look-and-feel} is determined by 
the page size, 
the headline and footline, 
the section beginnings,
and the opening part.


\bluesubhead Adapting the page size

A page is composed of the page proper block, 
$\cs{pagewd}{\times}\cs{vsize}$, preceded by the headline 
and followed by the footline. 
^|\hsize| is the width of a column. 
^|\vsize| is the length of a column with footnotes included.\ftn{The
   length of the page can actually become a little shorter or longer
   because of the depth of the last box.} 
Customization of the page dimensions can be done by adapting 
|\A4|.\ftn{Customization of the
   page composition is beyond the scope of this guide
   and requires knowledge of the output routine. ^|\A5|, or other sizes,
   can be added.}
^|\twocol| has been included below, along with the picture ^|\bluepagepic|. 
^^|\onecol|

\blueexample Page layout, and two-column settings

{\gutter6em
\begindemo
\def\twocol{\maxcols=2 \xcol=1
    \onecolfalse\A4
    \hyphenchar\tentt='055
    \hyphenchar\ninett='055
    \hyphenchar\eighttt='055
    \tolerance500
    \hbadness=499
    \hfuzz=5pt
}
!yields
\bluepagepic
\enddemo}
Names are inherited from \TUB's output routine.
^|\xcol| denotes the number of the actual column. 
The value of the ^|\hyphenchar|
allows hyphenation for words in those fonts. 
The tolerance and badnesses are set to circumvent superfluous messages, 
at the expense of less optimum results.\ftn{For the pragmatic approach
   of getting rid of overfull boxes, I'm much indepted to Phil Taylor.}

^|\hoffset| and ^|\voffset|, the offsets
of the left upper corner of the page to the boundary of the paper,
are both {\oldstyle1}\thinspace cm less than plain's 
default of {\oldstyle1}\thinspace in.

^|\A4| reads as follows.
\beginverbatim
\def\A#1{\csname A#1\endcsname}
\ea\def\A4{\ifonecol\hsize16cm\pagewd\hsize
  \else\hsize9cm\intercolwd.5cm
       \pagewd\hsize\advance\pagewd\hsize\advance\pagewd\intercolwd
  \fi\colwd\hsize \vsize25cm}
!endverbatim

\thissubhead{\runintrue}
\bluesubhead The header and footer\par are generated from the 
   token variables \cs{headline}, and \cs{footline}.
   Default they read as follows.

\blueexample Default headline and footline code

\begincenterverbatim
\headline={\hbox to\pagewd{\it\the\issue\hfill\the\title}}
%
\footline={\hbox to\pagewd{\fiverm\rlap{Draft \today}\hfill
   \dash\the\pagenumber\dash\hfill\llap{\copyright cgl}}}
!endcenterverbatim
An extra dimension ^|\pagewd| is needed
in order to have a quantity independent of the number of columns. 
\exercise What are the ^|\headline| and ^|\footline| for \cs{report}?
\answer The regular headlines and footlines are as above with a few 
        elements altered.
        However, there is a complication in the sense that 
        the headline is suppressed for the first page
        of the chapter. This is handled in  \cs{postchapterhead}.
        Consult the formatbase, especially the report format.

\exercise How can we use the \cs{headline} for transparencies?
\answer Similar to the running head of a book the headline\Dash well, the header
        part\Dash can be put in a headline with contextual information 
        dynamically coupled. See the formatbase, especially the transparencies
        format.

\exercise In a book the footline contains usually the page number away from
        the back, that is, right on right-hand pages and left on left-hand
        pages. How can we achieve this?
\answer Provide 
\beginverbatim
\footline{\hbox to\pagewd{\ifodd\pageno\null\hfill\fi\number\pageno\hfil}}
!endverbatim


\bluesubhead Title part

The markup of the beginning\Dash title part\Dash 
and the markup of the end\Dash closing part\Dash
of a regular BLUe script are implemented as follows.

\blueexample Beginscript and endscript code

^^|\beginscript|  %^^|\endscript|
^^|\beginkeywords|%^^|\endkeywords|
^^|\beginabstract|%^^|\endabstract|
^^|\begincontents|%^^|\endcontents|
\thisverbatim{\catcode`\!=12 \catcode`\*=0 }
\beginverbatim
\def\beginscript{\lastscript\the\everyscript\begingroup
   \the\thisscript
   \hrule\kern2ex\noindent
   {\titlefont\the\title}\if!\the\subtitle!\else
   {\subtitlefont\the\subtitle}\fi
   \medskip\the\author
   \medskip\pasteupkeywords
   \medskip\pasteupabstract
   \medbreak\pasteupcontents\smallbreak}

\def\endscript{\makesignature\xcol=\maxcols \vfil\eject\endgroup
   \tracingstats1\stop\thisscript{}}
%with at the lower level
\def\beginkeywords{\setbox\keywordsbox\vbox\bgroup\subhead{\sevenbf
   \the\keywordsname: }\small}
\def\endkeywords{\egroup}

\def\beginabstract{\setbox\abstractbox\vbox\bgroup\centerline{\sevenbf
   \the\abstractname}\beginquote\small}
\def\endabstract{\endquote\egroup}

\def\begincontents{\setbox\contentsbox\vbox\bgroup\small\noindent
   \the\contentsname\par\obeylines}
\def\endcontents{\egroup}

\def\pasteupkeywords{\box\keywordsbox}
\def\pasteupabstract{\box\abstractbox}
\def\pasteupcontents{\unvbox\contentsbox}
*endverbatim

Customization can be done by changing the above.
I have omitted the macros, which allow the use |\<tag>{...}|,
the short variant.
Whatever your change of |\begin<tag>| or |\end<tag>|,
the short variant |\<tag>{...}| remains invariant, that is,
complies automatically with your change.\ftn{Consult the paper 
   `Paradigms: Two-part macros' for the explanation.}
\exercise How can we suppress the author information at 
          the end of the document?
\answer Let \cs{makesignature} equal to \cs{relax}.

%end answer
\exercise Enumerate the token variables which
          contain language-dependent names.
\answer The token variables |\<tag>name|:
        \cs{abstractname},
        \cs{keywordsname},
        \cs{contentsname}.
        
%end answer
\exercise How can we obtain ^{Roman\ numerals} as page numbers? ^^|\folio|
\answer The control sequence to obtain Roman numerals is \cs{romannumeral}.
        In plain \TeX{} Roman numerals are obtained automatically for 
        page numbers when \cs{folio} is used instead of \cs{pageno} provided
        the number is negative.
        From \TB{} 252, 362 the following.
\thisverbatim{\unmc}
\beginverbatim
\def\folio{\ifnum\pageno<0 \romannumeral-\pageno
           \else\number\pageno \fi}
!endverbatim
See also page 40 and  41 of \TB, especially when uppercase
roman numerals are needed. 
In \bluetex{} I introduced the token variable |\pagenumber{\folio}|. 

%end answer
\exercise How can we suppress the headline on the first page?
\answer This is a very common \TeX ing paradigm. The idea is  
        to redefine the responsible control sequence in such a way that  
        on first invocation the only action is to define itself by the
        regular replacement text. For example in the report format,
        in order to suppress the headline on the first page of each chapter, 
        I defined \cs{headline} in \cs{postchapter} as follows.
\beginverbatim
\postchapterhead={\vskip3pc\headno=0 \exno=0 \exano=0 
   \headline={\global\headline={\hbox to\pagewd
    {\sevenrm\the\chaptername\hfill\it\the\title}}}}
!endverbatim

%end answer
\exercise How come that more than one script can be formatted
          despite \cs{stop} in \cs{endscript}?
\answer The explanation is in the definition of \cs{notlastscript}
        and \cs{lastscript}, which read as follows.
\beginverbatim
\def\notlastscript{\let\stop\relax}
\def\lastscript{\let\stop\end}
!endverbatim

%end answer
For parameters which govern special constructs, such as
the shape of paragraphs, items, tables, or \dots\thinspace, 
see the chapters on the issue.

\bluesubhead Section beginnings

^|\head| can be customized by adaptation of the parameters
^|\prehead| and ^|\posthead|, to position the head within context.
^|\ignorewhitespace| does what its name suggests.\ftn{It
    gobbles white space after \cs{beginhead} up to the head title.}
The font used is parameterized in ^|\headfont|. 

\blueexample Head code

\begincenterverbatim
\prehead{\vskip0pt plus5ex\penalty-250\vskip0pt plus1ex
   \bigskip\noindent}
\posthead{\medskip\nobreak\noindent\ignorewhitespace}
\def\beginhead{\the\prehead\bgroup\headfont}
\def\endhead{\egroup\the\posthead}
!endcenterverbatim
\cs{subhead} and \cs{subsubhead} are constructed similarly.

\exercise How can we ^{center\ heading}s?
\answer It looks like to extend \cs{prehead} and \cs{posthead}, 
        something like
\beginverbatim
\prehead\ea{\the\prehead\centerline\bgroup}
\posthead\ea{\ea\egroup\theposthead}
!endverbatim
However, this does not work\Dash explain why the head flushes right\Dash
because we can't use \cs{bgroup} and \cs{egroup} to enclose an argument. 
A solution is to append \cs{hfil} to \cs{prehead} as follows.
\beginverbatim
\prehead\ea{\the\prehead\hfil}
!endverbatim

%end answer

\bluesubhead Raster layout and \TeX

As Nico Temme communicated to me publishers require sometimes
fixed white space between headings and the surrounding text.
How to achieve this?
Naively this looks simple, just provide \cs{prehead} and \cs{posthead}
with the fixed skips. 
The problem is, however, that \TeX{} likes some freeway
to shrink or stretch a little.

\bluehead BLUe script into MAPS submission

^^{BLUe\ script\ into\ MAPS}
In principle this is not too laborious, because only a handful of
outer-level control sequences need adaptation.\ftn{In general
   transformation is very complex and confusing,
   for example if we also consider automatic generation of an index.
   It is next to impossible to do this automatically.
   When submissions to (various) journals are
   in sight, keep the markup as simple as possible.
   And why not stick to simplicity as a rule?} 

MAPS.sty is \LaTeX{} biased. 
To give you an impression of the amount of work 
a template for a MAPS submission and a transformation table is
given below.\ftn{I don't use 
   times fonts, 
   don't use Babel (no dutch.sty, nor english.sty),  
   no fancyheadings are involved,
   don't need
   Mittelbach's multicolumn, nor Sch\"opf's verbatim facilities,
   and the like. 
   Until today MAPS has used \LaTeX{\oldstyle2}.{\oldstyle09}.
   Minimal markup tags have been neglected.}
Because BLUe's format is a personalized format you have to add
|\author{...}| and the like.

Globals deserve special attention, because they might
interfere with other submissions. 
%The MAPS style is not of an active type, and    %in the sense of an active 
%therefore retrograde adaptations are needed.    %document. (cgl)

The title block is filled in or simply reused
from the template. No problem at all.
A table of contents can be moved to the back part. 

I fell back upon 
\LaTeX's bibliography handling.\ftn{Nowadays, I tend to omit the
    references in a MAPS submission, and refer to my database
    lit.dat.} 
My use of so-called `run-in' heads requires special attention.\ftn{The 
    (sub)subhead title is part of the first sentence of the section.}
Important is that \bluetex's verbatim suite, tables and pictures
can be reused as such, similar to plain's math constructs.
For other things like my way of citation\Dash |<author>|, |<year>|\Dash
no adaptation is needed.


\blueexample BLUe script into MAPS submission

\begindemo
%Template for MAPS submissions
\documentstyle[twocolumn]{maps}                                 
\begin{document}                                                 
\title{...}
\subtitle{...}                                                   
\author{...}                                                  
\date{}                                                       
\maketitle                                                   

\begin{abstract}...\end{abstract}
\begin{keywords}...\end{keywords}
%Contents table
%Copy proper
\head{...}%et cetera
%back matter, LaTeX's
\begin{thebibliography}{abcde}
...
\end{thebibliography}
\end{document}                                                
!yields
\small\def\rowstblst{}
\def\x{\lower1ex\null}
\vruled\fll\def\colsep{$\longrightarrow$}
\def\btablecaption{} \def\footer{}
\def\header{BLUe script\cs MAPS.sty script}
\beginbtable
$\vcenter{\hbox{\tstrut|\begin|}
          \hbox{|\end|\x}}$\ abstract  
    \cs$\vcenter{\hbox{|\begin{abstract}|\tstrut}
                 \hbox{|\end{abstract}|\x}}$\rs
$\vcenter{\hbox{|\begin|\tstrut}
          \hbox{|\end|\x}}$\ keywords   
    \cs$\vcenter{\hbox{|\begin{keywords}|\tstrut}
                 \hbox{|\end{keywords}|\x}}$\rs
|\beginscript|     \cs|\begin{bijlage}| \rs
|\head|       \cs|\let\head\section|\rs
$\vcenter{\hbox{|\bitem|}
          \hbox{\raise2ex\null\lower1ex\null\dots}
          \hbox{|\bitem|\x}
          \hbox{|\smallbreak|}}$
    \cs$\vcenter{\hbox{|\begin{itemize}|\tstrut}
	                      \hbox{|\item...|\strut}
                       \hbox{|\item...|\strut}                      
                       \hbox{|\end{itemize}|\x}}$\rs
$\vcenter{\hbox{\tstrut|\begin|}
          \hbox{|\end|\x}}$\ quote  
    \cs$\vcenter{\hbox{|\begin{quote}|\tstrut}
                 \hbox{|\end{quote}|\x}}$\rs
|\ftn|       \cs|\footnote|\rs
$\vcenter{\hbox{|\begin|\tstrut}
         \hbox{|<escape char>end|\x}}$\ verbatim
       \cs$\vcenter{\hbox{|\begin{verbatim}|\tstrut}
                    \hbox{|\end{verbatim}|\x}}$\rs
|\endscript|  \cs$\vcenter{\hbox{\tstrut
                       |\end{bijlage}|}
              \hbox{|\end{document}|\x}}$
\endbtable
\enddemo
^^{BLUeto you-name-it}
In general the mapping of a BLUe script into a you-name-it script
is near to impossible to automate completely, because of the
incompatibilities.
As far as I know\ftn{As of {\oldstyle1995}}
BLUe's format is the only formatting \TeX-like system
which has embraced the database idea at large, 
has provided macros for `Turtle graphics.' and which
can produce indexes on the fly.

However, when BLUe's format will be adopted by publishers
the conversion problem is no longer there, because the publisher
might issue the default as a ^{preprint format},
with result that authors and publishers use the same markup tags,
while the formatted result is in agreement with the context, because
the publisher can best customize the various replacement texts
to their wishes.
As usual a hard \TeX nical problem can be 
solved more elegantly non-\TeX nically. 

\bluehead Other languages

The Pandora box of customization is to tailor BLUe's format 
towards processing scripts in your language. 
Knuth adapted \TeX{} in {\oldstyle1989},
and provided \cs{language} to handle hyphenation  per language,
and smarter ligatures, if I'm not mistaken. 
The trivia for adaptation are changing the  names
for document parts, like `Abstract, Keywords,' and similar things.
In BLUe's format the latter are parameterized in token variables.

More complicated is creating an index on-the-fly in your language via 
BLUe's format.\ftn{For the time being this is open.
   The language-dependent ordering of letters has been parameterized
   in an ordering table though.}

An interesting application of formatting simultaneously two (or more)
languages is: two-column, with each column devoted to a language. 
That is beyond the scope of this guide.
\endinput