\startenvironment layo-00

\useencoding[ibm] \usemodule[pragma,chemie,eenheid,abr-02]

\unprotect

\setupcolors
  [\c!state=\v!start]

\setupsystem
  [\c!random=\v!big]

\setuplayout
  [\c!location=\v!middle,
   \c!style=\ss,
   \c!backspace=2.5cm,
   \c!topspace=1.5cm,
   \c!width=16cm,
   \c!margindistance=.25cm,
   \c!margin=2.5cm,
   \c!height=\v!middle]

\definelayout
  [fullpage]
  [\c!backspace=0pt,
   \c!topspace=0pt,
   \c!width=\v!middle,
   \c!height=\v!middle,
   \c!header=0pt,
   \c!footer=0pt]

\setuppagenumbering
  [\c!alternative=\v!doublesided]

\startinterface english

  \setMPtext{title}{CONTEXTEN}

  \definecolor[maincolor][g=.6]
  \definecolor[textcolor][r=.6]

\stopinterface

\startinterface dutch

  \setMPtext{title}{CONTEXTNL}

  \definecolor[maincolor][b=.6]
  \definecolor[textcolor][r=.6]

\stopinterface

\definecolor[pagecolor][s=.6]
\definecolor[darkcolor][s=.2]

\definecolor[PageColor]     [white]
\definecolor[PlusColor]     [black]
\definecolor[FrameColor]    [maincolor] % [r=.5,g=.6,b=.7]
\definecolor[OtherColor]    [textcolor] % [r=.7,g=.6,b=.5]
\definecolor[GrayColor]     [s=.95]

\definecolor[GridLineColor] [FrameColor]
\definecolor[GridTextColor] [OtherColor]
\definecolor[ChartColor]    [GrayColor]

\setuppagenumbering
  [\c!location=]

\setuptolerance
  [\v!verytolerant,\v!stretch]

\setupblank
  [\v!medium]

\setupwhitespace
  [\v!medium]

\setuptyping
  [\c!blank=\v!medium]

\setupheadertexts
  [\v!margin]
  [][\hfill\pagenumber\hfill]

\setupfootertexts
  [\v!margin]
  [][{\hfill\doifnotmode{*\v!frontpart}{\getmarking[\v!chapter\v!number]}\hfill}]

\setupheadertexts
  [\v!text]
  [][{\hfill\getmarking[\v!chapter]\hfill}]

\setupfootertexts
  [\v!text]
  [][{\hfill\getmarking[\v!section][\v!all]\hfill}]

% we will go palatino

\setupbodyfont[loc,ams,lbr,10pt]

\usetypescript[serif]       [times]            [texnansi]
\usetypescript[serif]       [antykwa-torunska] [texnansi]
\usetypescript[serif]       [lucida]           [texnansi]
\usetypescript[sans]        [lucida]           [texnansi]
\usetypescript[mono]        [lucida]           [texnansi]
\usetypescript[calligraphy] [lucida]           [texnansi]

\setupbodyfontenvironment
  [default]
  [em=italic]

\setupsectionblock[\v!frontpart] [\c!page=\v!yes]
\setupsectionblock[\v!bodypart]  [\c!page=\v!yes]
\setupsectionblock[\v!appendix]  [\c!page=\v!yes]
\setupsectionblock[\v!frontpart] [\c!before=,\c!after=]

\definebodyfont[10pt][rm][bfe=RegularBold at 30pt]
\definebodyfont[10pt][rm][bft=RegularBold at 60pt]

\setuphead
  [\v!chapter]
  [\c!command=\PlaatsHoofdstuk,
   \c!page=\v!yes,
   \c!before=,
   \c!inbetween=\PlaatsHoofdstukIndex,
  %\c!incrementnumber=cont-\currentlanguage,
   \c!header=\v!nomarking,
   \c!textstyle=\bfd,
   \c!numberstyle=\bfe]

\setuphead
  [\v!title]
  [\c!command=\PlaatsHoofdstuk,
   \c!page=\v!right,
   \c!before=,
   \c!inbetween=\PlaatsHoofdstukIndex,
   \c!header=\v!nomarking,
   \c!textstyle=\bfd]

\setuphead
  [\v!section]
  [\c!command=\PlaatsParagraaf,
   \c!inbetween=,
   \c!style=\bfb]

\setuphead
  [\v!subsection]
  [\c!command=\PlaatsParagraaf,
   \c!before=\blank,
   \c!style=\bfa]

\setuphead
  [\v!subsubsection]
  [\c!command=\PlaatsParagraaf,
   \c!before=\blank,
   \c!style=\bsa]

\def\PlaatsHoofdstuk#1#2%  nog spatiering er na checken
  {\vbox
     {\localheadsetup
      \begstrut
      \inrightmargin
        {\vsmash
           {\hbox{\lower4cm\hbox to \marginwidth{\hss#1\hss}}}}%
      #2}}

\def\PlaatsParagraaf#1#2%
  {\vbox
     {\localheadsetup
      \begstrut
      \inleftmargin{\hbox to \leftmarginwidth{\hss#1\hss}}%
      #2}}

\setMPtext{text}{some test text}

\startnotmode [fast]
    \startusableMPgraphic{chapter}
      picture r ;
      r := image ( graphictext
        \MPstring{chapter}
        randomized .5pt
        scaled 10pt
        withfillcolor \MPcolor{textcolor}
        withpen pencircle scaled 1pt ; ) ;
      draw r ;
    \stopusableMPgraphic
    \startusableMPgraphic{text}
      picture r ;
      r := image ( graphictext
        \MPstring{text}
        randomized .4pt
        scaled 6pt
        withfillcolor .8\MPcolor{maincolor}
        withpen pencircle scaled 1pt ; ) ;
      draw r ;
    \stopusableMPgraphic
\stopnotmode

\startmode [fast]
    \startusableMPgraphic{chapter}
        fill fullcircle scaled 3cm withcolor .5red ;
    \stopusableMPgraphic
    \startusableMPgraphic{text}
        fill fullcircle scaled 3cm withcolor .5blue ;
    \stopusableMPgraphic
\stopmode

\def\processMPword#1%
  {\setMPtext{text}{\bf#1}
   \setbox0=\hbox{\MPstring    {text}}
   \setbox2=\hbox{\useMPgraphic{text}}
   \dimen0=\ht\strutbox \advance\dimen0 -\ht0 \dimen0=6\dimen0
   \dimen2=\dp\strutbox \advance\dimen2 -\dp0 \dimen2=6\dimen2
   \setbox2=\vbox{\vskip\dimen0\box2\vskip\dimen2}
   \ht2=6\ht\strutbox
   \dp2=6\dp\strutbox
   \box2}

\def\processMPheadtext#1%
  {\let\processword\processMPword
   \hfill\processwords{#1}}

\def\processMPheadnumber#1%
  {\setMPtext{chapter}{\bf#1}
   \useMPgraphic{chapter}}

\setupbackgrounds
  [\v!paper]
  [\c!backgroundcolor=pagecolor]

\def\PlaatsHoofdstukIndex % todo: lucida
 {%\startnotmode[*\v!frontpart]
    \page[\v!right]
    \setupbackgrounds[\v!paper][\c!background=\v!color]
    \startmakeup[\v!standard]
      \raggedleft
      \doifsomething{\currentheadnumber}
         {\hfill\expanded{\processMPheadnumber{\currentheadnumber}}}
      \vfill
      \hfill\expanded{\processMPheadtext{\currentheadtext}}
    \stopmakeup
    \setupbackgrounds[\v!paper][\c!background=]
  }%\stopnotmode}

\setupcolors
  [\c!state=\v!start]

\setuptype
  [\c!option=\v!slanted]

\setuptyping
  [\c!option=\v!slanted]

\startusableMPgraphic{FrontPage}
  path p, q ; p := OverlayBox scaled (1/3) ;
  color maincolor ; maincolor := \MPcolor{maincolor} ;
  color textcolor ; textcolor := \MPcolor{textcolor} ;
  color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
  color darkcolor ; darkcolor := \MPcolor{darkcolor} ;
  string s ; s := \MPstring{title} ;
  numeric k ; k := 0 ;
  picture r ; pair a ;
  fill OverlayBox enlarged 12pt withcolor pagecolor ;
  for i=2 downto 0 :
    for j= 0 upto 2 :
      a := (j*xpart urcorner p, i*ypart urcorner p) ;
      q := p enlarged -12pt randomized 12pt shifted a ;
      circular_shade
        (q, ceiling(uniformdeviate 4), maincolor, .5maincolor) ;
      draw q
        withpen pencircle scaled 8pt
        withcolor darkcolor ;
      r := image ( graphictext
        substring (k,k+1) of s
        randomized .5pt
        scaled 10pt
        withfillcolor if k<7 : pagecolor else : textcolor fi
        withpen pencircle scaled 1pt ; ) ;
      r := r xysized (.75urcorner p) ;
      r := r shifted (center q - center r) ;
      draw r ;
      k := k + 1 ;
    endfor ;
  endfor ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopusableMPgraphic

\startusableMPgraphic{BackPage}
  fill OverlayBox enlarged 12pt withcolor \MPcolor{pagecolor} ;
\stopusableMPgraphic

\startusableMPgraphic{BackFrame}
  color maincolor ; maincolor := \MPcolor{maincolor} ;
  color darkcolor ; darkcolor := \MPcolor{darkcolor} ;
  path p ; p := OverlayBox enlarged -12pt randomized 12pt ;
  circular_shade(p, ceiling(uniformdeviate 4), maincolor, .5maincolor) ;
  draw p withcolor darkcolor withpen pencircle scaled 8pt ;
\stopusableMPgraphic

\defineoverlay [FrontPage] [\useMPgraphic{FrontPage}]
\defineoverlay [BackPage]  [\useMPgraphic{BackPage}]
\defineoverlay [BackFrame] [\useMPgraphic{BackFrame}]

\def\titelbladen
  {\setupbackgrounds
     [\v!rightpage]
     [\c!background=FrontPage]
   \setupmakeup
     [\v!standard]
     [\c!doublesided=\v!empty]
   \startmakeup[\v!standard]
     % the dummy title page
   \stopmakeup
   \setupbackgrounds
     [\v!rightpage]
     [\c!background=]
   \startmakeup[\v!standard][\c!doublesided=\v!no]
     \setupalign[\v!left]
     \bft \setupspacing \setstrut
     \strut Con\TeX t
     \par
     \strut \translate[en=the manual,nl=de handleiding]
     \bfe \setupspacing \setstrut
     \vfill
     \strut Hans Hagen
     \par
     \strut \currentdate
   \stopmakeup
   \startmakeup[\v!standard][\c!page=,\c!doublesided=\v!no]
     \vfill
     \getbuffer[cop-a]
     \blank
     \getbuffer[cop-b]
     \blank
     \getbuffer[cop-c]
   \stopmakeup}

\startbuffer[back-1]

\startinterface dutch

\noindent \CONTEXT\ is een macropakket geschreven rond de
typografische programmeertaal \TEX. Het biedt de gebruiker
een veelheid aan hulpmiddelen om documenten van vorm te
geven. Hoewel oorspronkelijk ontwikkeld voor het vormgeven
en ontwikkelen van opleidingsmateriaal, heeft \CONTEXT\ zich
ontwikkeld tot een systeem om allerhande, eenvoudige, maar
vooral ook complexe documenten zo toegankelijk mogelijk vorm
te geven.

\stopinterface

\startinterface english

\noindent \CONTEXT\ is a macropackage written in the
typographic programming language \TEX. It offers the user a
wide range of tools to typeset documents. Although \CONTEXT\
originally was written to facilitate the development of
educational documents, it can handle all kind of simple and
complex forms of documentation.

\stopinterface

\stopbuffer

\startbuffer[back-2]

\startinterface dutch

\noindent \CONTEXT\ wordt dan ook gebruikt voor het
vormgeven van uiteenlopende documenten. Men kan daarbij
denken aan boeken, al dan niet wiskundig of technisch van
aard, maar ook aan handleidingen bij programma's, machines
of produkten, kwaliteitshandleidingen, produktiemanuals,
overzichtswerken, database||uitvoer en collecties
samenhangende documenten. Hergebruik van bronnen,
data||abstractie en structuur zijn dan ook kenmerkend voor
\CONTEXT.

\stopinterface

\startinterface english

\noindent Therefore \CONTEXT\ is used for a wide range of
documents, like books of technical or more scolar nature,
computer manuals, the often huge and complex quality
assurance manuals and technical manuals to machines, books
of encyclopedian nature, database(d) documents, and
collections of documents that have common characteristics.
Reuse of sources, data||abstraction and structure is typical
a job for \CONTEXT.

\stopinterface

\stopbuffer

\startbuffer[back-3]

\startinterface dutch

Door de aard van \TEX\ is \CONTEXT\ uitermate geschikt om
medium||neutraal gecodeerde bronnen te verwerken tot niet
alleen papieren maar ook interactieve documenten. Er is een
verregaande ondersteuning voor \PDF\ en \XML\ de daaraan
gerelateerde functionaliteit.

\stopinterface

\startinterface english

Due to the nature of \TEX, \CONTEXT\ is well suited to
process documents coded in a medium||neutral way. Paper
output as well as highly interactive screen documents are
both supported. There is a very complete support for \PDF\
and \XML\ and the related technologies.

\stopinterface

\stopbuffer

\startbuffer[back-4]

\startinterface dutch

\noindent \CONTEXT\ is beschikbaar in het \citeer {for
free}. Naast deze referentie handleiding zijn er
handleidingen voor beginners in verschillende talen en zijn
er documenten die specifieke functionaliteit beschrijven.
Daarnaast zijn er een aantal voorbeeldstijlen beschikbaar en
voorbeelden van kant||en||klare documenten.

\blank voor meer informatie: \blank www.pragma-ade.com

\stopinterface

\startinterface english

\noindent \CONTEXT\ is avaliable \quote {for free}. Apart
from this reference manual, there are manuals for starters
in several languages. There are also documents that describe
the basic functionality. There are example styles as well as
many examples of documents produced by \CONTEXT.

\blank for more information: \blank www.pragma-ade.com

\stopinterface

\stopbuffer

\def\achterbladen
  {\page[\v!left]
   \setupbackgrounds
     [\v!leftpage]
     [\c!background=BackPage]
   \setuplayout
     [fullpage]
   \startmakeup[\v!standard][\c!page=\v!left,\c!doublesided=\v!no]
     \setupframed
       [\c!background=BackFrame,
        \c!offset=36pt,
        \c!frame=\v!off,
        \c!align=\v!normal,
        \c!strut=\v!no,
        \c!height=.5\vsize,
        \c!width=.5\hsize,
        \c!foregroundcolor=pagecolor]
     \tfa\setupinterlinespace
     \vfill
     \hbox to \hsize
       {\hss
        \framed{\getbuffer[back-1]}\hss
        \framed{\getbuffer[back-2]}\hss}
     \vfill
     \hbox to \hsize
       {\hss
        \framed{\getbuffer[back-3]}\hss
        \framed{\getbuffer[back-4]}\hss}
     \vfill
   \stopmakeup
   \setuplayout
   \setupbackgrounds
     [\v!leftpage]
     [\c!background=]}

\setuplist
  [\v!section]
  [\c!width=3em]

\defineregister
  [texmacro]
  [texmacros]

\setupregister
  [texmacro]
  [\c!indicator=\v!off,
   \c!distance=1em minus .25em]

\setupfootnotes
  [\c!rule=\v!on]

\setuphead
  [\v!chapter]
  [\c!header=\v!empty]

\setupitemgroup[\v!itemize]
  [\v!each]
  [\c!headstyle=\v!bold]

\setupitemgroup[\v!itemize]
  [\v!each]
  [\v!stopper]

\setupsubpagenumber
  [\c!way=\v!by\v!chapter,
   \c!state=\v!start]

% Bij de setups wordt gebruik gemaakt van 'sorteren'. Hierdoor
% zijn ze in de bijlage op te roepen.

\setupframedtexts
  [setuptext]
  [\c!background=\v!color,
   \c!frame=\v!off,
   \c!backgroundcolor=GrayColor]

\let\showsetup\setup
\let\toonsetup\setup

\def\repeatsetup#1%
  {\bgroup
   \setupsetup[\c!reference=2] % wel tonen, niet genereren
   \showsetup{#1}%
   \egroup}

\setupsetup
  [\c!criterium=\v!used,
   \c!reference=1]

\startbuffer [cop-a]

This document is typeset using \PDFTEX. The body font is
Lucida Bright at 10 points. The layout is based on a 24 cm
square paper size, scaled down .875 to fit nicely on an A4.

\stopbuffer

\startbuffer [cop-b]

\TEX\ and \AMSTEX\ are trademarks of the American
Mathematical Society; \METAFONT\ is a trademark of
Addison||Wesley Publishing Company; PostScript, Portable
Document Format and Acrobat are trademarks of Adobe Systems
Incorporated; \DVIPSONE\ and \DVIWINDO\ are trademarks of
Y\&Y Incorporated; \IBM\ is a trademark of International
Business Machines Corporation; \MSDOS\ is a trademark of
MicroSoft Corporation; all other product names are
trademarks of their producers.

\stopbuffer

\startbuffer [cop-c]

All rights reserved. No part of this publication may be
reproduced, stored in a retrieval system, or transmitted in
any form or by any means, electronic, mechanical,
photocopying, recording or otherwise, without prior written
permission of the publisher.

\blank

\copyright\ 1991--\the\year\ PRAGMA ADE, Ridderstraat 27, 8061GH
Hasselt, The Netherlands, pragma@wxs.nl

\stopbuffer

\protect

\stopenvironment
