Template:Equation/doc

< Template:Equation
Revision as of 12:40, 6 October 2024 by Muskit Gergous (talk | contribs) (Created page with "{{Documentation subpage}} <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> ==Purpose== This template gives an equation passed in as numbered parameter <nowiki>{{{1}}} a number {{{2}}}</nowiki>, which is displayed in the far right column. This also creates an anchor (<nowiki>#equation-{{{2}}}</nowiki>), which can be adjusted with the <code>id</code> parameter. ==Usage== <syntaxhighlight lang="wikitext"> {{Equation|1=e = m c^2|2=1}} {{Equation|...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Purpose

This template gives an equation passed in as numbered parameter {{{1}}} a number {{{2}}}, which is displayed in the far right column. This also creates an anchor (#equation-{{{2}}}), which can be adjusted with the id parameter.

Usage

{{Equation|1=e = m c^2|2=1}}
{{Equation|1=a^2 + b^2 = c^2|2=2}}
{{Equation|1=X(t) = V_0 t + A t^2|2=3}}

results in:

(1)

(2)

(3)

Note: Wikisyntax (e.g. formatting templates like {{sub}}) doesn't work in this template, use LaTeX syntax instead.
Note: When converting from a plain <math> tag to this template, you will need to replace the pipe symbol | with {{!}} and }} with } }.

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Equation

This template generates an equation (passed in LaTeX) with a number to the right. It also generates an anchor so that the equation can be linked to from other parts of the page.

Template parameters

ParameterDescriptionTypeStatus
Equation (LaTeX)1

See Bharatpedia:LaTeX for instructions if unfamiliar.

Example
e^{iz} = \cos(z) + i \sin(z)
Stringrequired
Equation number2

The number of the equation, also used to generate the anchor

Stringsuggested
Anchor idid

The anchor id. If you set this to "my-eqn" (no quotes), the link [[#my-eqn|see my equation]] will take you to the equation.

Default
Defaults to "equation-" + the equation number, if that is specified.
Stringoptional