math-numbering.tex /size: 2969 b    last modification: 2021-10-28 13:50
1% language=us runpath=texruns:manuals/math
2
3\environment math-layout
4
5\startcomponent math-numbering
6
7\startchapter[title=Numbering]
8
9Numbering equations can be a bit of a mess. Formuals can be unnumbers, numbered,
10numbered with an associated reference. Numbers can go on the while formula and on
11the rows in an alignment. Combine that with positioning left or right and left or
12righ taligned formulas and the picture gets complicated. When something turns out
13wrong, just let me know and the respective branch in the code can be adapted. Here
14are some examples:
15
16\startbuffer
17\startplaceformula[a]
18    \startformula
19        (1)
20    \stopformula
21\stopplaceformula
22\stopbuffer
23
24\typebuffer \getbuffer
25
26\startbuffer
27\startplaceformula[b]
28    \startformula
29        \startalignment
30            \NC 1 \NC =     \NR
31            \NC 2 \NC = (2) \NR
32            \NC 3 \NC =     \NR
33        \stopalignment
34    \stopformula
35\stopplaceformula
36\stopbuffer
37
38\typebuffer \getbuffer
39
40\startbuffer
41\startplaceformula[c]
42    \startformula
43        \startalignment
44            \NC 1 \NC = (3) \NR[x]
45            \NC 2 \NC =     \NR
46            \NC 3 \NC = (4) \NR[y]
47        \stopalignment
48    \stopformula
49\stopplaceformula
50\stopbuffer
51
52\typebuffer \getbuffer
53
54\startbuffer
55\startplaceformula[d]
56    \startformula
57        (5)
58    \stopformula
59\stopplaceformula
60\stopbuffer
61
62\typebuffer \getbuffer
63
64\startbuffer
65\startplaceformula[e]
66    \startformula
67        (6)
68    \stopformula
69\stopplaceformula
70\stopbuffer
71
72\typebuffer \getbuffer
73
74In the next examples we demonstrate how we can avoid numbering, pass a reference as key,
75use assignments instead and add a title or suffix.
76
77\startbuffer
78\startplaceformula
79    \startformula e=mc^2 \stopformula
80\stopplaceformula
81\startplaceformula[-]
82    \startformula e=mc^2 \stopformula
83\stopplaceformula
84\startplaceformula[p]
85    \startformula e=mc^2 \stopformula
86\stopplaceformula
87\startplaceformula[reference=foo]
88    \startformula e=mc^2 \stopformula
89\stopplaceformula
90\startplaceformula[title=whatever]
91    \startformula e=mc^2 \stopformula
92\stopplaceformula
93\startplaceformula[suffix=q]
94    \startformula e=mc^2 \stopformula
95\stopplaceformula
96\startplaceformula[r]
97    \startformula e=mc^2 \stopformula
98\stopplaceformula
99\stopbuffer
100
101\typebuffer \getbuffer
102
103If you want consistent spacing you can enforce this:
104
105\startbuffer
106\startplaceformula[s]
107    \startformula e=mc^2 \stopformula
108\stopplaceformula
109\startplaceformula[-]
110    \startformula e=mc^2 \stopformula
111\stopplaceformula
112\startplaceformula[-]
113    \startformula e=mc^2 \stopformula
114\stopplaceformula
115\setupformulas[numberstrut=always]
116\startplaceformula[-]
117    \startformula e=mc^2 \stopformula
118\stopplaceformula
119\startplaceformula[-]
120    \startformula e=mc^2 \stopformula
121\stopplaceformula
122\stopbuffer
123
124\typebuffer \start \showstruts \getbuffer \stop
125
126Possible values for \type {numberstrut} are \type {yes} (the default), \type
127{always} and \type {no}.
128
129\stopchapter
130
131\stopcomponent
132