Template:Math/doc: Difference between revisions
>Illviljan m (→Solution) |
>Illviljan m (→Parameters) |
||
Line 13: | Line 13: | ||
|- | |- | ||
|nr || {{no}} || Activates numbered equations. Don't forget to use unique numbers. | |nr || {{no}} || Activates numbered equations. Don't forget to use unique numbers. | ||
|} | |- | ||
|display || {{no}} || [https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Display_attribute Display attribute] with possible values of <code>inline</code> and <code>block</code>. | |||
* <code>inline</code> there will be no new paragraph for the equation and the operators will be rendered to consume only a small amount of vertical space. | |||
* <code>block</code> the equation is rendered in its own paragraph and the operators are rendered consuming less horizontal space. | |||
==Usage== | ==Usage== |
Revision as of 18:12, 11 July 2016
This subpage provides documentation for Template:Math.
The {{math}}
template is a wrapper for <math>
tag which is a part of Math extension. The template is mainly used to change the default rendering colors (black text on white background) to custom ones that fit the color scheme of the wiki, but also adds possibilities for using another templates inside of <math>
.
For a detailed guide to LaTeX markup see Wikipedia:Help:Displaying a formula.
Parameters
The following parameters are available
Parameter | Required | Description | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
formula | Define the latex equation here. | ||||||||||||||||||
nr | Activates numbered equations. Don't forget to use unique numbers. | ||||||||||||||||||
display | Display attribute with possible values of inline and block .
UsagePlace a formula as a value of a parameter
Instead of default
Advanced usageNumbered equationsThe equations can be numbered using the
Semantic queriesWith this template it is possible to use inline queries such as the parser functions {{math|formula= Enfeeble Base Radius - Maximum Leech Rate Per Second + Maximum Endurance Charges = {{#show: Enfeeble |?Has primary radius=}} - {{#expr:{{#ask: [[-Has subobject::Character]] [[Has stat id::maximum_life_leech_rate_%_per_minute]] |?Has stat value#= |mainlabel=- |limit=1}} /60}} + {{SMW character query|stat=max_endurance_charges}} = {{#expr: {{#show: Enfeeble |?Has primary radius=}} - {{#expr:{{#ask: [[-Has subobject::Character]] [[Has stat id::maximum_life_leech_rate_%_per_minute]] |?Has stat value#= |mainlabel=- |limit=1}} /60}} + {{SMW character query|stat=max_endurance_charges}} }} }} yields: Failed to parse (syntax error): \color[RGB]{163,141,109} Enfeeble Radius - Maximum Leech Rate Per Second + Maximum Endurance Charges = {{#show: Enfeeble |?Has primary radius=}} - <strong class="error">Expression error: Unrecognized punctuation character "{".</strong> + [[:Template:SMW character query]] = <strong class="error">Expression error: Unrecognized punctuation character "{".</strong> TroubleshootingError with multiple bracesProblemPlacing multiple opening/closing braces together (e.g.
}} SolutionIn order to prevent this either space braces:
or use the following templates:
Absolute value denotationProblemAbsolute values are usually denoted |x|. However using
SolutionUse
|