1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\unprotect
17
18\installcorenamespace{hemistich}
19
20\installcommandhandler \??hemistich {hemistich} \??hemistich
21
22\setuphemistich
23 [\c!width=\v!local,
24 \c!distance=4\emwidth,
25 \c!separator=\vl\hskip.25em\vl]
26
27\unexpanded\def\hemistiches
28 {\dosingleempty\dohemistiches}
29
30\unexpanded\def\dohemistiches
31 {\dodohemistiches\empty}
32
33\unexpanded\def\dodohemistiches#1[#2]#3#4
34 {\dontleavehmode
35 \begingroup
36 \doifelseassignment{#2}
37 {\edef\currenthemistich{#1}
38 \setupcurrenthemistich[#2]}
39 {\def\currenthemistich{#2}}
40 \doifelse{\hemistichparameter\c!width}\v!local
41 {\scratchwidth\availablehsize}
42 {\scratchwidth\hemistichparameter\c!width\relax}
43 \spaceskip\zeropoint\s!plus\plusone\s!fill\relax
44 \dostarttagged\t!division\currenthemistich
45 \hbox to \scratchwidth\bgroup
46 \scratchwidth.5\dimexpr\scratchwidth\hemistichparameter\c!distance\relax
47 \hbox to \scratchwidth\bgroup
48 \dostarttagged\t!construct\c!lefttext
49 \usehemistichstyleandcolor\c!leftstyle\c!leftcolor#3
50 \dostoptagged
51 \egroup
52 \hss
53 \begingroup
54 \dostarttagged\t!construct\c!separator
55 \usehemistichstyleandcolor\c!separatorstyle\c!separatorcolor
56 \hemistichparameter\c!separator
57 \dostoptagged
58 \endgroup
59 \hss
60 \hbox to \scratchwidth\bgroup
61 \dostarttagged\t!construct\c!righttext
62 \usehemistichstyleandcolor\c!rightstyle\c!rightcolor#4
63 \dostoptagged
64 \egroup
65 \egroup
66 \dostoptagged
67 \endgroup}
68
69\unexpanded\def\hemistichescaesura#1#2#3
70 {\dodohemistiches\empty[\c!separator={#2}]{#1}{#3}}
71
72\appendtoks
73 \setvalue{\currenthemistich}{\dohemistiches{\currenthemistich}}
74\to \everydefinehemistich
75
76\protect
77
78\continueifinputfile{mhemistich.mkiv}
79
80\setuphemistich
81 [leftcolor=darkred,
82 separatorcolor=darkgreen,
83 rightcolor=darkblue]
84
85\setupwhitespace
86 [big]
87
88\starttext
89
90
91
92\hemistichescaesura{left side of the brain}{equals}{right side of the brain}
93
94\hemistiches{left side of the brain}{right side of the brain}
95
96\startitemize
97 \startitem
98 \hemistiches{left side of the brain}{right side of the brain}
99 \startitemize
100 \startitem
101 \hemistiches{left side of the brain}{right side of the brain}
102 \startitemize
103 \startitem
104 \hemistiches{left side of the brain}{right side of the brain}
105 \stopitem
106 \stopitemize
107 \stopitem
108 \stopitemize
109 \startitem
110 \hemistiches{left side of the brain}{right side of the brain}
111 \stopitem
112 \stopitem
113\stopitemize
114
115\startitemize
116\item \hemistiches{left side of the brain}{right side of the brain}
117\stopitemize
118
119\stoptext
120
121 |