This site is supported by donations to The OEIS Foundation.

Template:Begin

From OeisWiki
Jump to: navigation, search

The {{begin}} and {{end}} mathematical formatting templates are used to simulate LaTeX environments.

Usage

{{begin|''environment''|''format''}}
first line {{\\}}
second line {{\\}}
... {{\\}}
second last line {{\\}}
last line
{{end|''environment''|''format''}}

where environment is from

  • align: calls {{align|begin|format}},
  • cases: will calls {{cases|begin|format}},
  • gather: will call (NOT YET IMPLEMENTED!) {{gather|begin|format}},
  • (...);

and where format is from

  • htm: HTML+CSS (default);
  • tex: LaTeX.

Examples

Decimal point alignment

The code

{{indent}}{{math|
{{begin|align}}
123{{&.}}45678 {{\\}}
1{{&.}}2345678 {{\\}}
123456{{&.}}78
{{end|align}}
|&&}}

yields the display style HTML+CSS

     
123.45678
1.2345678
123456.78

The code

{{indent}}{{math|
{{begin|align|tex}}
123{{&.|tex}}45678 {{\\|tex}}
1{{&.|tex}}2345678 {{\\|tex}}
123456{{&.|tex}}78
{{end|align|tex}}
|$$}}

yields the display style LaTeX

     

Cases

The code:

The iterated function of the [[3x+1 problem|{{mathfont|3{{sp|1}}''x'' + 1}} problem]] is

{{indent}}{{math|''f''{{sp|2}}(''n'') {{=|sp}} 
{{begin|cases|Big}}
''n''{{sp|1}}{{op|/}}2{{&}}{{sp|quad}}if ''n'' {{rel|equiv}} 0 {{pmod|2}}, {{\\}}
3{{sp|1}}''n'' + 1{{&}}{{sp|quad}}if ''n'' {{rel|equiv}} 1 {{pmod|2}}. 
{{end|cases}}
|tex = f(n) = 
\begin{cases} 
n / 2  & \text{if } n \equiv 0 \pmod{2}, \\ 
3n + 1 & \text{if } n \equiv 1 \pmod{2}. 
\end{cases}
|&&}}

yields the HTML+CSS (with the && option):

The iterated function of the 3 x + 1 problem is

     
f  (n)  = 
⎰  
⎱  
n  / 2 if n ≡ 0  (mod 2),
3 n + 1 if n ≡ 1  (mod 2).

or yields the LaTeX (with the $$ option):

The iterated function of the 3 x + 1 problem is