Template:Equation

From Wikibooks, open books for an open world
Jump to: navigation, search

{{{1}}}

Template documentation[edit] [history] [purge]

This template, whose format is

{{Equation|formula|number (optional)|alignment (left by default)}}

allows equations to be offset from the main text, numbered, and anchored for later referencing using the template {{Eqnref|x}} (see final note), where x is the number of the equation. The equation is offset 10px from the text above and below. For example,

{{Equation|<math> x^2 + y^2 = z^2 </math>|1}}

results in:

(1)  x^2 + y^2 = z^2

The number is optional and can be omitted as in

{{Equation|<math> x^2 + y^2 = z^2 </math>}}

which gives:

 x^2 + y^2 = z^2

The third variable acts to align the equation to the left, center, or right (this last alignment is not recommended, but is available) and with an indentation of 5% of the width of the page. For example:

{{Equation|<math> x^2 + y^2 = z^2 </math>|2|left}}

results in:

(2)  x^2 + y^2 = z^2

and

{{Equation|<math> x^2 + y^2 = z^2 </math>|3=right}}

results in:

 x^2 + y^2 = z^2

Note: The equations are anchored by number for use with Template:Eqnref

{{Eqnref|1}} {{Eqnref|2}}

results in:

(1) (2)

Clicking on (1) or (2) jumps to the correspondingly numbered equation.