Template:Sum: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
m add brac parameter (and explanation of reason thereof, for sums involving single {{choose}}s)
Neocaridina (talk | contribs)
m Undo revision 169167 by Neocaridina (talk)
Tag: Undo
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>∑<span style="display:inline-grid;font-size:0.75em;vertical-align:middle"><span>{{{uppe|{{{2}}}}}}</span><span>{{{lowe|{{{1}}}}}}</span></span>{{{brac|(}}}{{{term|{{{3}}}}}}{{{brac|)}}}</includeonly><noinclude><tt><nowiki>{{</nowiki>'''sum'''<nowiki>}}</nowiki></tt> is a template for expressing mathematical summations. It uses a vertical grid, so makes the line it inhabits slightly taller. Its parameters may be expressed with their names present or forgone (in which case their order is used).
<includeonly>∑<span style="display:inline-grid;font-size:0.75em;vertical-align:middle"><span>{{{uppe|{{{2}}}}}}</span><span>{{{lowe|{{{1}}}}}}</span></span>{{{brac|(}}}{{{term|{{{3}}}}}}{{{brac|)}}}</includeonly><noinclude><tt><nowiki>{{</nowiki>'''sum'''<nowiki>}}</nowiki></tt> is a template for expressing mathematical summations. It has upper and lower limits to the right of the symbol, and uses a vertical grid, so makes the line it inhabits slightly taller. Its parameters may be expressed with their names present or forgone (in which case their order is used).
* <tt>lowe</tt>: The lower bound
* <tt>lowe</tt>: The lower bound
* <tt>uppe</tt>: The upper bound
* <tt>uppe</tt>: The upper bound
* <tt>term</tt>: The summand
* <tt>term</tt>: The summand
* <tt>brac</tt>: If specified as blank (ie. <tt>...|brac=}}</tt>), removes the bracket pair enclosing the summand. To be used in the event of a summation involving things like <tt>[[:Template:choose|<nowiki>{{</nowiki>choose<nowiki>}}</nowiki>]]</tt>, which have their own brackets, <tt>{{sum|k{{=}}0|n-1|{{choose|k|2}}|brac=}}</tt>.
* <tt>brac</tt>: If specified as blank (ie. <tt>...|brac=}}</tt>), removes the bracket pair enclosing the summand. To be used in the event of a summation involving things like <tt>{{[[:Template:choose|choose]]}}</tt>, which have their own brackets, <tt>{{sum|k{{=}}0|n-1|{{choose|k|2}}|brac=}}</tt>.
For instance, <tt><nowiki><tt>{{sum|k{{=}}0|n-1|k}}</tt></nowiki></tt> becomes <tt>{{sum|k{{=}}0|n-1|k}}</tt>. (Note that <tt>[[:Template:=|<nowiki>{{=}}</nowiki>]]</tt> must be used in place of <tt>=</tt>, which is otherwise accepted as a parameter and may cause problems.)
For instance, <tt><nowiki><tt>{{sum|k{{=}}0|n-1|k}}</tt></nowiki></tt> becomes <tt>{{sum|k{{=}}0|n-1|k}}</tt>. (Note that <tt>{{[[:Template:=|=]]}}</tt> must be used in place of <tt>=</tt>, which is otherwise accepted as a parameter and may cause problems.)


If you find this workaround inelegant, go <s>pester</s> politely ask Nathaniel Johnston to give us the MediaWiki LaTeX extension.
If you find this workaround inelegant, go <s>pester</s> politely ask Nathaniel Johnston to give us the MediaWiki LaTeX extension.


:<tt></tt>{{DISPLAYTITLE:Template:sum}}</noinclude>
:<tt>{{sum|n{{=}}0|∞|{{frac|x<sup>2<sup>n</sup></sup>*(2+x<sup>2<sup>n</sup></sup>)|(1-x<sup>2<sup>n</sup></sup>)<sup>2</sup>*(1+x<sup>2<sup>n</sup></sup>)<sup>2</sup>}}}} = {{frac|x*(2-x)|(1-x)<sup>2</sup>}}</tt>
{{dtlc1}}</noinclude>

Latest revision as of 16:14, 23 January 2026

{{sum}} is a template for expressing mathematical summations. It has upper and lower limits to the right of the symbol, and uses a vertical grid, so makes the line it inhabits slightly taller. Its parameters may be expressed with their names present or forgone (in which case their order is used).

  • lowe: The lower bound
  • uppe: The upper bound
  • term: The summand
  • brac: If specified as blank (ie. ...|brac=}}), removes the bracket pair enclosing the summand. To be used in the event of a summation involving things like {{choose}}, which have their own brackets, ∑n-1k=0(k2).

For instance, <tt>{{sum|k{{=}}0|n-1|k}}</tt> becomes ∑n-1k=0(k). (Note that {{=}} must be used in place of =, which is otherwise accepted as a parameter and may cause problems.)

If you find this workaround inelegant, go pester politely ask Nathaniel Johnston to give us the MediaWiki LaTeX extension.

∑∞n=0(x2n*(2+x2n)(1-x2n)2*(1+x2n)2) = x*(2-x)(1-x)2