2008/02/19

[Misc] 在網頁中顯示數學符號

想當年, 想要把數學符號顯示在網頁上, 都還要用圖形來取代. 現在時代進步了, 不需要這麼麻煩 (至少顯示簡單數學符號或式子時是如此)

顯示上標, 可以用html的<sup></sup>, 顯示下標, 可以用<sub></sub>, 比方說, 在 html 檔裡寫 &Sigma;<sub>1 &le; k &le; n</sub> = n(n+1)/2 會在browser 顯示

Σ1≤k≤n = n(n+1)/2

但複雜的數學式還是要靠圖檔顯示. 這一方面, LaTex 是最強者.

底下這張就是數學符號的列表, 第二三行是html裡的語法, 最後兩行則是 Entity和十六進位分別在browser 顯示出來的符號. 我個人的測試報告是, 平常少見的字元沒辦法在 browser 上顯示出來, 比方像是 dot operation 或 &lang; 目前來講, IE6 的缺字比 firefox 多.

字元 Entity 十六進位 Entity 十六進位
Latin small f with hook &fnof; &#x192; ƒ ƒ
希臘大寫字母 alpha &Alpha; &#x391; Α Α
希臘大寫字母 beta &Beta; &#x392; Β Β
希臘大寫字母 gamma &Gamma; &#x393; Γ Γ
希臘大寫字母 delta &Delta; &#x394; Δ Δ
希臘大寫字母 epsilon &Epsilon; &#x395; Ε Ε
希臘大寫字母 zeta &Zeta; &#x396; Ζ Ζ
希臘大寫字母 eta &Eta; &#x397; Η Η
希臘大寫字母 theta &Theta; &#x398; Θ Θ
希臘大寫字母 iota &Iota; &#x399; Ι Ι
希臘大寫字母 kappa &Kappa; &#x39A; Κ Κ
希臘大寫字母 lambda &Lambda; &#x39B; Λ Λ
希臘大寫字母 mu &Mu; &#x39C; Μ Μ
希臘大寫字母 nu &Nu; &#x39D; Ν Ν
希臘大寫字母 xi &Xi; &#x39E; Ξ Ξ
希臘大寫字母 omicron &Omicron; &#x39F; Ο Ο
希臘大寫字母 pi &Pi; &#x3A0; Π Π
希臘大寫字母 rho &Rho; &#x3A1; Ρ Ρ
希臘大寫字母 sigma &Sigma; &#x3A3; Σ Σ
希臘大寫字母 tau &Tau; &#x3A4; Τ Τ
希臘大寫字母 upsilon &Upsilon; &#x3A5; Υ Υ
希臘大寫字母 phi &Phi; &#x3A6; Φ Φ
希臘大寫字母 chi &Chi; &#x3A7; Χ Χ
希臘大寫字母 psi &Psi; &#x3A8; Ψ Ψ
希臘大寫字母 omega &Omega; &#x3A9; Ω Ω
希臘小寫字母 alpha &alpha; &#x3B1; α α
希臘小寫字母 beta &beta; &#x3B2; β β
希臘小寫字母 gamma &gamma; &#x3B3; γ γ
希臘小寫字母 delta &delta; &#x3B4; δ δ
希臘小寫字母 epsilon &epsilon; &#x3B5; ε ε
希臘小寫字母 zeta &zeta; &#x3B6; ζ ζ
希臘小寫字母 eta &eta; &#x3B7; η η
希臘小寫字母 theta &theta; &#x3B8; θ θ
希臘小寫字母 iota &iota; &#x3B9; ι ι
希臘小寫字母 kappa &kappa; &#x3BA; κ κ
希臘小寫字母 lambda &lambda; &#x3BB; λ λ
希臘小寫字母 mu &mu; &#x3BC; μ μ
希臘小寫字母 nu &nu; &#x3BD; ν ν
希臘小寫字母 xi &xi; &#x3BE; ξ ξ
希臘小寫字母 omicron &omicron; &#x3BF; ο ο
希臘小寫字母 pi &pi; &#x3C0; π π
希臘小寫字母 rho &rho; &#x3C1; ρ ρ
希臘小寫字母 final sigma &sigmaf; &#x3C2; ς ς
希臘小寫字母 sigma &sigma; &#x3C3; σ σ
希臘小寫字母 tau &tau; &#x3C4; τ τ
希臘小寫字母 upsilon &upsilon; &#x3C5; υ υ
希臘小寫字母 phi &phi; &#x3C6; φ φ
希臘小寫字母 chi &chi; &#x3C7; χ χ
希臘小寫字母 psi &psi; &#x3C8; ψ ψ
希臘小寫字母 omega &omega; &#x3C9; ω ω
希臘小寫字母 theta symbol &thetasym; &#x3D1; ϑ ϑ
Greek upsilon with hook symbol &upsih; &#x3D2; ϒ ϒ
Greek pi symbol &piv; &#x3D6; ϖ ϖ
bullet = black small circle &bull; &#x2022;
horizontal ellipsis = three dot leader &hellip; &#x2026;
prime = minutes = feet &prime; &#x2032;
double prime = seconds = inches &Prime; &#x2033;
overline = spacing overscore &oline; &#x203E;
fraction slash &frasl; &#x2044;
script capital P &weierp; &#x2118;
blackletter capital I &image; &#x2111;
blackletter capital R &real; &#x211C;
trade mark sign &trade; &#x2122;
alef symbol &alefsym; &#x2135;
leftwards arrow &larr; &#x2190;
upwards arrow &uarr; &#x2191;
rightwards arrow &rarr; &#x2192;
downwards arrow &darr; &#x2193;
left right arrow &harr; &#x2194;
downwards arrow with corner leftwards &crarr; &#x21B5;
leftwards double arrow &lArr; &#x21D0;
upwards double arrow &uArr; &#x21D1;
rightwards double arrow &rArr; &#x21D2;
downwards double arrow &dArr; &#x21D3;
left right double arrow &hArr; &#x21D4;
for all &forall; &#x2200;
partial differential &part; &#x2202;
there exists &exist; &#x2203;
empty set = null set = diameter &empty; &#x2205;
nabla = backward difference &nabla; &#x2207;
element of &isin; &#x2208;
not an element of &notin; &#x2209;
contains as member &ni; &#x220B;
n-ary product = product sign &prod; &#x220F;
n-ary sumation &sum; &#x2211;
minus sign &minus; &#x2212;
asterisk operator &lowast; &#x2217;
square root = radical sign &radic; &#x221A;
proportional to &prop; &#x221D;
infinity &infin; &#x221E;
angle &ang; &#x2220;
logical and = wedge &and; &#x2227;
logical or = vee &or; &#x2228;
intersection = cap &cap; &#x2229;
union = cup &cup; &#x222A;
integral &int; &#x222B;
therefore &there4; &#x2234;
tilde operator = varies with = similar to &sim; &#x223C;
approximately equal to &cong; &#x2245;
almost equal to = asymptotic to &asymp; &#x2248;
not equal to &ne; &#x2260;
identical to &equiv; &#x2261;
less-than or equal to &le; &#x2264;
greater-than or equal to &ge; &#x2265;
subset of &sub; &#x2282;
superset of &sup; &#x2283;
not a subset of &nsub; &#x2284;
subset of or equal to &sube; &#x2286;
superset of or equal to &supe; &#x2287;
circled plus = direct sum &oplus; &#x2295;
circled times = vector product &otimes; &#x2297;
up tack = orthogonal to = perpendicular &perp; &#x22A5;
dot operator &sdot; &#x22C5;
left ceiling = APL upstile &lceil; &#x2308;
right ceiling &rceil; &#x2309;
left floor = APL downstile &lfloor; &#x230A;
right floor &rfloor; &#x230B;
left-pointing angle bracket = bra &lang; &#x2329;
right-pointing angle bracket = ket &rang; &#x232A;
lozenge &loz; &#x25CA;
black spade suit &spades; &#x2660;
black club suit = shamrock &clubs; &#x2663;
black heart suit = valentine &hearts; &#x2665;
black diamond suit &diams; &#x2666;

沒有留言: