User:Plasma g/Eq
From Wikipedia, the free encyclopedia
This template displays a centered equation and, optionally, an equation label or equation number. This equation label is also used as a tag name and thus can be a link target, so that a reader can click on a reference to an equation and the browser will jump to that equation. (The equation label does not have to be a number, and text labels might be more useful in a collaboratively edited environment, unless an automatic renumbering system existed that could also update all references to a link target when it's name changed.)
Example:
{{User:Plasma_g/Eq|<math>e^{i \pi} + 1 = 0</math>|Eq-Euler}}
or if this is moved to Wikipedia's global templates library, the template name would simplify to just "Eq":
{{Eq|<math>e^{i \pi} + 1 = 0</math>|Eq-Euler}}
Euler's Equation is one of the most beautiful and elegant of all equations, because it shows a special relation between 5 of the most important numbers in mathematics, as shown in [[#Eq-Euler|Eq-Euler]].
generates:
Euler's Equation is one of the most beautiful and elegant of all equations, because it shows a special relation between 5 of the most important numbers in mathematics, as shown in Eq-Euler.
Caveats:
(1) It appears that apostrophes aren't allowed in link names, so in this example I used "Eq-Euler" as the label, instead of "Euler's Equation", which might have been more natural.
(2) One could imagine a somewhat more modular template that could be called after an equation is formatted (instead of taking the equation as an argument to the template). This template would just generate a right-aligned label, and an associated tag that could be a link target. But I haven't yet figured out how to get this label on the same line as the equation.