math-com.mkxl /size: 3077 b    last modification: 2024-01-16 10:22
1%D \module
2%D   [       file=math-com,
3%D        version=2022.07.17,
4%D          title=\CONTEXT\ Math Macros,
5%D       subtitle=Combinations,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Math Macros / Initializations}
15
16%D This module might be extended.
17
18\unprotect
19
20% \startcombination[2*2]
21%     \startcontent
22%         \startplaceformula\startformula[width=\combinationwidth,title=a]1+x\stopformula\stopplaceformula
23%     \stopcontent
24%     \startcaption\stopcaption
25%     \startcontent
26%         \startplaceformula\startformula[width=\combinationwidth,title=b]2+x\stopformula\stopplaceformula
27%     \stopcontent
28%     \startcaption\stopcaption
29%     \startcontent
30%         \startplaceformula\startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula\stopplaceformula
31%     \stopcontent
32%     \startcaption\stopcaption
33%     \startcontent
34%         \startplaceformula\startformula[width=\combinationwidth,title=d]4+x\stopformula\stopplaceformula
35%     \stopcontent
36%     \startcaption\stopcaption
37% \stopcombination
38%
39% \startplaceformula[a]
40% \startcombination[formula][nx=2,ny=2]
41%     \startformula[width=\combinationwidth,title=a]1+x\stopformula
42%     \startformula[width=\combinationwidth,title=b]2+x\stopformula
43%     \startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula
44%     \startformula[width=\combinationwidth,title=d]4+x\stopformula
45% \stopcombination
46% \stopplaceformula
47%
48% \startplaceformula[a]
49% \startformulacombination[nx=2,ny=2]
50%     \startformula[width=\combinationwidth,title=a]1+x\stopformula
51%     \startformula[width=\combinationwidth,title=b]2+x\stopformula
52%     \startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula
53%     \startformula[width=\combinationwidth,title=d]4+x\stopformula
54% \stopformulacombination
55% \stopplaceformula
56
57\defcsname\??combinationmethod\v!formula\endcsname
58  {\vcenter}
59
60\defcsname\??combinationmethod\v!formula:\v!start\endcsname
61  {\startformula
62   \dostarttagged\t!formulaset\empty
63   \global\c_strc_formulas_inside_formulas\conditionaltrue
64   \bgroup
65   \setupformulas[\c!width=\combinationwidth]%
66   \enforced\tolerant\protected\def\startformula[##1]%
67     {\startcontent
68      \strc_formulas_nested_formula_start[\c!width=\combinationwidth,##1]}%
69   \enforced\protected\def\stopformula
70     {\normalexpanded
71        {\strc_formulas_nested_formula_stop
72         \stopcontent
73         \startcaption
74         \formulaparameter\c!title
75         \stopcaption}}}
76
77\defcsname\??combinationmethod\v!formula:\v!stop\endcsname
78  {\egroup
79   \global\c_strc_formulas_inside_formulas\conditionalfalse
80   \dostoptagged
81   \stopformula
82   \expand\everyresetformulas}
83
84\definecombination[\v!formula][method=formula,width=\hsize]
85
86\protected\def\startformulacombination{\startcombination[\v!formula]}
87\protected\def\stopformulacombination {\stopcombination}
88
89\protect
90