-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprozess-style.tex
135 lines (113 loc) · 3.87 KB
/
prozess-style.tex
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
% !TEX TS-program = ConTeXt (LuaTeX 1.0.9)
% Copyright 2019 Axel Kielhorn
% Lizenz: CC-BY-SA 4.0 Unported http://creativecommons.org/licenses/by-sa/4.0/deed.de
% Aufruf mit
% context --environment=prozess-style.tex prozess.xml
\startluacode
settings = {}
docstruktur = {}
doclistfile = "doclist.xml"
local striplines = utilities.strings.striplines
local xmltext = xml.text
doc = xml.load(doclistfile, settings)
for v in xml.collected(doc,"/doclist/psdoc/") do
local docnr = striplines(xmltext(v,"/docnr"))
local docname = striplines(xmltext(v,"/docname"))
-- es kann mehrere DOCAN geben!
local docan = striplines(xmltext(v,"/docan"))
local docverantwortlich = striplines(xmltext(v,"/docverantwortlich"))
docstruktur[docnr]={
docname = docname,
docan = docan,
docverantwortlich = docverantwortlich
}
end
\stopluacode
\startluacode
local striplines = utilities.strings.striplines
local xmltext = xml.text
function xml.finalizers.tex.PsOutdoc(e)
local docnr = striplines(xml.text(e[1],"//docnr"))
local c = docstruktur[docnr]
context ("\\inmargin{" .. c["docan"] .. " $\\Leftarrow$}" .. "{\\bf " .. docnr .. "} " .. c["docname"])
end
\stopluacode
\startluacode
local striplines = utilities.strings.striplines
local xmltext = xml.text
function xml.finalizers.tex.PsIndoc(e)
local docnr = striplines(xml.text(e[1],"//docnr"))
local c = docstruktur[docnr]
context ("\\inmargin{" .. c["docverantwortlich"] .. " $\\Rightarrow$}" .. "{\\bf " .. docnr .. "} " .. c["docname"])
end
\stopluacode
\language[de]
\setbreakpoints[compound]
\setuphyphenation[method=expanded]
\setuppapersize [A4,landscape][A4,landscape]
\setuplayout [width=middle, backspace=2in, cutspace=1in, leftmargin=1.5in,
height=middle, topspace=0.75in, bottomspace=0.75in]
\setuppagenumbering[location={footer,right}]
\setupheader[text][start]
\setupfooter[text][start]
%\setupheadertexts[][\date]
\setupheadertexts[title][\date]
\setuphead[title]
[placehead=empty,
before=,
after=,
page=,]
\startxmlsetups xml:prozessb
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{prozess|pschritt|psindoc|psoutdoc|aschritt|eschritt}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:prozessb}
\startxmlsetups xml:prozess
\title{\xmltext{#1}{/pnr} \xmltext{#1}{/pname}}
% \setupheadertexts[\bf\xmltext{#1}{/pnr} \xmltext{#1}{/pname}][\date]
{\bTABLE
\setupTABLE[frame=off]
\setupTABLE[offset=1mm]
\setupTABLE[c][1][align=right, width=14cm]
\setupTABLE[c][2][align=left, width=6cm]
\setupTABLE[c][3][align=right, width=4cm]
\bTR \bTD \bfb\xmltext{#1}{/pnr} \eTD \bTD Version: \eTD \bTD \bf\xmltext{#1}{/pversion}\eTD \eTR
\bTR \bTD \bfb\xmltext{#1}{/pname} \eTD \bTD Verantwortlich: \eTD \bTD \bf\xmltext{#1}{/pverantwortlich}\eTD\eTR
\eTABLE}
\blank
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:pschritt
\inmargin{\bf \xmltext{#1}{../pnr}.\xmltext{#1}{/psnr}}
{\bf \xmldoifelse{#1}{/pslang}{\xmltext{#1}{/pslang}}{\xmltext{#1}{/pskurz}}}
\blank
\xmlflush{#1}
\blank
\stopxmlsetups
\startxmlsetups xml:psindoc
\xmlfilter{#1}{./PsIndoc()}
% \inmargin{\xmltext{#1}{/docverantwortlich} $\Rightarrow$} {\bf \xmltext{#1}{/docnr}} \xmltext{#1}{/docname}
\blank
\stopxmlsetups
\startxmlsetups xml:psoutdoc
\xmlfilter{#1}{./PsOutdoc()}
% \inmargin{\xmlconcat{#1}{/docan}{, } $\Leftarrow$} {\bf \xmltext{#1}{/docnr}} \xmltext{#1}{/docname}
\blank
\stopxmlsetups
%\startxmlsetups xml:docan
% \xmlflush{#1}
% \stopxmlsetups
\startxmlsetups xml:aschritt
\color[darkgreen]{
\inmargin{\color[darkgreen]{\xmltext{#1}{/asverantwortlich}}}
{\xmldoifelse{#1}{/aslang}{\xmltext{#1}{/aslang}}{\xmltext{#1}{/askurz}}}
\xmlflush{#1}
}
\blank
\stopxmlsetups
\startxmlsetups xml:eschritt
\color[red]{
{\xmldoifelse{#1}{/eslang}{\xmltext{#1}{/eslang}}{\xmltext{#1}{/eskurz}}}
\xmlflush{#1}}
\blank
\stopxmlsetups