呢個math模將HTML或者係wikimarkup轉換成類似MathJax嘅數學公式。The template uses thetexhtml
class, which aims to match the size of the serif font with the surrounding sans-serif font (see below). The template also prevents line-wrapping.Use this template for non-complex formulas as an alternative to using the<math>...</math>
format (請睇:Help:Math).
{{math|''f''(''x'') {{=}} ''b''<sup>''x''</sup> {{=}} ''y''}}
- 結果係:f(x) =bx =y
{{math|sin π {{=}} 0}}
- 結果係:sin π = 0.
{{math|{{intmath|int|0|+∞}} ''e''<sup>{{minus}}''x''</sup> d''x'' {{=}} 1}}
- 結果係:∫+∞0e−x dx = 1
'''{{math|{{sfrac|1|2}} {{minus}} {{sfrac|1|3}} {{=}} {{sfrac|1|6}}}}'''
- 結果係:1/2 −1/3 =1/6. Note the triple-apostrophes have set the whole formula as bold.
{{math|({{sqrt|2}})<sup>2</sup> {{=}} 2}}
- 結果係:(√2)2 = 2.
Use of equals-sign and absolute value bars
[編輯]If a single equals-sign ("=") is used, it will fail to render, instead showing "{{{1}}}". For example, the following template-coding would be invalid:
{{math|1 + 2 = 3}}
- 結果係:{{{1}}}, which is invalid code
To resolve this, either: (a) Start the formula with "1=
" as in:
{{math|1=1 + 2 = 3}}
- 結果係:1 + 2 = 3, or else, (b) include the equals-sign in double-braces "{{=}}" as in:
{{math|1 + 2 {{=}} 3}}
- 結果係:1 + 2 = 3.
A similar difficulty concerns the vertical bars ("|") used to indicate absolute value, which without care would get interpreted as part of the template syntax. The solution is different than for the equals sign: such bars should be entered as "{{!}}":
{{math|{{!}}''f''(''x'') − ''a''{{!}} < ε}}
- 結果係:|f(x) −a| < ε.
呢個示例亦可以產生以下內容︰
{{math|{{mabs|''f''(''x'') − ''a''}} < ε}}
- 結果係:|f(x) −a| < ε