This site is supported by donations to The OEIS Foundation.

Template:Sqrt

From OeisWiki
Jump to: navigation, search
For root expressions with any root index (other than the invisible root index 2), use the {{root}} template.


The {{sqrt}} mathematical formatting template and/or mathematical function template is used either to typeset a square root expression (in either HTML+CSS or LaTeX) or to obtain the numerical result of a numerical square root expression which evaluates to a real number.

Usage

{{sqrt|radicand}}

or

{{sqrt|radicand|format}}

where format is taken from:

  • htm: HTML+CSS markup for text style square root expression (default);
  • HTM: HTML+CSS markup for display style square root expression;
  • tex or TEX: LaTeX markup for (text style or display style automatically taken care of by LaTeX) square root expression;
  • #: numerical result (of a numerical square root expression which evaluates to a real number).

NOTE: You must use the {{sqrt}} template within the {{math}} template, which completes the formatting for mathematical expressions. (You cannot use the {{sqrt}} template inside <math>...</math> tags.)

NOTE: To get rendered LaTeX, you must use the {{math}} template, since you cannot evaluate templates, parser functions or magic words inside <math>...</math> tags.

Examples

The code

: {{repeat|2|{{repeat|5|yadda{{nbsp}}}}{{nl}}}}before {{math|{{sqrt|169}} {{=}} {{sqrt|169|#}}|&}} after{{repeat|2|{{nl}}{{repeat|5|yadda{{nbsp}}}}}}

yields the text style HTML+CSS

yadda yadda yadda yadda yadda 
yadda yadda yadda yadda yadda 
before 
2  169
= 13
after
yadda yadda yadda yadda yadda 
yadda yadda yadda yadda yadda 

The code

: {{repeat|2|{{repeat|5|yadda{{nbsp}}}}{{nl}}}}before {{math|{{sqrt|169|tex}} {{=}} {{sqrt|169|#}}|$}} after{{repeat|2|{{nl}}{{repeat|5|yadda{{nbsp}}}}}}

yields the text style LaTeX

yadda yadda yadda yadda yadda 
yadda yadda yadda yadda yadda 
before after
yadda yadda yadda yadda yadda 
yadda yadda yadda yadda yadda 

The code : {{math|{{sqrt|169}} {{=}} {{sqrt|169|#}}|&&}} yields the display style HTML+CSS

2  169
= 13.

The code : {{math|{{sqrt|169|tex}} {{=}} {{sqrt|169|#}}|$$}} yields the display style LaTeX

Root of a rational expression

The code : {{math|{{sqrt|{{tfrac|''x'' {{op|+}} ''y''|''x'' {{op|-}} ''y''}}|HTM}}|&&}} yields the display style HTML+CSS

2  
x + y
xy

The code : {{math|{{sqrt|{{tfrac|''x'' {{op|+}} ''y''|''x'' {{op|-}} ''y''|tex}}|TEX}}|$$}} yields the display style LaTeX

Roots in a rational expression

The code : {{math|{{frac|''x'' {{op|+}} {{sqrt|''x'' {{op|+}} ''y''}}|''x'' {{op|-}} {{sqrt|''x'' {{op|-}} ''y''}}|HTM}}|&&}} yields the display style HTML+CSS

x +
2  x + y
x
2  xy

The code : {{math|{{frac|''x'' {{op|+}} {{sqrt|''x'' {{op|+}} ''y''|tex}}|''x'' {{op|-}} {{sqrt|''x'' {{op|-}} ''y''|tex}}|TEX}}|$$}} yields the display style LaTeX

Code

{{root|{{{1|}}}|{{{2|}}}}}

See also

  • {{root}} (either to typeset a root [with any index] expression (in either HTML+CSS or LaTeX) or to obtain the numerical result of a numerical root [with any index] expression which evaluates to a real number)