Improvements for Mathemagix
[texmacs.git] / src / TeXmacs / packages / standard / std-fold.ts
blob72871d54abd528a593ecc67fea17aa14bf9aff56
1 <TeXmacs|1.0.7.2>
3 <style|<tuple|source|std>>
5 <\body>
6   <active*|<\src-title>
7     <src-package|std-fold|1.0>
9     <\src-purpose>
10       Macros for folding and switches.
11     </src-purpose>
13     <src-copyright|1998--2005|Joris van der Hoeven>
15     <\src-license>
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>.
20     </src-license>
21   </src-title>>
23   <\active*>
24     <\src-comment>
25       Rendering folding tags.
26     </src-comment>
27   </active*>
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>>
31       <arg|body>
32     </surround>>>
33   </macro>>
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>>
39       <arg|body>
40     </with>
41   </surround>>>
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>>
46         <arg|body>
47       </with>
48     </surround>
49   </macro>>
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>
55       <arg|body>
56     </surround>
57   </macro>>
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>>
64           <arg|body>
65         </with>
66       </cell>>>>>
67     </with>
68   </macro>>
70   <\active*>
71     <\src-comment>
72       Tags for folding and unfolding.
73     </src-comment>
74   </active*>
76   <assign|folded-plain|<\macro|x|y>
77     <\surround||<right-flush>>
78       <arg|x>
80       <hidden|<arg|y>>
81     </surround>
82   </macro>>
84   <assign|unfolded-plain|<\macro|x|y>
85     <\surround||<right-flush>>
86       <arg|x>
88       <arg|y>
89     </surround>
90   </macro>>
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>>>
94       <arg|x>
96       <hidden|<arg|y>>
97     </render-folded-std>
98   </macro>>
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>>>
102       <arg|x>
104       <arg|y>
105     </render-folded-std>
106   </macro>>
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>>>
110       <arg|x>
112       <hidden|<arg|y>>
113     </render-folded-env>
114   </macro>>
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>>>
118       <arg|x>
120       <arg|y>
121     </render-folded-env>
122   </macro>>
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>>>>
126       <hidden|<arg|y>>
127     </render-folded-explain>
128   </macro>>
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>>>>
132       <arg|y>
133     </render-folded-explain>
134   </macro>>
136   <assign|folded-grouped|<\macro|x|y>
137     <\render-folded-grouped|<action| |(mouse-unfold)|<arg|x>>>
138       <arg|x>
140       <hidden|<arg|y>>
141     </render-folded-grouped>
142   </macro>>
144   <assign|unfolded-grouped|<\macro|x|y>
145     <\render-folded-grouped|<action| |(mouse-fold)|<arg|x>>>
146       <arg|x>
148       <arg|y>
149     </render-folded-grouped>
150   </macro>>
152   <assign|folded|<value|folded-std>>
154   <assign|unfolded|<value|unfolded-std>>
156   \;
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>
170   <\active*>
171     <\src-comment>
172       Tags for toggling between summarized and detailed text.
173     </src-comment>
174   </active*>
176   <assign|summarized-plain|<\macro|x|y>
177     <\surround||<right-flush>>
178       <arg|x>
179     </surround>
180   </macro>>
182   <assign|detailed-plain|<\macro|x|y>
183     <\surround||<right-flush>>
184       <arg|y>
185     </surround>
186   </macro>>
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>>>
190       <arg|x>
191     </render-folded-std>
192   </macro>>
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>>>
196       <arg|y>
197     </render-folded-std>
198   </macro>>
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>>>
202       <arg|x>
203     </render-folded-env>
204   </macro>>
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>>>
208       <arg|y>
209     </render-folded-env>
210   </macro>>
212   <assign|summarized-grouped|<\macro|x|y>
213     <\render-folded-grouped|<action| |(mouse-unfold)|<arg|x>>>
214       <arg|x>
215     </render-folded-grouped>
216   </macro>>
218   <assign|detailed-grouped|<\macro|x|y>
219     <\render-folded-grouped|<action| |(mouse-fold)|<arg|x>>>
220       <arg|y>
221     </render-folded-grouped>
222   </macro>>
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>>
240   \;
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>
266   <\active*>
267     <\src-comment>
268       Tags for switches.
269     </src-comment>
270   </active*>
272   <assign|document-block|<\xmacro|switch-args>
273     <surround||<right-flush>|<\quasi>
274       <unquote*|<quote-arg|switch-args>>
275     </quasi>>
276   </xmacro>>
278   <assign|tiny-block|<xmacro|switch-args|<map-args|identity|concat|switch-args>>>
280   <assign|slide|<\macro|body>
281     <\surround||<right-flush><new-page>>
282       <arg|body>
283     </surround>
284   </macro>>
286   <assign|slides-block|<\xmacro|switch-args>
287     <surround||<right-flush>|<\quasi>
288       <unquote*|<map|slide|<quote-arg|switch-args>>>
289     </quasi>>
290   </xmacro>>
292   \;
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>>
306   \;
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>
320   \;
322   <assign|traversed|<value|identity>>
324   <assign|fold-back|<value|identity>>
326   <assign|keep-unfolded|<value|identity>>
328   <\active*>
329     <\src-comment>
330       Parts of documents.
331     </src-comment>
332   </active*>
334   <assign|show-preamble|<\macro|body>
335     <with|mode|src|preamble|true|par-first|0fn|par-par-sep|0.5fn|<arg|body>>
336   </macro>>
338   <assign|hide-preamble|<\macro|body>
339     <hidden|<arg|body>>
340   </macro>>
342   <assign|show-part|<\macro|id|active|inactive>
343     <set-part|<arg|id>|<arg|active>>
344   </macro>>
346   <assign|hide-part|<\macro|id|active|inactive>
347     <hidden|<set-part|<arg|id>|<if|<sectional-short-style>|<arg|active>|<arg|inactive>>>>
348   </macro>>
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>
358   \;
359 </body>
361 <\initial>
362   <\collection>
363     <associate|preamble|true>
364   </collection>
365 </initial>