This site is supported by donations to The OEIS Foundation.

Template:Mi/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Mi. [<Edit> Template:Mi]

[⧼Purge⧽ Template:Mi/doc]

The {{mi}} (mathematical identifier) mathematical formatting template formats a mathematical identifier (of either a constant or a variable).

Usage

{{mi|mathematical identifier}}

or

{{mi|mathematical identifier|format}}

where format is among

Examples

Code Result Comment
{{mi|x}} @idsp@x@idsp@ (italic, e.g. ​''x''​)
{{mi|x|htm}} @idsp@x@idsp@ (italic, e.g. ​''x''​)
{{mi|x|tex}} x (left as is, since LaTeX italicizes by default)
{{mi|x|mml}} <mi>x</mi>  

HTML+CSS examples

The code

: {{math|{{mi|x|htm}}{{^|{{mn|2|htm}}}}{{mo|+|htm}}{{mi|y|htm}}{{^|{{mn|2|htm}}}}{{mo|{{=}}|htm}}{{mi|r|htm}}{{^|{{mn|2|htm}}}}|&}}

yields

x 2 + y 2 Undefined symbol: = r 2

while the code

: {{math|{{mi|x|htm}}{{^|{{mn|2|htm}}}}{{mo|+|htm}}{{mi|y|htm}}{{^|{{mn|2|htm}}}}{{mo|{{=}}|htm}}{{mi|r|htm}}{{^|{{mn|2|htm}}}}|&&}}

yields

x 2+y 2 Undefined symbol: = r 2

TeX examples

The code

: {{math|{{mi|x|tex}}{{^|{{mn|2|tex}}|tex}}{{mo|+|tex}}{{mi|y|tex}}{{^|{{mn|2|tex}}|tex}}{{mo|{{=}}|tex}}{{mi|r|tex}}{{^|{{mn|2|tex}}|tex}}|$}}

yields

while the code

: {{math|{{mi|x|tex}}{{^|{{mn|2|tex}}|tex}}{{mo|+|tex}}{{mi|y|tex}}{{^|{{mn|2|tex}}|tex}}{{mo|{{=}}|tex}}{{mi|r|tex}}{{^|{{mn|2|tex}}|tex}}|$$}}

yields

MathML examples

The code

{{math|{{mi|x|mml}}{{mo|^|mml}}{{mn|2|mml}}{{mo|+|mml}}{{mi|y|mml}}{{mo|^|mml}}{{mn|2|mml}}{{mo|{{=}}|mml}}{{mi|r|mml}}{{mo|^|mml}}{{mn|2|mml}}|mml &}}

yields

[[Category:Pages using the math template without the tex argument|Mi/doc]] <span class="math, textstyle" style="display: inline-block; margin: 0 0 -0.75ex 0; padding: 0; white-space: nowrap; position: relative; vertical-align: -0.1ex; font-size: 1.15em; font-family: 'Computer Modern', STIXGeneral, 'Times New Roman';" title="vertical-align: baseline; No LaTeX code provided."><span style="display: inline-block; margin: 0; padding: 0; position: relative; vertical-align: -0.6ex;"><table style="display: inline-table; position: relative; vertical-align: baseline; margin: 0; padding: 0; border-width: 0; border-spacing: 0; background: transparent;"><tr><td style="margin: 0; padding: 0;"><mi>x</mi><mo>^</mo><mn>2</mn><mo>+</mo><mi>y</mi><mo>^</mo><mn>2</mn><mo>=</mo><mi>r</mi><mo>^</mo><mn>2</mn></td></tr></table></span></span>

while the code

{{math|{{mi|x|mml}}{{mo|^|mml}}{{mn|2|mml}}{{mo|+|mml}}{{mi|y|mml}}{{mo|^|mml}}{{mn|2|mml}}{{mo|{{=}}|mml}}{{mi|r|mml}}{{mo|^|mml}}{{mn|2|mml}}|mml &&}}

yields

[[Category:Pages using the math template without the tex argument|Mi/doc]] <span class="math, textstyle" style="display: inline-block; margin: 0 0 -0.75ex 0; padding: 0; white-space: nowrap; position: relative; vertical-align: -0.1ex; font-size: 1.15em; font-family: 'Computer Modern', STIXGeneral, 'Times New Roman';" title="vertical-align: baseline; No LaTeX code provided."><span style="display: inline-block; margin: 0; padding: 0; position: relative; vertical-align: -0.6ex;"><table style="display: inline-table; position: relative; vertical-align: baseline; margin: 0; padding: 0; border-width: 0; border-spacing: 0; background: transparent;"><tr><td style="margin: 0; padding: 0;"><mi>x</mi><mo>^</mo><mn>2</mn><mo>+</mo><mi>y</mi><mo>^</mo><mn>2</mn><mo>=</mo><mi>r</mi><mo>^</mo><mn>2</mn></td></tr></table></span></span>

Code


<noinclude>{{Documentation}}</noinclude><includeonly><!--

  Formatting for a mathematical identifier (of either a constant or a variable).

  @idsp@ (identifier space) annotation for the {{math}} template (two consecutive identifiers yield a pair @idsp@@idsp@) in which  

  * for htm: all @idsp@@idsp@ pairs are replaced by {{sp|1}} (1mu space), then all single @idsp@ are discarded; 
  * for tex: all @idsp@ are discarded (use LaTeX default formatting);       
  * for mml: all @idsp@ are discarded (use MathML default formatting).       

-->{{#switch: {{#if: {{{2|}}} |{{{2}}}|htm}}
| htm = @idsp@''{{{1|}}}''@idsp@   
| tex = {{{1|}}}
| mml = 
<mi>{{{1|}}}</mi>
| {{error| Mi error: Second argument must be from <tt>htm</tt>, <tt>tex</tt>, <tt>mml</tt>. }} 
}}</includeonly>

See also

  • {{mn}} (mathematical number)[1]
  • {{mo}} (mathematical operator)

Notes

  1. As opposed to nominal number.