3 <style|<tuple|source|std>>
7 <src-package|std-fold|1.0>
10 Macros for folding and switches.
13 <src-copyright|1998--2005|Joris van der Hoeven>
16 This software falls under the <hlink|GNU general public license,
17 version 3 or later|$TEXMACS_PATH/LICENSE>. It comes WITHOUT ANY
18 WARRANTY WHATSOEVER. You should have received a copy of the license
19 which the software. If not, see <hlink|http://www.gnu.org/licenses/gpl-3.0.html|http://www.gnu.org/licenses/gpl-3.0.html>.
25 Rendering folding tags.
29 <assign|render-folded-std|<\macro|button|body>
30 <with|par-left|<plus|<value|par-left>|1.5fn>|<style-with|src-compact|none|<\surround|<with|par-first|-1.5fn|<yes-indent>><arg|button>|<hflush>>
35 <assign|default-padded-normal|<value|padded-normal>>
37 <assign|folded-padded-normal|<macro|a|b|body|<\surround|<vspace*|<arg|a>>|<htab|0fn|first><vspace|<arg|b>>>
38 <\with|padded-normal|<value|default-padded-normal>>
43 <assign|render-folded-env|<\macro|button|body>
44 <\surround|<with|par-first|-1.5fn|<yes-indent><arg|button>>|<right-flush>>
45 <\with|default-padded-normal|<value|padded-normal>|padded-normal|<value|folded-padded-normal>>
51 <assign|render-folded-explain|<\macro|tit|body>
52 <\surround|<no-indent><vspace*|0.5fn>|<vspace|0.5fn><right-flush>>
53 <with|font-series|bold|<arg|tit>><vspace|0.5fn>
59 <assign|render-folded-grouped|<\macro|button|body>
60 <\with|old-color|<value|color>|color|blue>
61 <tabular|<tformat|<twith|table-width|1par>|<twith|table-hmode|exact>|<cwith|1|1|2|2|cell-hpart|1>|<cwith|1|1|1|1|cell-lsep|0ln>|<cwith|1|1|1|1|cell-rsep|0ln>|<cwith|1|1|1|1|cell-bsep|0ln>|<cwith|1|1|1|1|cell-tsep|0ln>|<cwith|1|1|1|1|cell-width|20ln>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|2|2|cell-hyphen|t>|<table|<row|<cell|<subtable|<tformat|<cwith|1|-1|1|-1|cell-background|pastel
62 blue>|<cwith|2|2|2|2|cell-background|>|<cwith|1|-1|1|1|cell-lborder|0.5ln>|<cwith|1|1|1|-1|cell-tborder|0.5ln>|<cwith|3|3|1|-1|cell-bborder|0.5ln>|<cwith|3|3|2|2|cell-rborder|0.5ln>|<cwith|3|3|2|2|cell-tborder|0.5ln>|<cwith|1|1|2|2|cell-rborder|0.5ln>|<cwith|1|1|2|2|cell-bborder|0.5ln>|<cwith|2|2|1|1|cell-rborder|0.5ln>|<cwith|1|-1|2|2|cell-width|6ln>|<cwith|1|-1|2|2|cell-hmode|exact>|<cwith|1|-1|1|-1|cell-lsep|0ln>|<cwith|1|-1|1|-1|cell-rsep|0ln>|<cwith|1|-1|1|-1|cell-bsep|0ln>|<cwith|1|-1|1|-1|cell-tsep|0ln>|<cwith|2|2|1|1|cell-halign|l>|<cwith|1|-1|1|-1|cell-vcorrect|n>|<cwith|2|2|1|-1|cell-vpart|1>|<cwith|1|-1|2|2|cell-hpart|1>|<cwith|1|-1|1|1|cell-width|6ln>|<cwith|1|-1|1|1|cell-hmode|exact>|<cwith|3|3|1|-1|cell-height|6ln>|<cwith|3|3|1|-1|cell-vmode|exact>|<cwith|1|1|1|-1|cell-height|6ln>|<cwith|1|1|1|-1|cell-vmode|exact>|<cwith|1|-1|1|-1|cell-valign|c>|<table|<row|<cell|<arg|button>>|<cell|<arg|button>>>|<row|<cell|<arg|button>>|<cell|<arg|button>>>|<row|<cell|<arg|button>>|<cell|<arg|button>>>>>>>|<\cell>
63 <\with|color|<value|old-color>>
72 Tags for folding and unfolding.
76 <assign|folded-plain|<\macro|x|y>
77 <\surround||<right-flush>>
84 <assign|unfolded-plain|<\macro|x|y>
85 <\surround||<right-flush>>
92 <assign|folded-std|<\macro|x|y>
93 <\render-folded-std|<action|<resize|<active*|<with|mode|math|<op|\<circ\>>>>|||r]1.5fn|>|(mouse-unfold)|<arg|x>>>
100 <assign|unfolded-std|<\macro|x|y>
101 <\render-folded-std|<action|<resize|<active*|<with|mode|math|\<bullet\>>>|||r]1.5fn|>|(mouse-fold)|<arg|x>>>
108 <assign|folded-env|<\macro|x|y>
109 <\render-folded-env|<action|<resize|<specific|screen|<active*|<with|mode|math|<op|\<circ\>>>>>|||r]1.5fn|>|(mouse-unfold)|<arg|x>>>
116 <assign|unfolded-env|<\macro|x|y>
117 <\render-folded-env|<action|<resize|<specific|screen|<active*|<with|mode|math|\<bullet\>>>>|||r]1.5fn|>|(mouse-fold)|<arg|x>>>
124 <assign|folded-explain|<\macro|x|y>
125 <\render-folded-explain|<with|color*|<value|color>|<action|<with|color|<value|color*>|<arg|x>>|(mouse-unfold)|<arg|x>>>>
127 </render-folded-explain>
130 <assign|unfolded-explain|<\macro|x|y>
131 <\render-folded-explain|<with|color*|<value|color>|<action|<with|color|<value|color*>|<arg|x>>|(mouse-fold)|<arg|x>>>>
133 </render-folded-explain>
136 <assign|folded-grouped|<\macro|x|y>
137 <\render-folded-grouped|<action| |(mouse-unfold)|<arg|x>>>
141 </render-folded-grouped>
144 <assign|unfolded-grouped|<\macro|x|y>
145 <\render-folded-grouped|<action| |(mouse-fold)|<arg|x>>>
149 </render-folded-grouped>
152 <assign|folded|<value|folded-std>>
154 <assign|unfolded|<value|unfolded-std>>
158 <drd-props|folded-plain|arity|2|accessible|0|hidden|1>
160 <drd-props|folded-std|arity|2|accessible|0|hidden|1>
162 <drd-props|folded-env|arity|2|accessible|0|hidden|1>
164 <drd-props|folded-explain|arity|2|accessible|0|hidden|1>
166 <drd-props|folded-grouped|arity|2|accessible|0|hidden|1>
168 <drd-props|folded|arity|2|accessible|0|hidden|1>
172 Tags for toggling between summarized and detailed text.
176 <assign|summarized-plain|<\macro|x|y>
177 <\surround||<right-flush>>
182 <assign|detailed-plain|<\macro|x|y>
183 <\surround||<right-flush>>
188 <assign|summarized-std|<\macro|x|y>
189 <\render-folded-std|<action|<resize|<specific|screen|<active*|<with|mode|math|<op|\<circ\>>>>>|||r]1.5fn|>|(mouse-unfold)|<arg|x>>>
194 <assign|detailed-std|<\macro|x|y>
195 <\render-folded-std|<action|<resize|<specific|screen|<active*|<with|mode|math|\<bullet\>>>>|||r]1.5fn|>|(mouse-fold)|<arg|x>>>
200 <assign|summarized-env|<\macro|x|y>
201 <\render-folded-env|<action|<resize|<specific|screen|<active*|<with|mode|math|<op|\<circ\>>>>>|||r]1.5fn|>|(mouse-unfold)|<arg|x>>>
206 <assign|detailed-env|<\macro|x|y>
207 <\render-folded-env|<action|<resize|<specific|screen|<active*|<with|mode|math|\<bullet\>>>>|||r]1.5fn|>|(mouse-fold)|<arg|x>>>
212 <assign|summarized-grouped|<\macro|x|y>
213 <\render-folded-grouped|<action| |(mouse-unfold)|<arg|x>>>
215 </render-folded-grouped>
218 <assign|detailed-grouped|<\macro|x|y>
219 <\render-folded-grouped|<action| |(mouse-fold)|<arg|x>>>
221 </render-folded-grouped>
224 <assign|summarized-raw|<macro|x|y|<arg|x>>>
226 <assign|detailed-raw|<macro|x|y|<arg|y>>>
228 <assign|unfold-summarized|<macro|x|<action|<arg|x>|(mouse-unfold)|<arg|x>>>>
230 <assign|fold-detailed|<macro|x|<action|<arg|x>|(mouse-fold)|<arg|x>>>>
232 <assign|summarized-tiny|<macro|x|y|<action|<arg|x>|(mouse-unfold)|<arg|x>>>>
234 <assign|detailed-tiny|<macro|x|y|<arg|y>>>
236 <assign|summarized|<value|summarized-env>>
238 <assign|detailed|<value|detailed-env>>
242 <drd-props|summarized-plain|arity|2|accessible|0|hidden|1>
244 <drd-props|summarized-std|arity|2|accessible|0|hidden|1>
246 <drd-props|summarized-env|arity|2|accessible|0|hidden|1>
248 <drd-props|summarized-grouped|arity|2|accessible|0|hidden|1>
250 <drd-props|summarized-tiny|arity|2|accessible|0|hidden|1>
252 <drd-props|summarized|arity|2|accessible|0|hidden|1>
254 <drd-props|detailed-plain|arity|2|accessible|1|hidden|0>
256 <drd-props|detailed-std|arity|2|accessible|1|hidden|0>
258 <drd-props|detailed-env|arity|2|accessible|1|hidden|0>
260 <drd-props|detailed-grouped|arity|2|accessible|1|hidden|0>
262 <drd-props|detailed-tiny|arity|2|accessible|1|hidden|0>
264 <drd-props|detailed|arity|2|accessible|1|hidden|0>
272 <assign|document-block|<\xmacro|switch-args>
273 <surround||<right-flush>|<\quasi>
274 <unquote*|<quote-arg|switch-args>>
278 <assign|tiny-block|<xmacro|switch-args|<map-args|identity|concat|switch-args>>>
280 <assign|slide|<\macro|body>
281 <\surround||<right-flush><new-page>>
286 <assign|slides-block|<\xmacro|switch-args>
287 <surround||<right-flush>|<\quasi>
288 <unquote*|<map|slide|<quote-arg|switch-args>>>
294 <assign|switch|<value|document-block>>
296 <assign|screens|<value|document-block>>
298 <assign|tiny-switch|<value|tiny-block>>
300 <assign|unroll|<value|document-block>>
302 <assign|expanded|<value|document-block>>
304 <assign|slides|<value|slides-block>>
308 <drd-props|switch|arity|<tuple|repeat|1|1>|accessible|all>
310 <drd-props|screens|arity|<tuple|repeat|1|1>|accessible|all|border|no>
312 <drd-props|tiny-switch|arity|<tuple|repeat|1|1>|accessible|all>
314 <drd-props|unroll|arity|<tuple|repeat|1|1>|accessible|all>
316 <drd-props|expanded|arity|<tuple|repeat|1|1>|accessible|all>
318 <drd-props|slides|arity|<tuple|repeat|1|1>|accessible|all>
322 <assign|traversed|<value|identity>>
324 <assign|fold-back|<value|identity>>
326 <assign|keep-unfolded|<value|identity>>
334 <assign|show-preamble|<\macro|body>
335 <with|mode|src|preamble|true|par-first|0fn|par-par-sep|0.5fn|<arg|body>>
338 <assign|hide-preamble|<\macro|body>
342 <assign|show-part|<\macro|id|active|inactive>
343 <set-part|<arg|id>|<arg|active>>
346 <assign|hide-part|<\macro|id|active|inactive>
347 <hidden|<set-part|<arg|id>|<if|<sectional-short-style>|<arg|active>|<arg|inactive>>>>
350 <drd-props|show-preamble|border|no>
352 <drd-props|hide-preamble|border|no>
354 <drd-props|show-part|border|no>
356 <drd-props|hide-part|border|no|arity|3|hidden|1>
363 <associate|preamble|true>