summaryrefslogtreecommitdiff
path: root/doc/context
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-07-05 13:37:27 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-07-05 13:37:27 +0200
commita596680c20618232e248aa4e45bed22749a30e1b (patch)
tree4a23eacbf1cccac6d60fc01b762afc369845f196 /doc/context
parentda9149010f4d34eef23a504682d82cdcf4fac8f5 (diff)
downloadcontext-a596680c20618232e248aa4e45bed22749a30e1b.tar.gz
2016-07-05 13:06:00
Diffstat (limited to 'doc/context')
-rw-r--r--doc/context/documents/general/manuals/steps-mkiv.pdfbin0 -> 297225 bytes
-rw-r--r--doc/context/sources/general/manuals/manuals-xml-environment.tex385
-rw-r--r--doc/context/sources/general/manuals/steps/steps-mkiv.tex655
3 files changed, 1040 insertions, 0 deletions
diff --git a/doc/context/documents/general/manuals/steps-mkiv.pdf b/doc/context/documents/general/manuals/steps-mkiv.pdf
new file mode 100644
index 000000000..fabdff6b2
--- /dev/null
+++ b/doc/context/documents/general/manuals/steps-mkiv.pdf
Binary files differ
diff --git a/doc/context/sources/general/manuals/manuals-xml-environment.tex b/doc/context/sources/general/manuals/manuals-xml-environment.tex
new file mode 100644
index 000000000..5a5d9a92d
--- /dev/null
+++ b/doc/context/sources/general/manuals/manuals-xml-environment.tex
@@ -0,0 +1,385 @@
+% language=uk
+%
+% author : Hans Hagen, PRAGMA ADE, NL
+% license : Creative Commons, Attribution-NonCommercial-ShareAlike 3.0 Unported
+
+\usemodule[abr-01]
+
+\startmode[booklet]
+
+ \setuppapersize [A4][oversized]
+
+\stopmode
+
+% \setuppapersize[A4][doubleoversized,landscape]
+% \setuparranging[2UP]
+% \setuppagenumbering[alternative={singlesided,doublesided}]
+
+\setuplayout
+ [location=middle,
+ marking=on]
+
+% \logo [EXAMPLE] {eXaMpLe}
+
+\setuptabulate
+ [rulethickness=1pt,
+ rulecolor=darkgreen]
+
+\setuptables
+ [rulethickness=1pt,
+ rulecolor=darkgreen]
+
+% \usesymbols
+% [cc]
+
+\setuplayout
+ [width=middle,
+ topspace=2cm,
+ top=1cm,
+ cutspace=1.5cm, % 2.0cm
+ backspace=3.5cm,
+ header=1cm,
+ footer=1.5cm,
+ bottom=1cm,
+ leftmargin=2.5cm,
+ rightmargin=1cm,
+ margindistance=.5cm,
+ height=middle]
+
+\definelayout
+ [titlepage]
+ [topspace=2cm,
+ backspace=1.5cm,
+ bottomspace=1.5cm]
+
+\startmode[screen]
+
+ \setuppapersize
+ [S6][S6]
+
+ \setuplayout
+ [topspace=1cm,
+ bottomspace=1.5cm,
+ top=1cm,
+ header=0cm,
+ footer=.5cm,
+ bottom=1cm]
+
+ \setupinteraction
+ [state=start,
+ color=,
+ contrastcolor=,
+ style=,
+ menu=on]
+
+ \setupinteractionmenu
+ [bottom]
+ [left=\hfill,
+ middle=\hskip.25cm,
+ background=color,
+ backgroundcolor=darkgray,
+ color=lightgray,
+ contrastcolor=lightgray,
+ style=\bfb\setstrut\strut,
+ offset=2pt,
+ height=fit,
+ frame=off]
+
+ \startinteractionmenu[bottom]
+ \startbut [PreviousJump] GoBack \stopbut
+ \startbut [previouspage] Previous \stopbut
+ \startbut [nextpage] Next \stopbut
+ \startbut [CloseDocument] Exit \stopbut
+ \stopinteractionmenu
+
+\stopmode
+
+\setupbodyfont[dejavu,11pt]
+
+\definecolor [cyan] [g=.4,b=.4]
+\definecolor [magenta] [r=.4,b=.4]
+\definecolor [yellow] [r=.4,g=.4]
+\definecolor [red] [r=.4]
+\definecolor [green] [g=.4]
+\definecolor [blue] [b=.4]
+\definecolor [gray] [s=.4]
+
+\definecolor [lightgray] [s=.8]
+
+\definecolor [FillColor] [gray]
+
+\definecolor [NumberColor] [red]
+\definecolor [BannerColor] [green]
+\definecolor [AspectColor] [blue]
+
+% *rgb *rgy *rby *gby *rgc *rbc *gbc rgm rbm gbm
+% *cmy cmr cyr myr cmg cyr myg cmb cyb myb
+
+\definepalet[steps] [NumberColor=red, BannerColor=green, AspectColor=blue]
+\definepalet[mathml] [NumberColor=cyan, BannerColor=magenta,AspectColor=yellow]
+\definepalet[chemml] [NumberColor=red, BannerColor=green, AspectColor=yellow]
+\definepalet[physml] [NumberColor=red, BannerColor=blue, AspectColor=yellow]
+\definepalet[figures][NumberColor=green,BannerColor=blue, AspectColor=yellow]
+\definepalet[charts] [NumberColor=red, BannerColor=green, AspectColor=cyan]
+\definepalet[examns] [NumberColor=red, BannerColor=green, AspectColor=cyan]
+\definepalet[general][NumberColor=red, BannerColor=blue, AspectColor=cyan]
+\definepalet[tables] [NumberColor=green,BannerColor=blue, AspectColor=cyan]
+
+\setupindenting
+ [medium]
+
+\indenting
+ [yes]
+
+\defineoverlay
+ [nextpage]
+ [\overlaybutton{nextpage}]
+
+\startusableMPgraphic{cover}
+ path p, q ; color maincolor[], fillcolor ; numeric r, w, h ;
+ numeric cellwidth, cellspread, linewidth ;
+ maincolor[0] := \MPcolor{BannerColor} ;
+ maincolor[1] := \MPcolor{AspectColor} ;
+ maincolor[2] := \MPcolor{NumberColor} ;
+ fillcolor := \MPcolor{FillColor} ;
+ cellwidth := 75pt ;
+ cellspread := 50pt ;
+ linewidth := 1/10pt ;
+ w := OverlayWidth + cellwidth ;
+ h := OverlayHeight + cellwidth ;
+ q := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
+ fill unitsquare xyscaled (w,h) withcolor fillcolor ;
+ set_grid (w,h,cellwidth-cellspread,cellwidth-cellspread) ;
+ forever :
+ if new_on_grid(uniformdeviate w, uniformdeviate h) :
+ draw image (
+ p := unitsquare ;
+ r := floor(uniformdeviate 3) ;
+ fill p enlarged linewidth withcolor fillcolor ;
+ fill p withcolor maincolor[r] ;
+ draw
+ if r = 0 :
+ urcorner p -- .5[llcorner p,ulcorner p] -- lrcorner p
+ elseif r = 1 :
+ ulcorner p -- .5[lrcorner p,urcorner p] -- llcorner p
+ else :
+ urcorner p -- llcorner p
+ fi
+ withpen pencircle scaled linewidth withcolor fillcolor ;
+ )
+ scaled (cellwidth randomized cellspread)
+ shifted (dx,dy) ;
+ fi ;
+ exitif grid_full ;
+ endfor ;
+ % currentpicture := currentpicture shifted -(cellwidth,cellwidth) ;
+ % clip currentpicture to q ;
+\stopusableMPgraphic
+
+\defineoverlay
+ [cover]
+ [\useMPgraphic{cover}]
+
+\setupbackgrounds
+ [page]
+ [offset=3mm]
+
+\defineoverlay
+ [page]
+ [\reuseMPgraphic{page}]
+
+\startreusableMPgraphic{page}
+ StartPage ;
+ path p ; p :=
+ ulcorner Page --
+ llcorner Page --
+ llcorner Page shifted (BackSpace-LeftMarginDistance,0) --
+ ulcorner Page shifted (BackSpace-LeftMarginDistance,0) -- cycle ;
+ fill
+ (p enlarged PageOffset) rightenlarged -PageOffset
+ withcolor \MPcolor{FillColor} ;
+ picture t ; t := textext("\bfb \lightgray \ConTeXt\ XML") rotated 90 ;
+ setbounds t to boundingbox t enlarged ExHeight ;
+ t := image ( label.llft(t,urcorner Page )) ;
+ fill boundingbox t topenlarged PageOffset rightenlarged PageOffset withcolor \MPcolor{FillColor} ;
+ draw t ;
+ StopPage ;
+ setbounds currentpicture to boundingbox currentpicture enlarged PageOffset ;
+\stopreusableMPgraphic
+
+\setuphead
+ [section]
+ [command=\texdefinition{document:head:section},
+ color=lightgray,
+ style=\bfb,
+ before={\blank[2*big]},
+ after={\blank[2*big]},]
+
+\starttexdefinition document:head:section #1#2
+ \hbox {
+ \hskip-\marginwidth
+ \hskip-\margindistance
+ \framed [
+ width=.5\textwidth,
+ offset=2pt,
+ frame=off,
+ background=color,
+ backgroundcolor=AspectColor
+ ] {
+ \hskip.25cm
+ #2
+ \hfill
+ }
+ }
+\stoptexdefinition
+
+\setupheadertexts
+ []
+
+\setupbottom
+ [margin]
+ [color=lightgray,
+ style=\bfb]
+
+\setuptyping
+ [color=green]
+
+\setuptype
+ [color=green]
+
+\doifmodeelse {booklet} {
+
+ \setupbottomtexts
+ [margin]
+ [\setup{document:pagenumber}] []
+ [\setup{document:pagenumber}] []
+
+} {
+
+ \setupbottomtexts
+ [margin]
+ [\setup{document:pagenumber}] []
+
+}
+
+\setvariables
+ [document]
+ [title=No Title,
+ author=No Author]
+
+\startmode[atpragma]
+
+ \setvariables
+ [document]
+ [line:1=Con\TeX t XML,
+ line:2=Pragma ADE / Hasselt NL,
+ line:3=MkIV]
+
+\stopmode
+
+\startsetups document:pagenumber
+ \hbox to \marginwidth {
+ \framed [
+ width=.25\textwidth,
+ offset=2pt,
+ frame=off,
+ background=color,
+ backgroundcolor=NumberColor
+ ] {
+ \hskip.25cm
+ \documentvariable{title}
+ \hfill
+ \pagenumber
+ \hskip.25cm
+ }
+ }
+\stopsetups
+
+\startsetups document:start
+
+ \doifsomething {\documentvariable{palet}} {
+ \setuppalet[\documentvariable{palet}]
+ }
+
+ \setupbackgrounds
+ [page]
+ [background={cover,nextpage}]
+
+ \setuplayout
+ [titlepage]
+
+ \startstandardmakeup[bottomstate=stop]
+ \raggedcenter
+ \lightgray
+ \start
+ \definedfont[SansBold at 100pt]
+ \setupinterlinespace
+ \WORD{\documentvariable{title}}
+ \par
+ \stop
+ \vfilll
+ \doifsomething {\documentvariable{line:1}} {
+ \dontleavehmode\hbox{\definedfont[SansBold at 50pt]\setstrut\strut\documentvariable{line:1}}
+ }
+ \doifsomething {\documentvariable{line:2}} {
+ \vskip25pt
+ \dontleavehmode\hbox{\definedfont[SansBold at 25pt]\setstrut\strut\documentvariable{line:2}}
+ }
+ \doifsomething {\documentvariable{line:3}} {
+ \vskip25pt
+ \dontleavehmode\hbox{\definedfont[SansBold at 25pt]\setstrut\strut\documentvariable{line:3}}
+ }
+ \stopstandardmakeup
+
+ \setuplayout
+
+ \setupbackgrounds
+ [page]
+ [background={page,banner}]
+
+\stopsetups
+
+\startsetups document:stop
+
+ \definecolor[AspectColor][green]
+
+ \startsubject[title=Colofon]
+
+ This manual is part of the \CONTEXT\ distribution, and is authored and maintained by \space
+ \documentvariable{author}. \CONTEXT\ is developed at \PRAGMA, Hasselt, The Netherlands.\space
+ This manual is produced on \currentdate.
+
+ \stopsubject
+
+\stopsetups
+
+% \usemodule[set-11]
+
+% \setupframedtexts
+% [setuptext]
+% [rulethickness=1pt,
+% framecolor=green,
+% background=color,
+% backgroundcolor=lightgray]
+
+% titles:
+
+% Description
+% Structure
+% Usage
+% XML example
+% \TeX\ example
+% Configuring
+% Documentation
+
+\continueifinputfile{s-man-10.mkiv}
+
+\startdocument[title=Title,author=Author,palet=steps]
+
+ \startsection[title=Test]
+
+ \input knuth
+
+ \stopsection
+
+\stopdocument
diff --git a/doc/context/sources/general/manuals/steps/steps-mkiv.tex b/doc/context/sources/general/manuals/steps/steps-mkiv.tex
new file mode 100644
index 000000000..947f08fbb
--- /dev/null
+++ b/doc/context/sources/general/manuals/steps/steps-mkiv.tex
@@ -0,0 +1,655 @@
+\environment manuals-xml-environment.tex
+
+\useMPlibrary [ove]
+
+\usemodule[x][mathml]
+\usemodule[m][steps]
+
+\startdocument[title=Steps,author=Hans Hagen,palet=steps]
+
+\startbuffer
+\startSTEPchart
+\cell {A}
+\cell {one} \text{+2}
+\cell {two} \text{+3}
+\cell {three} \text{+4}
+\cell {four} \text{+5}
+\cell {five}
+\stopSTEPchart
+\stopbuffer
+
+\startsection[title=Description]
+
+This module is written in the process of defining a couple of styles for an
+educational math book. The macros provide you a way to visualize steps in for
+instance solving equations.
+
+The horizontal visualization is called stepchart, while the vertical alternative
+carries the name steptable. The vertical alternative has a special case that
+permits alignment on a mid symbol (in most cases a relation).
+
+The implementation uses a combination of \TEX\ and \METAPOST, and is set up in
+such a way that hyperlinks and alike will work okay.
+
+\stopsection
+
+\startsection[title=Structure]
+
+The horizontal stepcharts have at most four rows: two rows of cells with each an
+associated row of texts. The plural elements \type {cells} and \type {texts} each
+have two subelements. The \type {texts} elements are put between \type {cells}.
+
+\startbuffer
+<stepchart>
+ <cells> <top> some text </top> <bot> some text </bot> </cells>
+ <texts> <top> text </top> <bot> text </bot> </texts>
+ <cells> <top> some text </top> <bot> some text </bot> </cells>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+When a singular \type {cell} element is used in combination with the plural \type
+{texts}, we get one row of step cells with both top and bottom texts.
+
+\startbuffer
+<stepchart>
+ <cell> some text </cell>
+ <texts> <top> text </top> <bot> text </bot> </texts>
+ <cell> some text </cell>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+The third horizontal alternative only has singular elements, and as a result the
+texts are put above the step cells.
+
+\startbuffer
+<stepchart>
+ <cell> some cell </cell>
+ <cell> another cell </cell> <text> a bit of text </text>
+ <cell> third cell </cell> <text> more text </text>
+ <cell> last cell </cell>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+Normally, the lines go from cell to cell via a text. When you let the \type
+{cell} element follow by more than one \type {text} element (or their plural
+forms), all lines will start at the same point.
+
+\startbuffer
+<stepchart>
+ <cell> some text </cell>
+ <cell> some text </cell> <text> text 1 </text> <text> text 2 </text>
+ <cell> some text </cell>
+ <cell> some text </cell> <text> text 3 </text>
+ <cell> some text </cell>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+The vertical alternative (of course) looks different and permits pretty long
+explanations.
+
+\startbuffer
+<steptable>
+ <cell> cell 1 </cell>
+ <text> text 1 </text>
+ <cell> cell 2 </cell>
+ <text> text 2 </text>
+ <cell> cell 3 </cell>
+</steptable>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+When the plural element \type {cells} is used, three sub||elements are expected.
+These align around the mid element \type {c2}.
+
+\startbuffer
+<stepaligntable>
+ <cells> <c1> left </c1> <c2> center </c2> <c3> right </c3> </cells>
+ <text> text </text>
+ <cells> <c1> lft </c1> <c2> ctr </c2> <c3> rgt </c3> </cells>
+ <text> text </text>
+ <cells> <c1> l </c1> <c2> c </c2> <c3> r </c3> </cells>
+</stepaligntable>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\stopsection
+
+\startsection[title=Usage]
+
+The step chart module is loaded with:
+
+\starttyping
+\usemodule[cell] % was step
+\stoptyping
+
+\noindentation but in the case of embedded math, you should also load the \MATHML\ module:
+
+\starttyping
+\usemodule[cell,mathml]
+\stoptyping
+
+\stopsection
+
+\startsection[title=\XML\ example]
+
+Because we don't want to clutter the examples with \MATHML\ we stick to a simple
+mapping:
+
+\startbuffer
+\startxmlsetups xml:math:simple
+ \xmlsetsetup {#1} {m} {xml:math:simple:tex}
+\stopxmlsetups
+
+\startxmlsetups xml:math:simple:tex
+ \mathematics{\xmlflush{#1}}
+\stopxmlsetups
+
+\xmlregistersetup{xml:math:simple}
+\stopbuffer
+
+\typebuffer \getbuffer
+
+So, in the next examples the \type {m} element contains \TEX\ math.
+
+\startbuffer
+<stepchart>
+ <cells> <top> A </top> <bot> B </bot> </cells>
+ <cells> <top> one </top> <bot> five </bot> </cells>
+ <texts> <top> <m> +2 </m> </top> <bot> <m> -2 </m> </bot> </texts>
+ <cells> <top> two </top> <bot> four </bot> </cells>
+ <texts> <top> <m> +3 </m> </top> <bot> <m> -3 </m> </bot> </texts>
+ <cells> <top> three </top> <bot> three </bot> </cells>
+ <texts> <top> <m> +4 </m> </top> <bot> <m> -4 </m> </bot> </texts>
+ <cells> <top> four </top> <bot> two </bot> </cells>
+ <texts> <top> <m> +5 </m> </top> <bot> <m> -5 </m> </bot> </texts>
+ <cells> <top> five </top> <bot> one </bot> </cells>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<stepchart>
+ <cell> A </cell>
+ <cell> one </cell> <text> <m> +2 </m> </text>
+ <cell> two </cell> <text> <m> +3 </m> </text>
+ <cell> three </cell> <text> <m> +4 </m> </text>
+ <cell> four </cell> <text> <m> +5 </m> </text>
+ <cell> five </cell>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<steptable>
+ <cell>
+ <math xmlns="mathml">
+ <apply> <eq/> <ci> c </ci>
+ <apply> <plus/>
+ <apply> <times/> <cn> 2 </cn> <ci> a </ci> </apply>
+ <apply> <times/> <cn> 3 </cn> <ci> b </ci> </apply>
+ </apply>
+ </apply>
+ </math>
+ </cell>
+ <text> with
+ <math xmlns="mathml">
+ <apply> <eq/> <ci> a </ci> <cn> 5 </cn> </apply>
+ </math>
+ </text>
+ <cell>
+ <math xmlns="mathml">
+ <apply> <eq/> <ci> c </ci>
+ <apply> <plus/> <cn> 10 </cn>
+ <apply> <times/> <cn> 3 </cn> <ci> b </ci> </apply>
+ </apply>
+ </apply>
+ </math>
+ </cell>
+ <text> and
+ <math xmlns="mathml">
+ <apply> <eq/> <ci> b </ci> <cn> 6 </cn> </apply>
+ </math>
+ </text>
+ <cell>
+ <math xmlns="mathml">
+ <apply> <eq/> <ci> c </ci>
+ <apply> <plus/> <cn> 10 </cn> <cn> 18 </cn> </apply>
+ </apply>
+ </math>
+ </cell>
+ <text>
+ we get
+ </text>
+ <cell>
+ <math xmlns="mathml">
+ <apply> <eq/> <ci> c </ci> <cn> 28 </cn> </apply>
+ </math>
+ </cell>
+</steptable>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<stepaligntable>
+ <cells>
+ <c1> <m>c</m> </c1> <c2> <m>=</m> </c2> <c3> <m>2a+3b</m> </c3>
+ </cells>
+ <text>
+ with <m>a=5</m>
+ </text>
+ <cells>
+ <c1> <m>c</m> </c1> <c2> <m>=</m> </c2> <c3> <m>10+3b</m> </c3>
+ </cells>
+ <text>
+ and <m>b=6</m>
+ </text>
+ <cells>
+ <c1> <m>c</m> </c1> <c2> <m>=</m> </c2> <c3> <m>10+18</m> </c3>
+ </cells>
+ <text>
+ we get
+ </text>
+ <cells>
+ <c1> <m>c</m> </c1> <c2> <m>=</m> </c2> <c3> <m>28</m> </c3>
+ </cells>
+</stepaligntable>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\stopsection
+
+\startsection[title=\TEX\ example]
+
+\startbuffer
+\startSTEPchart
+\cells {A} {B}
+\cells {one} {five or more} \texts{$+2$}{$-2$}
+\cells {two} {four} \texts{$+3$}{$-3$}
+\cells {three} {three} \texts{$+4$}{$-4$}
+\cells {four} {two} \texts{$+5$}{$-5$}
+\cells {five or more} {one}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPchart
+\cell {A}
+\cell {one} \texts{$+2$}{$-2$}
+\cell {two} \texts{$+3$}{$-3$}
+\cell {three} \texts{$+4$}{$-4$}
+\cell {four} \texts{$+5$}{$-5$}
+\cell {five or more}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPchart
+\cells {A} {B}
+\cells {one} {five or more} \texts{$+2$}{}
+\cells {two} {four} \texts{}{$-3$}
+\cells {three} {three} \texts{$+4$}{}
+\cells {four} {two} \texts{}{$-5$}
+\cells {five or more} {one}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPchart
+\cell {A}
+\cell {one} \text{+2} \text{+3} \text{+4} \text{+5}
+\cell {two}
+\cell {three}
+\cell {four}
+\cell {five}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPchart
+\cell {A}
+\cell {one} \texts{}{+2} \texts{}{+3}
+\cell {two}
+\cell {three} \texts{+4}{} \texts{+5}{}
+\cell {four}
+\cell {five}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPchart
+\cell {A}
+\cell {one} \text{+2}
+\cell {two} \text{+3}
+\cell {three} \text{+4}
+\cell {four} \text{+5}
+\cell {five}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPtable
+\cell {$c=2a+3b$}
+\text {with $a=5$}
+\cell {$c=10+3b$}
+\text {and $b=6$}
+\cell {$c=10+18$}
+\text {we get}
+\cell {$c=28$}
+\stopSTEPtable
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPaligntable
+\cells {$2c$} {$=$} {$2a+3b$}
+\text {with $a=5$}
+\cells {$2c$}{$=$} {$10+3b$}
+\text {and $b=6$}
+\cells {$2c$} {$=$} {$10+18$}
+\text {we get}
+\cells {$2c$} {$=$} {$28$}
+\text {and therefore}
+\cells {$c$} {$=$} {$28/2$}
+\text {which reduces to}
+\cells {$c$} {$=$} {$14$}
+\stopSTEPaligntable
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startSTEPchart
+ \cells {A} {B}
+ \cells {one} {five} \texts{$+2$}{$-2$}
+ \cells {two} {four} \texts{$+3$}{$-3$}
+ \cells {three} {three} \texts{$+4$}{$-4$}
+ \cells {four} {two} \texts{$+5$}{$-5$}
+ \cells {five} {one}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\stopsection
+
+\startsection[title=Configuring]
+
+The charts and tables can have their own spacing set. Quite certainly the
+distances between cells will differ.
+
+\starttabulate[|Tl|l|]
+\HL
+\NC \rlap{\tex{setupSTEPcharts} \tex{setupSTEPtables}} \NC \NC \NR
+\HL
+\NC after \NC hook for commands to execute after the table \NC \NR
+\NC before \NC hook for commands to execute before the table \NC \NR
+% \NC method \NC line drawing method\NC \NR
+% \NC height \NC height of the connecting line \NC \NR
+% \NC offset \NC the distance between lines and cells and texts \NC \NR
+% \NC hoffset \NC the horizontal distance between cells \NC \NR
+% \NC voffset \NC the vertical distance between cells \NC \NR
+\HL
+\stoptabulate
+
+Both charts and tables have common settings with respect to the cells, texts and
+lines.
+
+\starttabulate[|Tl|l|]
+\HL
+\NC \rlap{\tex{setupSTEPcells} \tex{setupSTEPtexts}} \NC \NC \NR
+\HL
+\NC alternative \NC the kind of shape to be drawn \NC \NR
+\NC backgroundcolor \NC the background color identified by name \NC \NR
+\NC rulethickness \NC the width of frame around cells \NC \NR
+\NC framecolor \NC the frame color identified by name \NC \NR
+\NC offset \NC the space between content and frame \NC \NR
+\NC style \NC a (preferable named) style \NC \NR
+\NC color \NC the color of the content \NC \NR
+\HL
+\stoptabulate
+
+\starttabulate[|Tl|l|]
+\HL
+\NC \rlap{\tex{setupSTEPlines}} \NC \NC \NR
+\HL
+\NC alternative \NC the kind of line to draw between cells \NC \NR
+\NC distance \NC the distance between lines and text \NC \NR
+\NC offset \NC the shift to the right of the start of the line \NC \NR
+\NC height \NC the height of the (curved) line \NC \NR
+\NC rulethickness \NC the width of the lines between cells \NC \NR
+\NC color \NC the line color identified by name \NC \NR
+\HL
+\stoptabulate
+
+In \TEX, some of the settings, like \type {style} and \type {color} can be set
+between elements. In \XML, the settings are passed as processing instructions.
+
+\startbuffer
+\startSTEPchart
+\cell {A}
+\cell {one} \text{+2}
+\cell {two} \text{+3}
+\start
+ \setupSTEPcells[color=darkred,style=bold]
+ \cell {three} \text{+4}
+ \cell {four} \text{+5}
+\stop
+\cell {five}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+There are a couple of alternative shapes available. The most relevant ones are:
+\removeunwantedspaces \dostepwiserecurse {5} {9} {1} { \TestShape {\recurselevel}}
+\removeunwantedspaces \dostepwiserecurse {12} {19} {1} { \TestShape {\recurselevel}}
+\removeunwantedspaces \dostepwiserecurse {22} {29} {1} { \TestShape {\recurselevel}}.
+
+Although it is not too wise to set up the layout in the middle of a document, for
+graphics one can seldom get by some local fine||tuning. Here we encounter a
+rather fundamental difference between \TEX\ and \XML. In \TEX, you can easily
+change settings on a temporary basis by using groups. In \XML\ on the other hand,
+settings are bound to a category. So, in \TEX\ you can do this:
+
+\startbuffer
+\setupSTEPcells
+ [important]
+ [color=darkgreen,
+ style=bold]
+
+\startSTEPchart
+\cell {A}
+\cell {one} \text{+2}
+\cell {two} \text{+3}
+\cell [important] {three} \text{+4}
+\cell [important] {four} \text{+5}
+\cell {five}
+\stopSTEPchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\noindentation An \XML\ example is:
+
+\startbuffer
+\setupSTEPcells[demo-1][alternative=5]
+\setupSTEPcells[demo-1][framecolor=darkred]
+\setupSTEPtexts[demo-1][framecolor=darkgreen]
+\setupSTEPlines[demo-1][alternative=4]
+\setupSTEPtexts[demo-2][style=bold]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\noindentation This will be applied to:
+
+\startbuffer
+<steptable class="demo-1">
+ <cell> type 5 </cell>
+ <text> type 6 </text>
+ <cell> type 7 </cell>
+ <text class="demo-2"> type 8 </text>
+ <cell> type 9 </cell>
+</steptable>
+\stopbuffer
+
+\typebuffer
+
+\noindentation so that we get:
+
+\processxmlbuffer
+
+You can also use processing instructions:
+
+\startbuffer
+<stepchart>
+ <cells> <top> some text 1 </top> <bot> some text 2 </bot> </cells>
+ <?context-stepchart-directive text color darkred ?>
+ <texts> <top> text 3 </top> <bot> text 4 </bot> </texts>
+ <cells> <top> some text 5 </top> <bot> some text 6 </bot> </cells>
+ <?context-stepchart-directive text color darkblue ?>
+ <texts> <top> text 7t </top> </texts>
+ <cells> <top> some text 8 </top> </cells>
+</stepchart>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<steptable>
+ <?context-stepchart-directive cell alternative 12 ?>
+ <cell> cell 12 </cell> <text> 12 to 13 </text>
+ <?context-stepchart-directive cell alternative 13 ?>
+ <cell> cell 13 </cell> <text> 13 to 14 </text>
+ <?context-stepchart-directive cell alternative 14 ?>
+ <cell> cell 14 </cell> <text> 14 to 15 </text>
+ <?context-stepchart-directive cell alternative 15 ?>
+ <cell> cell 15 </cell>
+</steptable>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+Some settings apply to the whole chart. In \TEX\ this is easy since we
+can group the whole chart including settings but in \XML\ this is somewhat
+problematic. We can however fall back on basic tex commands but it's
+probably better to use as category (class), like:
+
+\startbuffer
+\setupSTEPtexts[demo-5][distance=3em]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\noindentation So, the following works as expected:
+
+\startbuffer
+<document>
+ <?context-tex-directive start ?>
+ <?context-stepchart-directive text distance 1em ?>
+ <stepaligntable>
+ <cells> <c1>a</c1> <c2>b</c2> <c3>c</c3> </cells>
+ <text> test 1 </text>
+ <cells> <c1>aa</c1> <c2>b</c2> <c3>ccc</c3> </cells>
+ </stepaligntable>
+ <?context-tex-directive stop ?>
+ <stepaligntable>
+ <cells> <c1>a</c1> <c2>b</c2> <c3>c</c3> </cells>
+ <text> test 2 </text>
+ <cells> <c1>aa</c1> <c2>b</c2> <c3>ccc</c3> </cells>
+ </stepaligntable>
+ <stepaligntable class="demo-5">
+ <cells> <c1>a</c1> <c2>b</c2> <c3>c</c3> </cells>
+ <text> test 3 </text>
+ <cells> <c1>aa</c1> <c2>b</c2> <c3>ccc</c3> </cells>
+ </stepaligntable>
+</document>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<document>
+ <?context-tex-directive start ?>
+ <?context-stepchart-directive cell dx 10ex ?>
+ <stepchart>
+ <cells> <top> from here </top> <bot> there </bot> </cells>
+ <texts> <top> to </top> <bot> to </bot> </texts>
+ <cells> <top> and here </top> <bot> there </bot> </cells>
+ </stepchart>
+ <?context-tex-directive stop ?>
+</document>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<document>
+ <?context-tex-directive start ?>
+ <?context-stepchart-directive line height 30pt ?>
+ <?context-stepchart-directive line offset 5pt ?>
+ <steptable>
+ <cell> some cell </cell>
+ <cell> another cell </cell> <text> a bit of text </text>
+ <cell> third cell </cell> <text> more text </text>
+ <cell> last cell </cell>
+ </steptable>
+ <?context-tex-directive stop ?>
+</document>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<document>
+ <?context-tex-directive start ?>
+ <?context-stepchart-directive line height 30pt ?>
+ <?context-stepchart-directive line offset 15pt ?>
+ <stepchart>
+ <cell> some cell </cell>
+ <cell> another cell </cell> <text> a bit of text </text>
+ <cell> third cell </cell> <text> more text </text>
+ <cell> last cell </cell>
+ </stepchart>
+ <?context-tex-directive stop ?>
+</document>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\stopsection
+
+\startsection[title=Documentation]
+
+There is no additional documentation on this module.
+
+\stopsection
+
+\stopdocument