summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/math/math-numbering.tex
blob: 1576e17bbefec4c23bd4c5cb819a264856dcffa1 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
\environment math-layout

\startcomponent math-numbering

\startchapter[title=Numbering]

Numbering equations can be a bit of a mess. Formuals can be unnumbers, numbered,
numbered with an associated reference. Numbers can go on the while formula and on
the rows in an alignment. Combine that with positioning left or right and left or
righ taligned formulas and the picture gets complicated. When something turns out
wrong, just let me know and the respective branch in the code can be adapted. Here
are some examples:

\startbuffer
\startplaceformula[a]
    \startformula
        (1)
    \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\startplaceformula[b]
    \startformula
        \startalignment
            \NC 1 \NC =     \NR
            \NC 2 \NC = (2) \NR
            \NC 3 \NC =     \NR
        \stopalignment
    \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\startplaceformula[c]
    \startformula
        \startalignment
            \NC 1 \NC = (3) \NR[x]
            \NC 2 \NC =     \NR
            \NC 3 \NC = (4) \NR[y]
        \stopalignment
    \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\startplaceformula[d]
    \startformula
        (5)
    \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\startplaceformula[e]
    \startformula
        (6)
    \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \getbuffer

In the next examples we demonstrate how we can avoid numbering, pass a reference as key,
use assignments instead and add a title or suffix.

\startbuffer
\startplaceformula
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[-]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[p]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[reference=foo]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[title=whatever]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[suffix=q]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[r]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \getbuffer

If you want consistent spacing you can enforce this:

\startbuffer
\startplaceformula[s]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[-]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[-]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\setupformulas[numberstrut=always]
\startplaceformula[-]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\startplaceformula[-]
    \startformula e=mc^2 \stopformula
\stopplaceformula
\stopbuffer

\typebuffer \start \showstruts \getbuffer \stop

Possible values for \type {numberstrut} are \type {yes} (the default), \type
{always} and \type {no}.

\stopchapter

\stopcomponent