1 \startenvironment ma-cb-style
3 \def\GenericDir{../generic
}
4 \setupexternalfigures[directory=
{\GenericDir}]
6 % The strange mix of english and dutch is due to the fact
7 % that much of the core of \CONTEXT\ is still dutch.
9 % Beware, this module looks awful. This is due to the fact
10 % that we use one setup for many interface languages and many
11 % alternative layouts. A single language setup looks much
12 % better and readible.
14 \usemodule[res-trace
] % so that we know what graphics are used
22 % The layout dimensions are based on the A4 paper dimensions.
23 % That way users can print this manual themselves.
28 \c!margindistance=
.5cm,
35 % There will be three versions:
38 % \som bound: the real paper one
39 % \som print: the user printable one
40 % \som screen: the interactive version
43 % This mode mechanism is rather new but painfully simple.
50 \c!location=
\v!doublesided
]
54 % The lucida fonts look a bit more informal.
58 \usetypescriptfile[type-buy
]
59 \usetypescript[lucida
][texnansi
]
60 \setupbodyfont[lucida,
10pt
]
64 \startnotmode[atpragma
]
66 \usetypescriptfile[type-buy
]
67 \usetypescript[palatino
][\defaultencoding]
68 \setupbodyfont[palatino,
10pt
]
72 % We enable colors and define an aditional color, used in the
79 % {\setupcolors[\c!conversie=\v!altijd]}
82 [headrule
][r=
0,g=
1,b=
0]
84 % Let's keep the text compact.
92 % We indent verbatim with the default indenting value.
95 [\c!margin=
\v!standard,
98 % Manuals as usual need a bit more tolerance, because a lot
99 % of in||line verbatim is used.
104 % This manual makes heavy use of backgrounds. During a run,
105 % about 800 metaclips are generated.
109 [\MPclipOne{\overlaywidth}{\overlayheight}{10pt
}{gray
}{red
}]
113 [\MPclipOne{\overlaywidth}{\overlayheight}{7.5pt
}{gray
}{red
}]
117 [\MPclipOne{\overlaywidth}{\overlayheight}{5pt
}{gray
}{red
}]
121 [\MPclipFourL{\overlaywidth}{\overlayheight}{5pt
}]
125 [\MPclipFourR{\overlaywidth}{\overlayheight}{5pt
}]
129 [\MPclipOne{\overlaywidth}{\overlayheight}{20pt
}{gray
}{red
}]
133 [\MPclipOne{\overlaywidth}{\overlayheight}{15pt
}{gray
}{red
}]
137 [\MPclipOne{\overlaywidth}{\overlayheight}{5pt
}{lightgray
}{lightred
}]
141 [\MPclipTwoA{\overlaywidth}{\overlayheight}{3pt
}{3pt
}{red
}{white
}]
145 [\MPclipTwoB{\overlaywidth}{\overlayheight}{5pt
}{8pt
}{blue
}{lightgray
}]
149 [\MPclipFive{\overlaywidth}{\overlayheight}{30pt
}{5pt
}]
153 [\MPclipSeven{\overlaywidth}{\overlayheight}{2pt
}]
155 % We precede footnotes by a nice line. Due to preprocessing
156 % this is a to be a 'use' graphic, not a 'resuse' one! When
157 % I got a more clearer vision of the concept, 'reused'
158 % graphics will be possible too. (The solution is rather
159 % simple, but sort of fuzzy.)
161 \unexpanded\def\VoetnootLijn
162 {\dimen0=
.4\makeupwidth
163 \expanded{\MPclipThree{\the\dimen0}{2pt
}}}
166 [\c!rule=
\VoetnootLijn]
168 % This looks ok, but in a manual like this, it is confusing.
173 % [\c!background=FiguurAchtergrond,
174 % \c!frame=\v!off,\c!backgroundoffset=3pt]
177 % So, I decided to comment this one out.
179 % Chapter titles have a fancy shape around them. Because we
180 % have a lot of small chapters, we don't go to a new page.
184 [\c!command=
\HeadCommand,
185 \v!appendix
\c!label=none,
187 \c!before=
\vskip36pt plus
6pt minus
6pt,
190 % Titles look the same, but here we go to a new page.
194 [\c!command=
\HeadCommand,
196 \c!before=
\vskip36pt plus
6pt minus
6pt,
199 % The next definition is not that complicated, once one knows
200 % a bit of \TEX. Watch the \type{\getpagestatus} and
201 % \type{\ifrightpage}.
203 % \def\HeadCommand#1#2%
206 % \doifmodeelse{screen}
208 % {\ifrightpage\hss\fi}%
210 % [\c!background=KopAchtergrond,
216 % \c!align=\v!middle]
217 % {\doifmode{*sectionnumber}
218 % {#1\kern.5em% strut niet geset, zou wel moeten
219 % \hbox{\color[headrule]{\vrule\!!width1pt\!!height1.5\ht\strutbox\!!depth1.25\dp\strutbox}}%
222 % \doifmodeelse{screen}
224 % {\ifrightpage\else\hss\fi}}}
226 \def\HeadCommand#1#2%
227 {\alignedline{\v!outer
}{\v!left
}
229 [\c!background=KopAchtergrond,
236 {\doifmode{*sectionnumber
}
237 {#1\kern.5em
% strut niet geset, zou wel moeten
238 \hbox{\color[headrule
]{\vrule\!!width1pt\!!height1.5
\ht\strutbox\!!depth1.25
\dp\strutbox}}%
242 % The current chapter number is typeset in the (outer) margin
243 % and slowly moves down. We could have directly put it in the
244 % margin but using the footermargin as starting point works
249 [][\PlaatschapterStatus]
251 \unexpanded\def\PlaatschapterStatus
252 {\determineheadnumber[\v!chapter
]%
253 \ifnum\currentheadnumber>
0
254 \vbox to
\makeupheight
255 {\scratchcounter=
\lastpage
256 \advance\scratchcounter by -
\realpageno
258 \vskip0pt plus
\realpageno cm
259 \edef\StatusAchtergrond
261 % \ifodd\realpageno R\else\ifdubbelzijdig L\else R\fi\fi}%
262 \ifodd\realpageno R
\else\ifdoublesided L
\else R
\fi\fi}%
264 [\c!background=
\StatusAchtergrond,
268 {\lower.5\dp\strutbox\hbox
269 {\bfb\getmarking[\v!chapter
\v!number
]}}
270 \vskip0pt plus
\scratchcounter cm
274 % The index is put on a double collumned grid. The numbers is
275 % surrounded by a shape.
279 [\c!command=
\IndexCommando,
280 \c!before=
{\blank[\v!line
]},
283 \unexpanded\def\IndexCommando#1%
284 {\fittoptobaselinegrid
286 [\c!background=IndexAchtergrond,
294 % The very first version used keywords in the margin. The
295 % next settings applied to the level one margin word (we can
296 % stack margin words, you see).
300 % [\c!location=\v!left]
304 % [\c!background=MargeAchtergrond,
307 % \c!align=\v!middle,
308 % \c!style=\tfx\setupinterlinespace,
312 % When bound, we use a double sided layout and put the
313 % pagenumber in the margin, enhanced by a fancy background.
317 \setuppagenumbering[\c!alternative=
\v!doublesided
]
322 [\c!location=
{\v!footer,
\v!middle
},
323 \c!command=
\NummerCommando]
325 \unexpanded\def\NummerCommando#1%
327 [\c!background=NummerAchtergrond,
330 {\lower.5\dp\strutbox\hbox spread
60pt
{\hss#1\hss}}}
332 % We put the chapter title in the head. If we wouldn't have
333 % to center, the more simple setting would be:
336 % \setupheadertexts[\v!chapter][]
343 [{\hfill\getmarking[\v!chapter
]\hfill}]
346 % Guess what the next one does.
352 % Indeed, it prevents breaks between one||liners and
353 % following itemizations.
355 % The cover page is a real piece of art. Just watch.
357 \newbox\CoverBackgroundBox
360 {\ifvoid\CoverBackgroundBox
361 \global\setbox\CoverBackgroundBox=
\vbox to
\paperheight
365 \switchtobodyfont[5pt
]
367 \switchtobodyfont[7pt
]
375 [\c!background=IntroAchtergrond,
377 {\type{#
#1}}%\writetexcommand{##1}}%
378 \hskip1.25em plus
1em minus
1em
}
382 % \baselineskip \vsize plus 1fill minus 1fill
386 % \leavevmode\plaatselkesetup\unskip
395 {\penalty\shapepenalty}
404 \copy\CoverBackgroundBox}
406 \defineoverlay[geintje
][\CoverBackground]
408 % In interactive mode we make the text area active. Click and
409 % go to the table of contents.
411 \unexpanded\def\TitleButton% zou iets standaards moeten zijn
412 {\button % nog eens iets achter page
413 [\c!height=
\vsize,
% moeten kunnen zetten
419 \def\TitlePage#1#2#3%
422 [\c!background=geintje
]
428 [\c!doublesided=
\v!empty,
429 \c!headerstate=
\v!none,
430 \c!footerstate=
\v!none
]
433 \definedfont[SansBold at
40pt
]% \setfont lsb at 40pt % change this into something available
435 [\c!background=TitelAchtergrond,
444 {\definedfont[SansBold at
14pt
]% \setfont lsb at 14pt % change this into something available
446 [\c!background=AuteurAchtergrond,
456 \definedfont[SansBold at
20pt
]% \setfont lsb at 20pt % change this into something available
458 [\c!background=AuteurAchtergrond,
466 %\setuplayout[\c!marking=\v!off]
474 [\c!background=
\v!screen,
475 \c!backgroundscreen=
.95]
478 [\c!backgroundoffset=
.25cm,
480 \c!background=
\v!
color,
481 \c!backgroundcolor=white
]}}
483 % The backpage uses the same background and overlays a piece
487 {\page[\v!yes,
\v!blank,
\v!left
]
490 [\c!background=geintje
]
496 \c!doublesided=
\v!no,
497 \c!headerstate=
\v!none,
498 \c!footerstate=
\v!none
]
503 [\c!background=
\v!
color,
504 \c!backgroundcolor=white,
508 \c!width=
.4\makeupwidth,
509 \c!height=
\textheight,
522 % We draw a nice line between columns. The next command does
523 % the job. Of course a normal line can be set more easily,
524 % but here we hook in a command.
526 \unexpanded\def\KolommenLijn
531 {\vskip-
\maxcolumnheight
532 \dimen0=
\maxcolumnheight
533 \advance\dimen0 by
\maxcolumndepth
534 \expanded{\MPclipSix{\the\dimen0}{2pt
}}}%
537 % To save space we don't start chapters on a new page, except
538 % in appendices and the introduction. These settings happen
539 % in dedicated setups sections (see later). We also add some
540 % white space between table of content entries.
545 \c!before=
{\setups{introduction
}\writebetweenlist[\v!chapter
]{\blank[\v!line
]}}]
550 \c!before=
{\setups{bodymatter
}\writebetweenlist[\v!chapter
]{\blank[\v!line
]}}]
555 \c!before=
{\setups{appendix
}\writebetweenlist[\v!chapter
]{\blank[\v!line
]}}]
560 \c!before=
{\setups{backmatter
}\writebetweenlist[\v!chapter
]{\blank[\v!line
]}}]
562 \startsetups introduction
563 \setuphead[\v!chapter
][\c!page=
\v!right
]
566 \startsetups bodymatter
567 \setuphead[\v!chapter
][\c!page=
]
570 \startsetups appendix
571 \setuphead[\v!chapter
][\c!page=
\v!right
]
574 %\setuplabeltext [\csname s!\currentmainlanguage\endcsname] [\v!appendix=]
576 \startsetups backmatter
577 \setuphead[\v!chapter
][\c!page=
\v!right
]
580 % In normal documents one will never find awful things like
581 % below. Because we want an international setup, we just call
582 % the chapters in an indirect way.
584 \def\Introduction#1% nothing funny yet
585 {\getvalue{\v!title
}[intro
]{#1}} % == \titel[intro]{#1}
587 % In a previous version I aligned the columns to the middle.
588 % Watch the column postprocessor routine!
590 \def\TableOfContents#1%
591 {\getvalue{\v!title
}[contents
]{#1}
593 %\def\postprocesscolumnline##1%
594 % {\ifodd\currentcolumn
599 \startcolumns[\c!n=
2,
\c!distance=
36pt,
\c!rule=
\KolommenLijn]
602 [\c!criterium=
\v!all,
604 \c!after=
\vskip0pt] % makes it breakable
609 {\getvalue{\v!chapter
}[subind
]{#1}
611 \startcolumns[\c!n=
2,
\c!distance=
36pt,
\c!rule=
\KolommenLijn]
612 \placeregister[\v!index
]
617 {\getvalue{\v!chapter
}[comind
]{#1}
619 \startcolumns[\c!n=
2,
\c!distance=
36pt,
\c!rule=
\KolommenLijn]
620 \placeregister[Command
][\c!before=
{\blank[\v!line
]}]
625 {\getvalue{\v!chapter
}[comdefs
]{#1}
627 \component ma-cb-
\currentmainlanguage-commandlist
629 \startcolumns[\c!n=
2,
\c!distance=
36pt,
\c!rule=
\KolommenLijn,
630 tolerance=verytolerant
]
631 \switchtobodyfont[7pt
]
632 \setupsetup[\c!reference=
2]
643 [bagger=oeps,
\c!indicator=
\v!off
]
646 \doiffileelse{ma-cb-
\currentmainlanguage-copyright.tex
}
647 {\component ma-cb-
\currentmainlanguage-copyright.tex
}
648 % {\component \GenericDir/ma-cb-copyright.tex }
649 {\component ma-cb-copyright.tex
}
652 \doiffileelse{ma-cb-
\currentmainlanguage-colophon.tex
}
653 {\component ma-cb-
\currentmainlanguage-colophon.tex
}
654 % {\component \GenericDir/ma-cb-colophon.tex }
655 {\component ma-cb-colophon.tex
}
658 % Oh, how far more easy it would have been if we could put
659 % this in the text directly. But consistency is needed.
662 \definedescription[infosource
]
663 [location=hanging,align=left,width=broad,margin=
2em,headstyle=bold,
664 command=
\infosourcehead]
665 \def\infosourcehead#1{#1\crlf}
667 \def\Fr#1{\bgroup\rm\tf(
\from[#1])
\egroup}
669 \def\redospecialfrom[#1::
#2]%
670 {\ifundefined{\v!file:::
#1}%
673 \doifmodeelse{screen
}
674 {\def\doexternaldocument#
#1#
#2#
#3{\goto{#
#3}[#1::
#2]}}%
675 {\def\doexternaldocument#
#1#
#2#
#3{\hyphenatedurl{#
#1}}}%
676 \csname\v!file:::
#1\endcsname
681 % VZ 2006-11-23 after Hans's advice
682 \appendtoks \obeyMPlines \to \everyMPgraphic