Template:Numbered equation
| This template uses Lua: |
| This template uses TemplateStyles: |
{{numbered equation}} (usually used as {{ne}} for brevity) displays an equation with a number to its left or right, a common formatting convention for the kinds of texts that include equations. There is no requirement that the "number" be an actual literal number since the template accepts arbitrary wikitext in these parameters, but simple one- or two-digit numbers is what it was designed for. Similarly, there is nothing that says you can't put something in both the left and right parameters and it'll probably work fine.
Note that as the example below illustrates the math you include must be wrapped in <math>...</math> to work.
Usage
[edit]{{ne}} works analogously to {{rh}}: it has three parameters that corresponds to the three notional columns in the output, and all three are always present but may be empty.
{{ne|left|math|right}}
A typical invocation with the number on the right would be something like:
Example
{{ne||<math>1 + 1 = 2</math>|1}}
And a typical invocation with the number on the left would be:
Example
{{ne|2|<math>1 + 1 = 2</math>}}
A more complex example could be:
Example
{{ne|''Binder:''|<math>
\begin{align}
X_1 &= X_2 \\
Y_1 &= Y_2 \\
Z_1 &= Z_2
\end{align}
</math>|3}}
There is one special case: when {{ne}} only gets one argument it assumes the argument is the equation and behaves as if it had been in the second argument (this essentially behaves like {{c}}). The third argument also need not be present and when it is missing {{ne}} just behaves as if it was given but empty.
Parameters
[edit]The template's full parameters are:
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| left side | 1 | Number of formula on the left side. | String | optional |
| formula | 2 | Formula enclosed in <math>...</math> | String | required |
| right side | 3 | Number of formula on the right side. | String | optional |
Styling
[edit]{{ne}} adds to following classes to its output that can be targetted with Page styles.
| Class | Description |
|---|---|
| .wst-numbered-equation-left | The left hand column |
| .wst-numbered-equation-math | The middle (math) column |
| .wst-numbered-equation-right | The right hand column |
The template also adds .wst-numbered-equation to its main container of which all the above will be children. This class can be used for scoping or increasing specificity when needed, but should not itself be directly targetted by local styles (it is not safe to override).
Tracking categories
[edit]- Category:Pages using numbered equation with two empty arguments—When called with both the first and third argument present but empty (this can be simplified to the single-argument form)