summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-steps.mkii
blob: 47141699a933458bc14d8fe369f2cb5285960f28 (plain)
1
2
3
4
5
6
7
8
9
10
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%D \module
%D   [       file=m-steps,
%D        version=2001.05.28,
%D          title=\CONTEXT\ Modules,
%D       subtitle=Step Charts \& Tables,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D The \XML\ interface:

\usemodule[m][steps]

\unprotect

\defineXMLdirective [stepchart] [charts] \setupSTEPcharts
\defineXMLdirective [stepchart] [cells]  \setupSTEPcells
\defineXMLdirective [stepchart] [texts]  \setupSTEPtexts
\defineXMLdirective [stepchart] [lines]  \setupSTEPlines

\defineXMLdirective [steptable] [tables] \setupSTEPtables
\defineXMLdirective [steptable] [cells]  \setupSTEPcells
\defineXMLdirective [steptable] [texts]  \setupSTEPtexts
\defineXMLdirective [steptable] [lines]  \setupSTEPlines

\defineXMLpickup[stepchart][@@STPC]
  {\bgroup
   \defineXMLpush[top]%
   \defineXMLpush[bot]%
   \defineXMLenvironment[lines][@@STEL]
     {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
     {\stoplines}%
   \defineXMLenvironment[cells][@@STEC]
     {\XMLerase{top}\XMLerase{bot}}
     {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{top}}{\XMLpop{bot}}}}%
   \defineXMLenvironment[texts][@@STET]
     {\XMLerase{top}\XMLerase{bot}}
     {\expanded{\texts[\theXMLarguments{@@STET}]{\XMLpop{top}}{\XMLpop{bot}}}}%
   \defineXMLenvironmentpush[cell][@@STEC]
     {\XMLerase{cell}}
     {\expanded{\cell [\theXMLarguments{@@STEC}]{\XMLpop{cell}}}}%
   \defineXMLenvironmentpush [text] [@@STET]
     {\XMLerase{text}}
     {\expanded{\text [\theXMLarguments{@@STET}]{\XMLpop{text}}}}%
   \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}}
  {\stopSTEPchart
   \egroup}

\defineXMLpickup[steptable][@@STPT]
  {\bgroup
   \defineXMLenvironment[lines][@@STEL]
     {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
     {\stoplines}%
   \defineXMLargument[cell][@@STEC]
     {\expanded{\cell[\theXMLarguments{@@STEC}]}}%
   \defineXMLargument[text][@@STET]
     {\expanded{\text[\theXMLarguments{@@STET}]}}%
   \defineXMLargument[prep]
     {\prep}%
   \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}}
  {\stopSTEPtable
   \egroup}

\defineXMLpickup[stepaligntable][@@STPT]
  {\bgroup
    \defineXMLenvironment[lines][@@STEL]
      {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}}
      {}%
   \defineXMLpush[c1]\defineXMLpush[c2]\defineXMLpush[c3]%
   \defineXMLenvironment[cells][@@STEC]
     {\XMLerase{c1}\XMLerase{c1}\XMLerase{c3}}
     {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{c1}}{\XMLpop{c2}}{\XMLpop{c3}}}}%
   \defineXMLargument[text][@@STET]
     {\expanded{\text[\theXMLarguments{@@STET}]}}%
   \defineXMLargument[prep]
     {\prep}%
   \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}}
  {\stopSTEPaligntable
   \egroup}

\protect \endinput