Movatterモバイル変換


[0]ホーム

URL:


Community CentralCommunity Central
Don't have an account?
Register
Sign In
Skip to content
Community Central
41,391
pages
This extension isenabled by default on Fandom.

Math formulas can be displayed on articles using the<math> tag.

For the technically inclined,MediaWiki (which is used by Fandom wikis) uses a subset of AMS-LaTeX markup, a superset of LaTeX markup which is in turn a superset of TeX markup, for mathematical formulas.

Instructions[]

Source[]

Visual[]

  • Openvisual editing mode for an article.
  • In the insert dropdown, select "Math formula".
  • In the middle will be an editor similar to source editing, but you can choose options from the bottom to insert into the formula.

Examples[]

The equation '3 x 2 = 6' can be displayed using:

<math>{3 ~ \times ~ 2 ~ = ~ 6}</math>
Which generates this:
3 × 2 = 6{\displaystyle {3 ~ \times ~ 2 ~ = ~ 6}}

In-line formulas requiredisplay="inline" attribute:

<math display="inline">V = \frac{4}{3}\pi R^3</math>
Which can be used to generate this:
The volume of a sphere isV=43πR3{\textstyle V = \frac{4}{3}\pi R^3}.

Regular text can be added to a math formula like so:

<math display="inline">\rho_{\text{Air}} = 1.225~\text{kg/m}^3</math>
Which will render like this:
ρAir=1.225 kg/m3{\textstyle \rho_{\text{Air}} = 1.225~\text{kg/m}^3}

If you want to display something like 3 to the power of 12, this will not work:

<math display="inline">3^12</math>
It will display as this:
312{\textstyle 3^{1}2}
Instead, group the 12 with { and }, like this:
<math display="inline">3^{12}</math>
It will display as this:
312{\textstyle 3^{12}}

Notes[]

  • Large formulas may become wider than the maximum page width. Consider breaking them into multiple lines when possible.
    • Another solution is to place the formula inside a simple div with "overflow-x:scroll" set, so that a scrollbar show up. For example:
<div><math> ... </math></div>
1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+1002{\displaystyle 1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100\neq 2}
  • In-line formulas can have poor vertical alignment relative to the rest of the text. A work-around is describedon Wikipedia.


See also[]

Further help and feedback[]

Community content is available underCC-BY-SA unless otherwise noted.

[8]ページ先頭

©2009-2025 Movatter.jp