1
2
3
4
5
6
7
8
9
10\startmodule[tugboatcolumns]
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\enablemode[tugboat]
44
45
46
47\enabletrackers[builders.hpack.quality]
48\enabletrackers[builders.hpack.collect]
49\enabletrackers[builders.hpack.overflow]
50
51
52
53
54\setvariables
55 [tugboat]
56 [type=article,
57
58 year=1900,
59 volume=0,
60 number=0,
61 page=1001,
62
63 title=ConTeXt style for TUGboat,
64 subtitle=,
65 keywords=,
66 author=T. Boat,
67 address={Harbour Master KB \\ Harbour St. 1 \\ 8061XX Hasselt NL},
68 email={tugboat@tug.org}]
69
70
71
72
73
74
75
76\definebodyfontenvironment [8pt] [interlinespace=9.5pt, big=9pt, small=7pt]
77\definebodyfontenvironment [9pt] [interlinespace=11pt, big=10pt, small=8pt]
78\definebodyfontenvironment [10pt] [interlinespace=12pt, big=12pt, small=9pt]
79\definebodyfontenvironment [12pt] [interlinespace=14pt, big=14.4pt,small=10pt]
80\definebodyfontenvironment [14.4pt] [interlinespace=18pt, big=14.4pt,small=12pt]
81
82
83
84\setupbodyfontenvironment
85 [default]
86 [em=italic]
87
88
89
90
91\setupbodyfont
92 [10pt]
93
94
95
96\sethyphenatedurlafter
97\sethyphenatedurlafter .
98\sethyphenatedurlafter
99
100
101
102
103
104\setuppapersize
105 [letter]
106 [letter]
107
108\setuplayout
109 [topspace=3.8pc,
110 header=1pc,
111 headerdistance=1.5pc,
112 height=middle,
113 footerdistance=2pc,
114 footer=1pc,
115 bottomspace=3pc,
116
117 backspace=6pc,
118 width=middle,
119 cutspace=6pc,
120
121 margin=4pc,
122 margindistance=1pc]
123
124
125
126
127
128
129
130
131
132
133
134
135\setuppagecolumns
136 [n=2,
137 distance=1.5pc]
138
139\setuppagenumbering
140 [location=,
141 alternative=doublesided]
142
143
144
145
146
147
148\installpagebreakhandler {last} {}
149
150
151
152
153
154
155\setupindenting
156 [20pt,yes]
157
158
159
160\setupenumerations [indentnext=no]
161\setupdescriptions [indentnext=no]
162
163
164
165\setupitemgroup
166 [itemize]
167 [indentnext=no,
168 align=right]
169
170
171
172\setupitemgroup
173 [itemize]
174 [each]
175 [margin=1pc,
176 width=1em,
177 distance=0pt]
178
179\setupitemgroup
180 [itemize]
181 [1]
182 [packed]
183
184
185
186
187
188
189
190\startsetups align:pass:quality:1
191\parpasses 6
192 classes \indecentparpassclasses
193 threshold 0.025pt
194 tolerance 250
195 extrahyphenpenalty 50
196 orphanpenalty 5000
197
198 next ifadjustspacing
199 threshold 0.025pt
200 classes \tightparpassclasses
201 tolerance 300
202 adjustspacing 3
203 orphanpenalty 5000
204 next ifadjustspacing
205 threshold 0.025pt
206 tolerance 350
207 adjustspacing 3
208 adjustspacingstep 1
209 adjustspacingshrink 20
210 adjustspacingstretch 40
211 orphanpenalty 5000
212 emergencystretch .25\bodyfontsize
213
214 next
215 threshold 0.025pt
216 classes \tightparpassclasses
217 tolerance 300
218 adjustspacing 3
219 adjustspacingstep 1
220 adjustspacingshrink 10
221 adjustspacingstretch 15
222 orphanpenalty 5000
223 next
224 threshold 0.025pt
225 tolerance 350
226 adjustspacing 3
227 adjustspacingstep 1
228 adjustspacingshrink 20
229 adjustspacingstretch 40
230 orphanpenalty 5000
231 emergencystretch .25\bodyfontsize
232
233 next
234 threshold 0.025pt
235 tolerance 3000
236 orphanpenalty 5000
237 emergencystretch .25\bodyfontsize
238\relax\stopsetups
239
240\setupalignpass[quality:1]
241
242
243
244
245\setuplayout
246 [limitstretch=yes]
247
248\setuplayout
249 [vz=2]
250
251\setupalign
252 [depth]
253
254
255
256
257
258
259\definevspacingamount[tugbeforesection] [8pt plus 1pt minus 1pt][\lineheight]
260\definevspacingamount[tugaftersection] [4pt plus 1pt minus 1pt][.5\lineheight]
261
262\setuphead
263 [section,subsection,subsubsection,
264 subject,subsubject,subsubsubject]
265 [style=bold,
266 align=right,
267 before={\blank[tugbeforesection]},
268 after={\blank[tugaftersection]}]
269
270
271
272
273\definevspacingamount[tugsmallamount] [3pt plus 1pt minus 1pt][.5\lineheight]
274\definevspacingamount[tugmediumamount][9pt plus 3pt minus 3pt][.5\lineheight]
275\definevspacingamount[tuglargeamount] [10pt plus 4pt minus 4pt][\lineheight]
276
277\defineblank[tugblank] [tugsmallamount]
278\defineblank[tugsmall] [tugsmallamount]
279\defineblank[tugmedium][tugmediumamount]
280\defineblank[tuglarge] [tuglargeamount]
281\defineblank[tughalf] [halfline]
282
283\setupblank
284 [tugblank]
285
286\setupitemize
287 [1]
288 [before={\blank[tugblank]},
289 after={\blank[tugblank]},
290 inbetween={\blank[tugblank]}]
291
292\setuplines
293 [before={\blank[tugblank]},
294 after={\blank[tugblank]},
295 inbetween={\blank[tugblank]}]
296
297
298
299\setuplinecorrection
300 [before={\blank[tugblank]},
301 after={\blank[tugblank]}]
302
303
304
305
306
307
308\definefontfile[moderncondensed][moderncondensed]
309
310\definetypeface
311 [narrowtt] [tt]
312 [mono] [moderncondensed] [default] [features=none]
313
314\definefont[TugBoatVerbatimFont][Mono*none sa .9]
315
316\setuptyping
317 [option=none,
318 align=hangright,
319 style=narrowtt,
320 before={\blank[tugblank]},
321 after={\blank[tugblank]}]
322
323
324
325\startsetups[tugboat:verbatim:tight]
326 \setuptyping
327 [style=TugBoatVerbatimFont,
328 bodyfont=9pt,
329 blank=halfline,
330 lines=hyphenated]
331\stopsetups
332
333
334
335\setuptyping[LUA][option=]
336\setuptyping[TEX][option=]
337\setuptyping[MP] [option=]
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\protected\def\MyFootNoteRule
367 {\hrule width 5pc height .4pt depth 0pt\relax \kern \strutdepth}
368
369\setupfootnotes
370
371 [bodyfont=9pt,
372 location=columns,
373 rule=on,
374 rulecommand=\MyFootNoteRule]
375
376
377
378
379\setupnotations
380 [location=joinedup,
381 width=fit,
382 headstyle=normal,
383 distance=.5em]
384
385
386
387\definedescription
388 [description]
389 [location=hanging,
390 width=broad,
391 before={\blank[tugblank]},
392 after={\blank[tugblank]}]
393
394\defineenumeration
395 [enumeration]
396 [location=hanging,
397 width=broad,
398 before={\blank[tugblank]},
399 after={\blank[tugblank]}]
400
401
402
403
404\setuphead
405 [chapter]
406 [page=,
407 before=,
408 after=,
409 incrementnumber=no,
410 placehead=no]
411
412
413
414\setupbtx
415 [default:list:numbering]
416 [left={[},
417 right={]}]
418
419\setupbtxlist
420 [default]
421 [width=2em,
422 style={\frenchspacing},
423 align={raggedright,verystrict}]
424
425
426
427\setupcolors
428 [conversion=always]
429
430
431
432\mainlanguage
433 [en]
434
435
436
437\defineblank [tugbefore] [big]
438\defineblank [tuginbetween][big]
439\defineblank [tugafter] [tugbefore]
440
441
442
443\protected\def\StopAbstract
444 {}
445
446\protected\def\StartAbstract
447 {\dostartbuffer[abstract][StartAbstract][StopAbstract]}
448
449\startsetups tugboat:abstract:setup
450
451 \setuptolerance
452 [horizontal,tolerant]
453
454 \setupnarrower
455 [before={\blank[tughalf]},
456 after={\blank[tuglarge]},
457 middle=4.875pc]
458
459\stopsetups
460
461
462
463\startsetups tugboat:banner:text:article
464
465
466
467
468
469
470\stopsetups
471
472\def\postissno{Proceedings of the \tubyear\ Annual Meeting}
473
474\startsetups tugboat:banner:text:proceedings
475
476 \setups[tugboat:banner:text:article]
477 \thinspace\emdash\thinspace
478 \postissno
479
480\stopsetups
481
482\startsetups tugboat:banner:setup:article
483
484 \setupheadertexts
485 [\setups{tugboat:banner:text:article}]
486 [pagenumber]
487
488
489
490
491
492
493
494\stopsetups
495
496\startsetups tugboat:banner:setup:proceedings
497
498 \setupheadertexts
499 [][\getvariable{tugboat}{title}]
500 [\getvariable{tugboat}{author}][]
501
502 \setupfootertexts
503 [\setups{tugboat:banner:text:proceedings}]
504 [pagenumber]
505
506\stopsetups
507
508
509
510\setups[tugboat:banner:setup:article]
511
512
513
514\permanent\protected\def\StartArticle{\directsetup{tugboat:\getvariable{tugboat}{type}:start}}
515\permanent\protected\def\StopArticle {\directsetup{tugboat:article:stop}}
516
517\startsetups tugboat:introduction:article
518
519 \start
520 \enforced\protected\def\\{\unskip\space\&\space\ignorespaces}
521 \hbox{\indent\getvariable{tugboat}{author}}
522 \par
523 \stop
524
525\stopsetups
526
527\startsetups tugboat:introduction:proceedings
528
529 \blank[20pt]
530
531 \start
532 \switchtobodyfont[12pt]
533 \enforced\protected\def\\{\unskip\space\&\space\ignorespaces}
534 \getvariable{tugboat}{author}
535 \par
536 \stop
537
538 \start
539 \switchtobodyfont[9pt]
540 \enforced\protected\def\\{\unskip,\space\ignorespaces}
541 \getvariable{tugboat}{address}
542 \par
543 \start
544 \tt
545 \getvariable{tugboat}{email}
546 \stop
547 \par
548 \stop
549
550\stopsetups
551
552\startsetups tugboat:columns:presets
553
554
555
556\stopsetups
557
558\startsetups tugboat:article:start
559
560 \starttext
561
562 \setups{tugboat:columns:presets}
563
564 \setups{tugboat:banner:setup:\getvariable{tugboat}{type}}
565
566 \startpagecolumns
567
568 \setupheadertexts
569 [\setups{tugboat:banner:text:article}]
570 [pagenumber]
571
572 \setuppagenumber
573 [number=\getvariable{tugboat}{page}]
574
575
576 \vbox \bgroup
577 \forgetall
578 \hrule height .6pt
579 \blank[halfline]
580 \start
581 \enforced\let\\\par
582 \start
583 \bf
584 \getvariable{tugboat}{title}
585 \stop
586 \par
587 \blank[halfline]
588 \hskip20pt\getvariable{tugboat}{author}
589 \stop
590
591 \doifelsebufferempty {abstract} {
592
593 } {
594 \blank[line]
595
596 \enforced\let\\\endgraf
597 \setups[tugboat:abstract:setup]
598 \startsubject[title={Abstract}]
599 \getbuffer[abstract]
600 \stopsubject
601 }
602 \egroup
603
604\stopsetups
605
606\startsetups tugboat:proceedings:start
607
608 \starttext
609
610 \setups{tugboat:banner:setup:\getvariable{tugboat}{type}}
611
612 \setupheader
613 [state=empty]
614
615 \setuppagenumber
616 [number=\getvariable{tugboat}{page}]
617
618
619 \vbox \bgroup
620
621 \forgetall
622
623 \start
624 \switchtobodyfont[14.4pt]
625 \enforced\let\\\par
626 \getvariable{tugboat}{title}
627 \par
628 \stop
629
630 \setups{tugboat:introduction:\getvariable{tugboat}{type}}
631
632 \blank[tugmedium]
633
634 \enforced\let\\\par
635
636 \doifelsebufferempty {abstract} {
637
638 } {
639 \setups[tugboat:abstract:setup]
640
641 \midaligned{\bf Abstract}
642
643 \startnarrower[middle]
644 \getbuffer[abstract]
645 \stopnarrower
646 }
647 \egroup
648
649 \startpagecolumns
650
651\stopsetups
652
653\def\signaturewidth{13pc}
654
655\startsetups tugboat:affiliation:article
656
657 \blank[line]
658
659
660 \vbox \bgroup
661
662 \forgetall
663
664 \leftskip=\dimexpr\textwidth\signaturewidth\relax
665
666 \enforced\let\\\par
667
668 \noindent\llap {
669 $\diamond$\enspace
670 }
671 \getvariable{tugboat}{author}
672 \par
673
674 \getvariable{tugboat}{address}
675 \par
676
677 {\tt\getvariable{tugboat}{email}}
678
679 \egroup
680
681\stopsetups
682
683\startsetups tugboat:affiliation:proceedings
684
685
686
687\stopsetups
688
689\startsetups tugboat:article:stop
690
691 \setups{tugboat:affiliation:\getvariable{tugboat}{type}}
692
693 \blank[line]
694
695 \startpacked
696 \placenotes[endnotes]
697 \stoppacked
698
699
700
701 \ifdefined\writelastpage
702 \begingroup
703 \count0 = \realpageno
704 \writelastpage{1}
705 \endgroup
706 \fi
707
708 \stoppagecolumns
709
710 \page
711
712 \stoptext
713
714\stopsetups
715
716
717
718\setuptolerance
719 [strict]
720
721
722
723
724
725
726
727
728\setuplanguage
729 [lefthyphenmin=2,
730 rightthyphenmin=3]
731
732
733
734\doifelsefileexists {..tugboat.dates} {
735
736 \pushoverloadmode
737
738 \newcount\issueseqno
739 \newif \ifPrelimDraft
740
741
742
743
744 \def\vol #1, #2.{\xdef\tubvol {#1}
745 \xdef\tubnum {#2}}
746 \def\issyear #1.{\xdef\tubyear{#1}}
747
748 \input {..tugboat.dates}
749
750
751
752
753 \popoverloadmode
754
755 \setevariables
756 [tugboat]
757 [year=\tubyear,
758 volume=\tubvol,
759 number=\tubnum,
760 page=\the\count0]
761
762} {
763
764}
765
766\def\tubyear{1234}
767\def\tubvol {5}
768\def\tubnum {6}
769
770\def\issyear #1.{\def\tubyear{#1}}
771\def\vol #1, #2.{\def\tubvol {#1}
772 \def\tubnum {#2}}
773
774\stopmodule
775
776
777
778\continueifinputfile{stugboatcolumns.mkxl}
779
780\setupexternalfigures[location={local,global,default}]
781
782\StartArticle
783
784 \StartAbstract
785 \input bryson
786 \StopAbstract
787
788
789
790
791
792
793
794
795
796 \samplefile{tufte}\par
797 \samplefile{tufte}
798
799 As we see \doifelsemode {columns} {in \in {table} [demo1]} {below} we can have
800 more than one cell in a row.
801
802 \startplacetable[mode=columns,reference=demo1]
803 \starttabulate[]
804 \expandedloop 1 10 1 {
805 \NC one \the\currentloopiterator \NC one more \NC and even 1 mode \NC and way more 1 now \NC \NR
806 \NC two \the\currentloopiterator \NC two more \NC and even 2 mode \NC and way more 2 now \NC \NR
807 }
808 \stoptabulate
809 \stopplacetable
810
811 \samplefile{tufte}
812
813 \startplacefigure[mode=columns,reference=demo2]
814 \externalfigure[cow.pdf][height=2cm,width=\textwidth]
815 \stopplacetable
816
817 \samplefile{tufte}\par
818 \samplefile{tufte}
819
820 \starttyping
821 test test test test test test
822 test test test test test test test test test test test test test test test test test test
823 test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
824 test test test test test test test test test test test test test test test test test test
825 \stoptyping
826
827 \samplefile{tufte}
828
829 \dorecurse{10}{\samplefile{zapf}\blank}
830
831\StopArticle
832 |