% Testfile
% chemical structures
% tabulate first line \HL


\setupoutput[pdftex]
\mainlanguage[nl]
\usemodule[pictex,chemic]
\setupbodyfont[ss,12pt]

\setupchemical[size=small,scale=small,width=fit]
\definepapersize[MyPaper][height=18cm, width=12cm]
\setuppapersize[MyPaper][A5]
\setuplayout
      [header=20pt,
       headerdistance=0.5cm,
       backspace=2.0cm,
       footerdistance=0.1cm,
       footer=12pt,
       veroffset=0.5cm,
       width=8cm]


% Druivesuiker gedraaid om 90 graden
\definechemical[Gluc1]
   {\chemical[SIX,ROT2,+SB4,B1236,-SB5,Z5,R12346,RZ124]
             [O,OH,OH,HOH_2C]}

% Druivesuiker gedraaid om 270 graden
\definechemical[Gluc2]
   {\chemical[SIX,ROT4,B1236,+SB4,-SB5,Z5,R12346,RZ124]
             [O,OH,OH,CH_2OH]}

% Twee druivesuiker moleculen gekoppeld
\definechemical[DiGluc]
   {\chemical[Gluc1]
    \chemical[SUB1,ONE,CZ0,SB15][O]
    \chemical[SUB1,Gluc2]}

\startbuffer[Cellulosemolekul]
   \placeformula[Cellulose]
      \startformula
         \startchemical[scale=small,size=small,width=fit,bottom=3000]
            \bottext{Cellulose}
            \chemical[ONE,Z0,SB1,OE5][O]
            \chemical[SUB1,DiGluc]
            \chemical[SUB1,ONE,Z0,SB15][O]
            \chemical[SUB1,DiGluc]
            \chemical[SUB1,ONE,Z0,SB5,OE1][O]
         \stopchemical
   \stopformula
\stopbuffer

\startbuffer[DEZ1]
   \placeformula
      \startformula
         \chemical{(C_2H_5)_2Zn}{DEZ}
         \chemical{PLUS}
         \chemical{2H^\oplus}{waterstof (zuur)}
         \chemical{GIVES}
         \chemical{Zn^{2\oplus}}{zinkion}
         \chemical{PLUS}
         \chemical{2(C_2H_6)}{ethan}
      \stopformula
\stopbuffer

\starttext

\section{Cellulose}

Gesimplificeerde weergave van de cellulose keten (staat in buffer Cellulosemolekul)

\placefigure[left][fig:Cellulosemolekul]{none}{\externalfigure[Cellulosemolekul][type=buffer,width=\textwidth]}

We thrive in information||thick worlds because of our
marvelous and everyday capacity to select, edit,
single out, structure, highlight, group, pair, merge,
harmonize, synthesize, focus, organize, condense,
reduce, boil down, choose, categorize, catalog, classify,
list, abstract, scan, look into, idealize, isolate,
discriminate, distinguish, screen, pigeonhole, pick over,
sort, integrate, blend, inspect, filter, lump, skip,
smooth, chunk, average, approximate, cluster, aggregate,
outline, summarize, itemize, review, dip into,
flip through, browse, glance into, leaf through, skim,
refine, enumerate, glean, synopsize, winnow the wheat
from the chaff and separate the sheep from the goats.

\section{DEZ (dimethylzink)}

   \startitemize[1,packed]
      \item $(C_2H_5)_2Zn$

      \head Reactie:

   \placefigure[left][fig:DEZ1]{none}{\externalfigure[DEZ1][type=buffer,width=\textwidth]}

      \item DEZ is een gasvormige stof, dringt zeer goed door in het papier
      \item $ZnO$ blijft als basische reserve in het papier.
      \item Gevaarlijke stof, reageerd meteen met $H_2O$.
   \stopitemize

Bij DEZ methode  wordt bij massa-ontzuring eerst het watergehalte van normaal ca. 8\% naar 0.5\% teruggebracht. Na het drogen wordt een overmaat aan DEZ toegevoegd.

\section{Tabulation with starting \type{\HL}}

\placetable[here][tab:Verzierungsweisen]
     {\"Ubersicht \"uber die Verzierungsweisen}
{\switchtobodyfont[small]
\starttabulate[|p(0.35\textwidth)|p(0.125\textwidth)|p|]

%\HL <------ Uncommenting this causes an error!
\NC Klasse            \NC Gruppe     \NC Art                                                \NC\NR
\NC Verzierungsweisen \NC            \NC                                                    \NC\NR
\HL
\NC Drucken           \EQ  Pressen   \EQ Flachdruck als Gold-, Folie-, Farb- und Blinddruck \NC\NR
\NC                   \NC  Pr\"agen  \EQ Stiftvergoldung                                    \NC\NR
\NC                   \NC            \NC Reliefpr\"agung                                    \NC\NR
\NC Kaltvergolden     \EQ            \NC \"Olgrund                                          \NC\NR
\NC                   \NC            \NC Kunstharzklebergrund (Henkel A 22)                 \NC\NR
\NC                   \NC            \NC Vergoldepastengrund                                \NC\NR
\NC Lederschnitt      \EQ            \NC Aufgerissener Lederschnitt                         \NC\NR
\NC                   \NC            \NC Flachschnitt mit Punzung                           \NC\NR
\NC                   \NC            \NC Lederschnitt und Treibarbeit                       \NC\NR
\HL
\stoptabulate}

\stoptext
