Notice that each equation is aligned at the equals sign, and each has its own letter. (presumably they're in the same align
environment)
How do I add sub-numbers to grouped equations?
399 Views Asked by mcmuffin6o At
1
Notice that each equation is aligned at the equals sign, and each has its own letter. (presumably they're in the same align
environment)
An, albeit a bit hacky, solution would be this:
We need to manually use the equation counter for this example to work. In this example, we first retrieve the counter to access it easily. Then, we set an empty closure as the numbering argument of
equation
. When this parameter is not none, the equation counter is incremented for all block-level equations with a number. We do not want to print the default number, so we assign a closure that always returns an empty content block.The math in the example is bold, so we force bold text for the whole formula with line three.
Then, we define the
sub
function. It adds two alignment points (for left-alignment), steps the counter, prints a bit of space, and then displays the counter's value for the given numbering pattern. We specify level 2 for the counter increment to obtain the letters in the number, this sublevel is reset to zero by the next equation block. This is also why we needed to collect variadic arguments in line 2. The amount of arguments passed to a numbering function depends on the deepest non-zero level of the counter.Finally, in the equation, we need to call
sub
for each line.