LaTex

To see how any formula was written in any question or answer, including this one, right-click on the expression it and choose “Show Math As > TeX Commands”. (When you do this, the ‘ willnotdisplay.Makesureyouaddthese.Seethenextpoint.)Forinlineformulas,enclosetheformulain ... .Fordisplayedformulas,use ... .Theserenderdifferently.Forexample,type \sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6} toshow \sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6} (whichisinlinemode)ortype ni=0i2=(n2+n)(2n+1)6 toshow ni=0i2=(n2+n)(2n+1)6 (whichisdisplaymode).ForGreekletters,useα,β,,ω: \alpha, \beta, … \omega .Foruppercase,useΓ,Δ,,Ω: \Gamma, \Delta, …, \Omega .Forsuperscriptsandsubscripts,useand.Forexample,x2i: x_i^2 ,log2x: \log_2 x .Groups.Superscripts,subscripts,andotheroperationsapplyonlytothenextgroup.Agroupiseitherasinglesymbol,oranyformulasurroundedbycurlybraces.Ifyoudo1010,youwillgetasurprise: 10^10 .But1010giveswhatyouprobablywanted: 10^{10}. Use curly braces to delimit a formula to which a superscript or subscript applies: x^5^6 is an error;  {x^y}^z is{x^y}^z ,andxyzis x^{y^z} .Observethedifferencebetweenx2i x_i^2 andxi2 x_{i^2} .ParenthesesOrdinarysymbols()[]makeparenthesesandbrackets (2+3)[4+4] .Useandforcurlybraces \{\}$.

These do not scale with the formula in between, so if you write (\frac{\sqrt x}{y^3}) the parentheses will be too small: (xy3) . Using \left(…\right) will make the sizes adjust automatically to the formula they enclose: \left(\frac{\sqrt x}{y^3}\right) is (xy3) .

\left and\right apply to all the following sorts of parentheses: ( and ) (x) , [ and ] [x] , { and } {x} , | |x| , \vert |x| , \Vert x , \langle and \rangle x , \lceil and \rceil x , and \lfloor and \rfloor x . There are also invisible parentheses, denoted by .: \left.\frac12\right\rbrace is 12} .

If manual size adjustments are required: \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) gives (((((x))))) .
Sums and integrals \sum and \int; the subscript is the lower limit and the superscript is the upper limit, so for example \sum_1^n n1 . Don’t forget {…} if the limits are more than a single symbol. For example, \sum_{i=0}^\infty i^2 is i=0i2 . Similarly, \prod , \int , \bigcup , \bigcap , \iint .
Fractions There are two ways to make these. \frac ab applies to the next two groups, and produces ab ; for more complicated numerators and denominators use {…}: \frac{a+1}{b+1} is a+1b+1 . If the numerator and denominator are complicated, you may prefer \over, which splits up the group that it is in: {a+1\over b+1} is a+1b+1 .
Fonts
Use \mathbb or \Bbb for “blackboard bold”: CHNQRZ .
Use \mathbf for boldface: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .
Use \mathtt for “typewriter” font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .
Use \mathrm for roman font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .
Use \mathsf for sans-serif font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .
Use \mathcal for “calligraphic” letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Use \mathscr for script letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Use \mathfrak for “Fraktur” (old German style) letters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz .
Radical signs Use sqrt, which adjusts to the size of its argument: \sqrt{x^3} x3 ; \sqrt[3]{\frac xy} xy3 . For complicated expressions, consider using {…}^{1/2} instead.
Some special functions such as “lim”, “sin”, “max”, “ln”, and so on are normally set in roman font instead of italic font. Use \lim, \sin, etc. to make these: \sin x sinx , not sin x sinx . Use subscripts to attach a notation to \lim: \lim_{x\to 0}

limx0

There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:

\lt \gt \le \ge \neq <> . You can use \not to put a slash through almost anything: \not\lt but it often looks bad.
\times \div \pm \mp ×÷± . \cdot is a centered dot: xy
\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing
{n+1 \choose 2k} or \binom{n+1}{2k} (n+12k)
\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto
\land \lor \lnot \forall \exists \top \bot \vdash \vDash ¬
\star \ast \oplus \circ \bullet
\approx \sim \simeq \cong \equiv \prec \lhd , .
\infty \aleph_0 0 \nabla \partial \Im \Re IR
For modular equivalence, use \pmod like this: a\equiv b\pmod n ab(modn) .
\ldots is the dots in a1,a2,,an \cdots is the dots in a1+a2++an
Some Greek letters have variant forms: \epsilon \varepsilon ϵε , \phi \varphi ϕφ , and others. Script lowercase l is \ell .
Detexify lets you draw a symbol on a web page and then lists the TEX symbols that seem to resemble it. These are not guaranteed to work in MathJax but are a good place to start. To check that a command is supported, note that MathJax.org maintains a list of currently supported LATEX commands, and one can also check Dr. Carol JVF Burns’s page of TEX Commands Available in MathJax.
Spaces MathJax usually decides for itself how to space formulas, using a complex set of rules. Putting extra literal spaces into formulas will not change the amount of space MathJax puts in: a␣b and a␣␣␣␣b are both ab . To add more space, use , for a thin space ab ; \; for a wider space ab . \quad and \qquad are large spaces: ab , ab .

To set plain text, use \text{…}: {xsx is extra large} . You can nest inside of \text{…}.
Accents and diacritical marks Use \hat for a single symbol x^, \widehat for a larger formula xyˆ . If you make it too wide, it will look silly. Similarly, there are \bar x¯ and \overline xyz¯¯¯¯¯ , and \vec x⃗  and \overrightarrow xy and \overleftrightarrow xy . For dots, as in ddxxx˙=x˙2+xx¨ , use \dot and \ddot.
Special characters used for MathJax interpreting can be escaped using the \ character: $ $ , { { , _ _ , etc. If you want \ itself, you should use \backslash , because \ is for a new line.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值