每次都要上网搜太麻烦了,故:
搬运自:https://www.luogu.com.cn/blog/IowaBattleship/latex-gong-shi-tai-quan
数学公式的插入
将数学公式写在 $ $
之间,代表的是插入行内数学公式(通常称为行内模式)。
将数学公式写在 $$ $$
之间,会使公式独立成一行并强制居中(通常称为独立模式)。
声调 / 变音符号
$dot{a} ddot{a} acute{a} grave{a}$
(quaddot{a}quadddot{a}quadacute{a}quadgrave{a})
$check{a} reve{a} ilde{a} ar{a}$
(quadcheck{a}quadreve{a}quad ilde{a}quadar{a})
$hat{a} widehat{a} vec{a}$
(quadhat{a}quadwidehat{a}quadvec{a})
标准函数
$exp_a b=a^b exp b=e^b 10^m$
(quadexp_a b=a^bquadexp b=e^bquad10^m)
$sin a cos b an c sec d csc e cot f$
(quadsin aquadcos bquad an cquadsec dquadcsc equadcot f)
$arcsin a arccos b arctan c$
(quadarcsin aquadarccos bquadarctan c)
$sinh a cosh b anh c coth d$
(quadsinh aquadcosh bquad anh cquadcoth d)
$operatorname{sh} a operatorname{ch} b operatorname{th} c$
(quadoperatorname{sh} aquadoperatorname{ch} bquadoperatorname{th} c)
$operatorname{argsh} a operatorname{argch} b operatorname{argth} c$
ps:operatorname{} 貌似可以将任何字符转换成标准函数的形式。
(quadoperatorname{argsh} aquadoperatorname{argch} bquadoperatorname{argth} c)
$leftvert a
ightvert min(x,y) max(x,y)$
(quadleftvert a ightvertquadmin(x,y)quadmax(x,y))
界限
$min x max y inf s sup t$
(quadmin xquadmax yquadinf squadsup t)
$lim u liminf v limsup w$
(quadlim uquadliminf vquadlimsup w)
$dim p deg q det m kerphi$
(quaddim pquaddeg qquaddet mquadkerphi)
投射
(ps:)感觉这翻译很奇怪,应该是映射吧。
$Pr j hom l lVert z
Vert arg z$
ps:个人认为lVert、
Vert与Vert和|并没有什么区别。
(quadPr jquadhom lquadlVert z Vertquadarg z)
微分及导数
$dt mathrm{d}t partial t
ablapsi$
(quad dtquadmathrm{d}tquadpartial tquad ablapsi)
$prime ackprime f^prime f' f'' f^{(3)} dot{y} ddot{y}$
(quadprimequadackprimequad f^primequad f'quad f''quad f^{(3)}quaddot{y}quadddot{y})
类字母符号及常数
$infty aleph complement ackepsilon eth Finv hbar$
(quadinftyquadalephquadcomplementquadackepsilonquadethquadFinvquadhbar)
$Im imath jmath Bbbk ell mho wp Re circledS$
(quadImquadimathquadjmathquadBbbkquadellquadmhoquadwpquadRequadcircledS)
模算数
$aequiv1pmod{m}$
(quad aequiv1pmod{m})
$amod b$
(quad amod b)
$gcd(m,n) operatorname{lcm}(m,n)$
(quadgcd(m,n)quadoperatorname{lcm}(m,n))
$mid
mid shortmid
shortmid$
ps:mid可以用|代替。
(quadmidquad midquadshortmidquad shortmid)
(for special:)
$a\%b$
(quad a\%b)
根号
$surd sqrt{2} sqrt[n]{} sqrt[n]{x}$
(quadsurdquadsqrt{2}quadsqrt[n]{}quadsqrt[n]{x})
运算符
$+ - pm mp dotplus$
(quad+quad-quadpmquadmpquaddotplus)
$ imes div divideontimes / ackslash$
(quad imesquaddivquaddivideontimesquad/quadackslash)
$cdot * star circ ullet$
ps:*可以用ast代替。
(quadcdotquad*quadstarquadcircquadullet)
$oxplus oxminus oxtimes oxdot$
(quadoxplusquadoxminusquadoxtimesquadoxdot)
$oplus ominus otimes oslash odot$
(quadoplusquadominusquadotimesquadoslashquadodot)
$circleddash circledcirc circledast$
(quadcircleddashquadcircledcircquadcircledast)
$igoplus igotimes igodot$
(quadigoplusquadigotimesquadigodot)
集合
${ } emptyset varnothing$
(quad{quad}quademptysetquadvarnothing{})
$in
otin
otin
i
ot
i$
ps:
ot是在下一个字符上画斜杠。
(quadinquad otinquad otinquad iquad ot i)
$cap Cap sqcap igcap$
(quadcapquadCapquadsqcapquadigcap)
$cup Cup sqcup igcup igsqcup uplus iguplus$
(quadcupquadCupquadsqcupquadigcupquadigsqcupquaduplusquadiguplus)
$setminus smallsetminus imes$
(quadsetminusquadsmallsetminusquad imes)
$subset Subset sqsubset$
(quadsubsetquadSubsetquadsqsubset)
$supset Supset sqsupset$
(quadsupsetquadSupsetquadsqsupset)
$subseteq
subseteq subsetneq varsubsetneq sqsubseteq$
(quadsubseteqquad subseteqquadsubsetneqquadvarsubsetneqquadsqsubseteq)
$supseteq
supseteq supsetneq varsupsetneq sqsupseteq$
(quadsupseteqquad supseteqquadsupsetneqquadvarsupsetneqquadsqsupseteq)
$subseteqq
subseteqq subsetneqq varsubsetneqq$
(quadsubseteqqquad subseteqqquadsubsetneqqquadvarsubsetneqq)
$supseteqq
supseteqq supsetneqq varsupsetneqq$
(quadsupseteqqquad supseteqqquadsupsetneqqquadvarsupsetneqq)
关系符号
$=
e
eq equiv
otequiv$
ps:表示并没有看出来
e和
eq的区别……
(quad=quad equad eqquadequivquad otequiv)
$doteq doteqdot overset{underset{def}{}}{=} :=$
(quaddoteqquaddoteqdotquadoverset{underset{def}{}}{=}quad:=)
$sim
sim acksim hicksim simeq acksimeq eqsim cong
cong$
(quadsimquad simquadacksimquad hicksimquadsimeqquadacksimeqquadeqsimquadcongquad cong)
$approx hickapprox approxeq asymp propto varpropto$
(quadapproxquad hickapproxquadapproxeqquadasympquadproptoquadvarpropto)
$<
less ll
otll lll
otlll lessdot$
(quad<quad lessquadllquad otllquadlllquad otlllquadlessdot)
$>
gtr gg
otgg ggg
otggg gtrdot$
(quad>quad gtrquadggquad otggquadgggquad otgggquadgtrdot)
$le leq lneq leqq
leq
leqq lneqq lvertneqq$
(quadlequadleqquadlneqquadleqqquad leqquad leqqquadlneqqquadlvertneqq)
$ge geq gneq geqq
geq
geqq gneqq gvertneqq$
(quadgequadgeqquadgneqquadgeqqquad geqquad geqqquadgneqqquadgvertneqq)
$lessgtr lesseqgtr lesseqqgtr gtrless gtreqless gtreqqless$
(quadlessgtrquadlesseqgtrquadlesseqqgtrquadgtrlessquadgtreqlessquadgtreqqless)
$leqslant
leqslant eqslantless$
(quadleqslantquad leqslantquadeqslantless)
$geqslant
geqslant eqslantgtr$
(quadgeqslantquad geqslantquadeqslantgtr)
$lesssim lnsim lessapprox lnapprox$
(quadlesssimquadlnsimquadlessapproxquadlnapprox)
$gtrsim gnsim gtrapprox gnapprox$
(quadgtrsimquadgnsimquadgtrapproxquadgnapprox)
$prec
prec preceq
preceq precneqq$
(quadprecquad precquadpreceqquad preceqquadprecneqq)
$succ
succ succeq
succeq succneqq$
(quadsuccquad succquadsucceqquad succeqquadsuccneqq)
$preccurlyeq curlyeqprec$
(quadpreccurlyeqquadcurlyeqprec)
$succcurlyeq curlyeqsucc$
(quadsucccurlyeqquadcurlyeqsucc)
$precsim precnsim precapprox precnapprox$
(quadprecsimquadprecnsimquadprecapproxquadprecnapprox)
$succsim succnsim succapprox succnapprox$
(quadsuccsimquadsuccnsimquadsuccapproxquadsuccnapprox)
几何符号
$parallel
parallel shortparallel
shortparallel$
ps:parallel应该和|是一样的。
(quadparallelquad parallelquadshortparallelquad shortparallel)
$perp angle sphericalangle measuredangle 45^circ$
(quadperpquadanglequadsphericalanglequadmeasuredanglequad45^circ)
$Box lacksquare diamond Diamond lozenge lacklozenge igstar$
(quadBoxquadlacksquarequaddiamondquadDiamondquadlozengequadlacklozengequadigstar)
$igcirc riangle igtriangleup igtriangledown$
ps:并没有看出 riangle和igtriangleup有什么区别。
(quadigcircquad rianglequadigtriangleupquadigtriangledown)
$vartriangle riangledown riangleleft riangleright$
(quadvartrianglequad riangledownquad riangleleftquad riangleright)
$lacktriangle lacktriangledown lacktriangleleft lacktriangleright$
(quadlacktrianglequadlacktriangledownquadlacktriangleleftquadlacktriangleright)
逻辑符号
$forall exists
exists$
(quadforallquadexistsquad exists)
$ herefore ecause And$
ps:And也可用&,至少我没看出来这两个有什么差别。
(quad hereforequadecausequadAnd)
$lor vee curlyvee igvee$
(quadlorquadveequadcurlyveequadigvee)
$land wedge curlywedge igwedge$
(quadlandquadwedgequadcurlywedgequadigwedge)
$ar{q} ar{abc} overline{q} overline{abc}$
(quadar{q}quadar{abc}quadoverline{q}quadoverline{abc})
$lnot
eg ot op$
(quadlnotquad egquadotquad op)
$vdash dashv vDash Vdash models$
(quadvdashquaddashvquadvDashquadVdashquadmodels)
$Vvdash
vdash
Vdash
vDash
VDash$
(quadVvdashquad vdashquad Vdashquad vDashquad VDash)
$ulcorner urcorner llcorner lrcorner$
(quadulcornerquadurcornerquadllcornerquadlrcorner)
箭头
$Rrightarrow Lleftarrow$
(quadRrightarrowquadLleftarrow)
$Rightarrow
Rightarrow Longrightarrow implies$
(quadRightarrowquad RightarrowquadLongrightarrowquadimplies)
$Leftarrow
Leftarrow Longleftarrow$
(quadLeftarrowquad LeftarrowquadLongleftarrow)
$Leftrightarrow
Leftrightarrow Longleftrightarrow iff$
(quadLeftrightarrowquad LeftrightarrowquadLongleftrightarrowquadiff)
$Uparrow Downarrow Updownarrow$
(quadUparrowquadDownarrowquadUpdownarrow)
$leftarrow
ightarrow
leftarrow
rightarrow leftrightarrow
leftrightarrow longleftarrow longrightarrow longleftrightarrow$
ps:leftarrow可用gets代替,
ightarrow可用 o代替。
(quadleftarrowquad ightarrowquad leftarrowquad rightarrowquadleftrightarrowquad leftrightarrowquadlongleftarrowquadlongrightarrowquadlongleftrightarrow)
$uparrow downarrow updownarrow
earrow searrow
warrow swarrow$
(quaduparrowquaddownarrowquadupdownarrowquad earrowquadsearrowquad warrowquadswarrow)
$mapsto longmapsto$
(quadmapstoquadlongmapsto)
$
ightharpoonup
ightharpoondown leftharpoonup leftharpoondown upharpoonleft upharpoonright downharpoonleft downharpoonright leftrightharpoons
ightleftharpoons$
(quad ightharpoonupquad ightharpoondownquadleftharpoonupquadleftharpoondownquadupharpoonleftquadupharpoonrightquaddownharpoonleftquaddownharpoonrightquadleftrightharpoonsquad ightleftharpoons)
$curvearrowleft circlearrowleft Lsh upuparrows
ightrightarrows
ightleftarrows
ightarrowtail looparrowright$
(quadcurvearrowleftquadcirclearrowleftquadLshquadupuparrowsquad ightrightarrowsquad ightleftarrowsquad ightarrowtailquadlooparrowright)
$curvearrowright circlearrowright Rsh downdownarrows leftleftarrows leftrightarrows leftarrowtail looparrowleft looparrowright$
(quadcurvearrowrightquadcirclearrowrightquadRshquaddowndownarrowsquadleftleftarrowsquadleftrightarrowsquadleftarrowtailquadlooparrowleftquadlooparrowright)
$hookrightarrow hookleftarrow multimap leftrightsquigarrow
ightsquigarrow woheadrightarrow woheadleftarrow$
(quadhookrightarrowquadhookleftarrowquadmultimapquadleftrightsquigarrowquad ightsquigarrowquad woheadrightarrowquad woheadleftarrow)
$xleftarrow{left} xrightarrow{right} xLeftarrow{Left} xRightarrow{Right} xleftrightarrow{left& right} xLeftrightarrow{Left& Right}$
(quadxleftarrow{left}quad xrightarrow{right} quad xLeftarrow{Left} quad xRightarrow{Right} quad xleftrightarrow{left& right} quad xLeftrightarrow{Left& Right})
特殊符号
$amalg \% dagger ddagger ldots cdots$
ps:dots和ldots貌似是一样的。
(quadamalgquad\%quaddaggerquadddaggerquadldotsquadcdots)
$smile frown wr$
(quadsmilequadfrownquadwr)
$diamondsuit heartsuit clubsuit spadesuit Game flat
atural sharp$
(quaddiamondsuitquadheartsuitquadclubsuitquadspadesuitquadGamequadflatquad aturalquadsharp)
以下是 Wiki 中没有分类的符号,我暂且将其归入特殊符号中。
$diagup diagdown centerdot ltimes
times leftthreetimes
ightthreetimes$
(quaddiagupquaddiagdownquadcenterdotquadltimesquad timesquadleftthreetimesquad ightthreetimes)
$eqcirc circeq riangleq umpeq Bumpeq doteqdot
isingdotseq fallingdotseq$
(quadeqcircquadcirceqquad riangleqquadumpeqquadBumpeqquaddoteqdotquad isingdotseqquadfallingdotseq)
$intercal arwedge veebar doublebarwedge etween pitchfork$
(quadintercalquadarwedgequadveebarquaddoublebarwedgequadetweenquadpitchfork)
$vartriangleleft
triangleleft vartriangleright
triangleright$
(quadvartriangleleftquad triangleleftquadvartrianglerightquad triangleright)
$ rianglelefteq
trianglelefteq rianglerighteq
trianglerighteq$
(quad rianglelefteqquad trianglelefteqquad rianglerighteqquad trianglerighteq)
$LaTeX$
ps:应评论要求加上,其实介于阅读体验还是少用些。
(quadLaTeX)
上标、下标及积分等
上标
$a^2$
(quad a^2)
下标
$a_2$
(quad a_2)
组合
$a^{2+2} a_{i,j}$
(quad a^{2+2}quad a_{i,j})
结合上下标
$a^2_2$
(quad a^2_2)
前置上下标
${}^2_1!X^3_4$
ps:!的作用在下面空格一栏有讲述。
(quad {}^2_1!X^3_4)
导数
$ (HTML)x' (PNG)x^prime (错误)xprime$
(quad x'quad x^primequad xprime)
导数点
$dot{x} ddot{x}$
(quaddot{x}quadddot{x})
向量
$vec{x} overleftarrow{AB} overrightarrow{AB} widehat{AB}$
(quadvec{a}quadoverleftarrow{AB}quadoverrightarrow{AB}quadwidehat{AB})
上弧
$overset{frown}{AB}$
ps:正确的语法应该是overarc,但因为没有引入amsmath宏包,所以无法使用,只能用这个替代下。
(quadoverset{frown}{AB})
上划线
$overline{ABC}$
(quadoverline{ABC})
下划线
$underline{ABC}$
(quadunderline{ABC})
上括号
$overbrace{1+2+cdots+100}$
$egin{matrix}5050\overbrace{1+2+cdots+100}end{matrix}$
ps:'\'是换行的意思。
(quadoverbrace{1+2+cdots+100})
(quadegin{matrix}5050\overbrace{1+2+cdots+100}end{matrix})
下括号
$underbrace{1+2+cdots+100}$
$egin{matrix}underbrace{1+2+cdots+100}\5050end{matrix}$
(quadunderbrace{1+2+cdots+100})
(quadegin{matrix}underbrace{1+2+cdots+100}\5050end{matrix})
求和
$sum_{i=1}^na_i sumlimits_{i=1}^na_i$
(quadsum_{i=1}^na_iquadsumlimits_{i=1}^na_i)
求积
$prod_{i=1}^na_i prodlimits_{i=1}^na_i$
(quadprod_{i=1}^na_iquadprodlimits_{i=1}^na_i)
上积
$coprod_{i=1}^na_i coprodlimits_{i=1}^na_i$
(quadcoprod_{i=1}^na_iquadcoprodlimits_{i=1}^na_i)
极限
$lim_{n oinfty}x_n limlimits_{n oinfty}x_n$
(quadlim_{n oinfty}x_nquadlimlimits_{n oinfty}x_n)
积分
$int_{-N}^{N}e^x\,dx$
ps:\,的作用在下面空格一栏有讲。
(quadint_{-N}^{N}e^x\,dx)
双重积分
$iint_M^Ndx\,dy$
(quadiint_M^Ndx\,dy)
三重积分
$iiint_M^Ndx\,dy\,dz$
(quadiiint_M^Ndx\,dy\,dz)
闭合的曲线、曲面积分
$oint_Cx^3\,dx+4y^2\,dy$
(quadoint_Cx^3\,dx+4y^2\,dy)
交集
$igcap_1^np igcaplimits_1^np$
(quadigcap_1^npquadigcaplimits_1^np)
并集
$igcup_1^np igcuplimits_1^np$
(quadigcup_1^npquadigcuplimits_1^np)
分数、矩阵等
分数
$frac{1}{2}=0.5$
(quadfrac{1}{2}=0.5)
小型分数
$ frac{1}{2}=0.5$
ps:并不清楚为什么洛谷的LaTeX里普通分数和小型分数一样大……
(quad frac{1}{2}=0.5)
大型分数
$dfrac{1}{2}=0.5 dfrac{1}{x+dfrac{3}{y+dfrac{1}{5}}}$
(quaddfrac{1}{2}=0.5qquaddfrac{1}{x+dfrac{3}{y+dfrac{1}{5}}})
二项式系数
$dbinom{n}{m}=dbinom{n}{n-m}=C_n^m=C_n^{n-m}$
(quaddbinom{n}{m}=dbinom{n}{n-m}=C_n^m=C_n^{n-m})
小型二项式系数
$ binom{n}{m}= binom{n}{n-m}=C_n^m=C_n^{n-m}$
(quad binom{n}{m}= binom{n}{n-m}=C_n^m=C_n^{n-m})
$inom{n}{m}=inom{n}{n-m}=C_n^m=C_n^{n-m}$
(quadinom{n}{m}=inom{n}{n-m}=C_n^m=C_n^{n-m})
矩阵
$egin{matrix}a&b\c&dend{matrix}$
ps:&是使上下行对齐。
(quadegin{matrix}a&b\c&dend{matrix})
$egin{vmatrix}a&b\c&dend{vmatrix}$
(quadegin{vmatrix}a&b\c&dend{vmatrix})
$egin{Vmatrix}a&b\c&dend{Vmatrix}$
(quadegin{Vmatrix}a&b\c&dend{Vmatrix})
$egin{bmatrix}a&cdots&b\vdots&ddots&vdots\c&cdots&dend{bmatrix}$
ps:vdots是竖着3个点,ddots是斜着3个点。
(quadegin{bmatrix}a&cdots&b\vdots&ddots&vdots\c&cdots&dend{bmatrix})
$egin{Bmatrix}a&c\b&dend{Bmatrix}$
(quadegin{Bmatrix}a&c\b&dend{Bmatrix})
$egin{pmatrix}a&c\b&dend{pmatrix}$
(quadegin{pmatrix}a&c\b&dend{pmatrix})
矩阵嵌套
$egin{vmatrix} egin{Bmatrix}A & \ c & d end{Bmatrix} & x\ dfrac{1}{2} & egin{matrix} 1 & 2 \ 3 & 4 end{matrix} end{vmatrix}$
(quad egin{vmatrix} egin{Bmatrix}A & \ c & d end{Bmatrix} & x\ dfrac{1}{2} & egin{matrix} 1 & 2 \ 3 & 4 end{matrix} end{vmatrix})
条件定义(如分段函数)
$f(x)=egin{cases}x-1&xleqslant3\x^2+3x-1&x>3end{cases}$
(quad f(x)=egin{cases}x-1&xleqslant3\x^2+3x-1&x>3end{cases})
方程组
$egin{cases}2x+9y-5z=10\4x+20y+z=24\x-dfrac{1}{2}y+3z=8end{cases}$
(quadegin{cases}2x+9y-5z=10\4x+20y+z=24\x-dfrac{1}{2}y+3z=8end{cases})
多行等式
$egin{aligned}f(x) & = (x + 1)^2 \ & = x^2 + 2x + 1end{aligned}$
$egin{aligned}a_1 & = 1 \ a_2 & = 2 \ & dots \ a_n & = nend{aligned}$
ps:原语法为align,现在是aligned。
(quadegin{aligned}f(x) & = (x + 1)^2 \ & = x^2 + 2x + 1end{aligned}qquadegin{aligned}a_1 & = 1 \ a_2 & = 2 \ & dots \ a_n & = nend{aligned})
数组 / 表格
$egin{array}{|c|c||c|}x&y&z\8&2&4\2&3&9\10&dfrac{3}{4}&sqrt{3}\a&b&cend{array}$
ps:egin{array}{}←这个大括号里是形如'|c|c||c|'这样的格式,'|'是两列的分割线,'c'是表示这里有一列,而内容中使用'&'来分开每一列的内容。这里可能讲的不是很清楚,所以最好还是自己尝试一下。
(quadegin{array}{|c|c||c|}x&y&z\8&2&4\2&3&9\10&dfrac{3}{4}&sqrt{3}\a&b&cend{array})
字体
希腊字母
$AlphaBetaGammaDelta EZHTheta$
(quad AlphaBetaGammaDelta EZHTheta)
$IotaKappaLambda MNXi OPi$
(quad IotaKappaLambda MNXi OPi)
$RhoSigma TUpsilonPhi XPsiOmega$
(quad RhoSigma TUpsilonPhi XPsiOmega)
$alphaetagammadeltaepsilonzetaeta heta$
(quadalphaetagammadeltaepsilonzetaeta heta)
$iotakappalambdamu
uxiomicronpi$
(quadiotakappalambdamu uxiomicronpi)
$
hosigma auupsilonphichipsiomega$
(quad hosigma auupsilonphichipsiomega)
$varepsilondigammavarkappavarpi$
(quadvarepsilondigammavarkappavarpi)
$varrhovarsigmavarthetavarphi$
(quadvarrhovarsigmavarthetavarphi)
希伯来符号
$alephethgimeldaleth$
(quadalephethgimeldaleth)
黑板粗体
$mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
ps:仅支持大写英文字母。
(quadmathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
粗体
$mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$mathbf{abcdefghijklmnopqrstuvwxyz}$
$mathbf{0123456789}$
ps:支持大小写英文字母、数字和大写希腊字母。
(quadmathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quadmathbf{abcdefghijklmnopqrstuvwxyz})
(quadmathbf{AlphaBetaGammaDelta EZHTheta})
(quadmathbf{IotaKappaLambda MNXi OPi})
(quadmathbf{RhoSigma TUpsilonPhi XPsiOmega})
(quadmathbf{0123456789})
斜体(英文字母和小写希腊字母默认)
$mathit{AlphaBetaGammaDelta EZHTheta}$
$mathit{IotaKappaLambda MNXi OPi}$
$mathit{RhoSigma TUpsilonPhi XPsiOmega}$
$mathit{0123456789}$
(quadmathit{AlphaBetaGammaDelta EZHTheta})
(quadmathit{IotaKappaLambda MNXi OPi})
(quadmathit{RhoSigma TUpsilonPhi XPsiOmega})
(quadmathit{0123456789})
罗马体
$mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$mathrm{abcdefghijklmnopqrstuvwxyz}$
$mathrm{0123456789}$
ps:支持大小写英文字母和数字。
(quadmathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quadmathrm{abcdefghijklmnopqrstuvwxyz})
(quadmathrm{0123456789})
打字机字体
$mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$mathtt{abcdefghijklmnopqrstuvwxyz}$
$mathtt{AlphaBetaGammaDelta EZHTheta}$
$mathtt{IotaKappaLambda MNXi OPi}$
$mathtt{RhoSigma TUpsilonPhi XPsiOmega}$
$mathtt{0123456789}$
ps:支持大小写英文字母、大写希腊字母和数字。
(quad mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quad mathtt{abcdefghijklmnopqrstuvwxyz})
(quad mathtt{AlphaBetaGammaDelta EZHTheta})
(quad mathtt{IotaKappaLambda MNXi OPi})
(quad mathtt{RhoSigma TUpsilonPhi XPsiOmega})
(quad mathtt{0123456789})
无衬线体
$mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$mathsf{abcdefghijklmnopqrstuvwxyz}$
$mathsf{AlphaBetaGammaDelta EZHTheta}$
$mathsf{IotaKappaLambda MNXi OPi}$
$mathsf{RhoSigma TUpsilonPhi XPsiOmega}$
$mathsf{0123456789}$
ps:支持大小写英文字母、大写希腊字母和数字。
(quadmathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quadmathsf{abcdefghijklmnopqrstuvwxyz})
(quadmathsf{A BGammaDelta EZHTheta})
(quadmathsf{IotaKappaLambda MNXi OPi})
(quadmathsf{RhoSigma TUpsilonPhi XPsiOmega})
(quadmathsf{0123456789})
手写体 / 花体
$mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$mathcal{0123456789}$
ps:支持大写英文字母和数字。
(quadmathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quadmathcal{0123456789})
FrakturFraktur 体
$mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$mathfrak{abcdefghijklmnopqrstuvwxyz}$
$mathfrak{0123456789}$
ps:支持大小写英文字母和数字。
(quadmathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quadmathfrak{abcdefghijklmnopqrstuvwxyz})
(quadmathfrak{0123456789})
小型非斜体字
$scriptstyle ext{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
$scriptstyle ext{abcdefghijklmnopqrstuvwxyz}$
$scriptstyle ext{0123456789}$
ps:支持大小写英文字母和数字, ext见下一栏。
(quadscriptstyle ext{ABCDEFGHIJKLMNOPQRSTUVWXYZ})
(quadscriptstyle ext{abcdefghijklmnopqrstuvwxyz})
(quadscriptstyle ext{0123456789})
混合字体
斜体字符
$x y z$
ps:忽略公式源码中的空格,要强制空格的看下面空格一栏。
(quad x y z)
非斜体字符
$ ext{x y z} ext{中文}$
ps:不会忽略空格,支持大小写英文字母和数字,以及中文。
(quad ext{x y z}quad ext{中文})
混合斜体与非斜体
$ ext{if }n ext{ is even}$
ps:注意在 ext中使用空格来显得更好看,或者可以用强制空格代替。
(quad ext{if }n ext{ is even})
括号
普通括号
$(dfrac{1}{2}) (dfrac{1}{x+dfrac{2}{3}})$
ps:对于较大的式子显得比较难看。
(quad(dfrac{1}{2})qquad(dfrac{1}{x+dfrac{2}{3}}))
根据式子大小匹配的括号
$left(dfrac{1}{2}
ight) left(dfrac{1}{x+dfrac{2}{3}}
ight)$
(quadleft(dfrac{1}{2} ight)qquadleft(dfrac{1}{x+dfrac{2}{3}} ight))
此功能 (使用left和 ight)可以推广到不同的括号:
圆括号 / 小括号
$left(dfrac{1}{2}
ight)$
(quadleft(dfrac{1}{2} ight))
方括号 / 中括号
$left[dfrac{1}{2}
ight]$
(quadleft[dfrac{1}{2} ight])
花括号 / 大括号
$left{dfrac{1}{2}
ight}$
ps:注意大括号要用{和}。
(quadleft{dfrac{1}{2} ight})
角括号
$leftlangledfrac{1}{2}
ight
angle$
ps:langle可以用<,
angle可以用>。
(quadleftlangledfrac{1}{2} ight angle)
单竖线 / 绝对值
$left|dfrac{1}{2}
ight|$
(quadleft|dfrac{1}{2} ight|)
双竖线
$left|dfrac{1}{2}
ight|$
(quadleft|dfrac{1}{2} ight|)
向下取整
$leftlfloordfrac{1}{2}
ight
floor$
(quadleftlfloordfrac{1}{2} ight floor)
向上取整
$leftlceildfrac{1}{2}
ight
ceil$
(quadleftlceildfrac{1}{2} ight ceil)
斜线
$left/dfrac{1}{2}
ight/$
(quadleft/dfrac{1}{2} ight/)
反斜线
$leftackslashdfrac{1}{2}
ightackslash$
(quadleftackslashdfrac{1}{2} ightackslash)
上下箭头
$leftuparrowdfrac{1}{2}
ightuparrow$
$quadleftuparrowdfrac{1}{2}
ightuparrow$
```plain
$leftDownarrowdfrac{1}{2}
ightDownarrow$
(quadleftDownarrowdfrac{1}{2} ightDownarrow)
$leftupdownarrowdfrac{1}{2}
ightupdownarrow$
(quadleftupdownarrowdfrac{1}{2} ightupdownarrow)
因为上下箭头太多了,这里就不一一示范了(其实是我懒)。
混合括号
其实上述括号都可以混合使用,这里就随便列两个了。
$left<dfrac{1}{2}
ight/$
(quadleft<dfrac{1}{2} ight/)
$left(dfrac{1}{2},1
ight]$
(quadleft(dfrac{1}{2},1 ight])
单左括号
上述括号都适用,这里就随便列一个。
$left(dfrac{1}{2}
ight.$
(quadleft(dfrac{1}{2} ight.)
单右括号
同上。
$left.dfrac{1}{2}
ight]$
(quadleft.dfrac{1}{2} ight])
强制括号大小
$Bigg(igg[Big{ig<xig>Big}igg]Bigg)$
ps:即使用Bigg、igg、Big、ig来控制括号大小。
(quadBigg(igg[Big{ig<xig>Big}igg]Bigg))
空格
一般 (LaTeX) 能自动处理大多数空格,但必要时候需要强制控制大小。
紧贴
$x!y$
(quad x!y)
宽度为 (-frac{m}{6})
无空格
$xy$
(quad xy)
宽度为 (0)
小空格
$x\,y$
(quad x\,y)
宽度为 (frac{m}{6})
中等空格
$x;y$
(quad x;y)
宽度为 (frac{2m}{7})
大空格
$x y$
(quad x y)
宽度为 (frac{m}{3})
quad 空格
$xquad y$
(quad xquad y)
宽度为 (m)
两个 quad 空格
$xqquad y$
(quad xqquad y)
宽度为 (2m)
颜色
语法
字体颜色:{color{色调}表达式}
背景颜色:{color{文字色调}colorbox{背景色调}{表达式(可以打中文)}}
洛谷内支持的颜色(洛谷里有挺多颜色是不支持的,而且有些颜色和 Wiki 上不太一样……)
({color{Aquamarine}{Aquamarine}})
({color{Black}{Black}})
({color{Blue}{Blue}})
({color{BlueViolet}{BlueViolet}})
({color{Brown}{Brown}})
({color{CadetBlue}{CadetBlue}})
({color{CornflowerBlue}{CornflowerBlue}})
({color{Cyan}{Cyan}})
({color{DarkOrchid}{DarkOrchid}})
({color{ForestGreen}{ForestGreen}})
({color{Fuchsia}{Fuchsia}})
({color{Goldenrod}{Goldenrod}})
({color{Gold}{Gold}})
({color{Gray}{Gray}})
({color{CadetBlue}{CadetBlue}})
({color{Green}{Green}})
({color{GreenYellow}{GreenYellow}})
({color{Lavender}{Lavender}})
({color{LimeGreen}{LimeGreen}})
({color{Magenta}{Magenta}})
({color{Maroon}{Maroon}})
({color{Orange}{Orange}})
({color{OrangeRed}{OrangeRed}})
({color{Orchid}{Orchid}})
({color{Plum}{Plum}})
({color{Purple}{Purple}})
({color{Red}{Red}})
({color{RoyalBlue}{RoyalBlue}})
({color{Salmon}{Salmon}})
({color{SeaGreen}{SeaGreen}})
({color{SkyBlue}{SkyBlue}})
({color{SpringGreen}{SpringGreen}})
({color{Tan}{Tan}})
({color{Thistle}{Thistle}})
({color{Turquoise}{Turquoise}})
({color{Violet}{Violet}})
({color{White}{White}}gets) 这是白= =
({color{Yellow}{Yellow}})
({color{YellowGreen}{YellowGreen}})
随便举个例子:
$x=dfrac{-bpmsqrt{color{Red}b^2-4ac}}{color{Blue}2a}$
$quad x=dfrac{-bpmsqrt{color{Red}b^2-4ac}}{color{Blue}2a}
$color{Blue}colorbox{Yellow}{LaTeX公式大全}$
(quadcolor{Blue}colorbox{Yellow}{LaTeX公式大全})
把数学公式框起来
$$oxed{sumlimits_{i = 1}^{n} i = dfrac{n(n - 1)}{2}}$$
ps:对于行内模式同样有效,不过大多情况用于独立模式。
(oxed{sumlimits_{i = 1}^{n} i = dfrac{n(n - 1)}{2}})