summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/math-com.mkxl
blob: 27f014d4409c9fc169144f744d41e1f64ba6188c (plain)
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
%D \module
%D   [       file=math-com,
%D        version=2022.07.17,
%D          title=\CONTEXT\ Math Macros,
%D       subtitle=Combinations,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Math Macros / Initializations}

%D This module might be extended.

\unprotect

% \startcombination[2*2]
%     \startcontent
%         \startplaceformula\startformula[width=\combinationwidth,title=a]1+x\stopformula\stopplaceformula
%     \stopcontent
%     \startcaption\stopcaption
%     \startcontent
%         \startplaceformula\startformula[width=\combinationwidth,title=b]2+x\stopformula\stopplaceformula
%     \stopcontent
%     \startcaption\stopcaption
%     \startcontent
%         \startplaceformula\startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula\stopplaceformula
%     \stopcontent
%     \startcaption\stopcaption
%     \startcontent
%         \startplaceformula\startformula[width=\combinationwidth,title=d]4+x\stopformula\stopplaceformula
%     \stopcontent
%     \startcaption\stopcaption
% \stopcombination
%
% \startplaceformula[a]
% \startcombination[formula][nx=2,ny=2]
%     \startformula[width=\combinationwidth,title=a]1+x\stopformula
%     \startformula[width=\combinationwidth,title=b]2+x\stopformula
%     \startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula
%     \startformula[width=\combinationwidth,title=d]4+x\stopformula
% \stopcombination
% \stopplaceformula
%
% \startplaceformula[a]
% \startformulacombination[nx=2,ny=2]
%     \startformula[width=\combinationwidth,title=a]1+x\stopformula
%     \startformula[width=\combinationwidth,title=b]2+x\stopformula
%     \startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula
%     \startformula[width=\combinationwidth,title=d]4+x\stopformula
% \stopformulacombination
% \stopplaceformula

\defcsname\??combinationmethod\v!formula\endcsname
  {\vcenter}

\defcsname\??combinationmethod\v!formula:\v!start\endcsname
  {\startformula
   \dostarttagged\t!formulaset\empty
   \global\settrue\c_strc_formulas_inside_formulas
   \bgroup
   \setupformulas[\c!width=\combinationwidth]%
   \enforced\tolerant\protected\def\startformula[##1]%
     {\startcontent
      \strc_formulas_nested_formula_start[\c!width=\combinationwidth,##1]}%
   \enforced\protected\def\stopformula
     {\normalexpanded
        {\strc_formulas_nested_formula_stop
         \stopcontent
         \startcaption
         \formulaparameter\c!title
         \stopcaption}}}

\defcsname\??combinationmethod\v!formula:\v!stop\endcsname
  {\egroup
   \global\setfalse\c_strc_formulas_inside_formulas
   \dostoptagged
   \stopformula
   \the\everyresetformulas}

\definecombination[\v!formula][method=formula,width=\hsize]

\protected\def\startformulacombination{\startcombination[\v!formula]}
\protected\def\stopformulacombination {\stopcombination}

\protect