标签:
一、实现方法:http://asciimath.org/
1、asciimathml,mathjax
二、展示技巧:
This is the recommended approach!
Get started by loading the default AsciiMath configuration:
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML"></script>
Text in you HTML enclosed in `
(backticks) will now get rendered as a math formula. The math delimiters can also be customized. Check out the MathJax website for more information!
Load the AsciiMath javascript file (get it on GitHub) in either the head
or the body
tag of your website like this:
<script src="ASCIIMathML.js"></script>
This file contains JavaScript to convert AsciiMath notation and (some) LaTeX to Presentation MathML. The conversion is done while the HTML page loads.
Attention: Currently this only works in Firefox 3+ and Safari 5.1
Type | See |
---|---|
+ | + |
- | − |
* | ⋅ |
** | ∗ |
*** | ? |
// | / |
\\ | \ |
xx | × |
-: | ÷ |
@ | ° |
o+ | ⊕ |
ox | ⊗ |
o. | ⊙ |
sum | ∑ |
prod | ∏ |
^^ | ∧ |
^^^ | ? |
vv | ∨ |
vvv | ? |
nn | ∩ |
nnn | ? |
uu | ∪ |
uuu | ? |
Type | See |
---|---|
int | ∫ |
oint | ∮ |
del | ∂ |
grad | ∇ |
+- | ± |
O/ | ∅ |
oo | ∞ |
aleph | ℵ |
/_ | ∠ |
:. | ∴ |
|...| | |...| |
|cdots| | |?| |
vdots | ? |
ddots | ? |
|\ | | | | |
|quad| | | | |
diamond | ? |
square | □ |
|__ | ⌊ |
__| | ⌋ |
|~ | ⌈ |
~| | ⌉ |
CC | C |
NN | N |
Q | |
RR | R |
ZZ | Z |
Type | See |
---|---|
= | = |
!= | ≠ |
< | < |
> | > |
<= | ≤ |
>= | ≥ |
-< | ? |
>- | ? |
in | ∈ |
!in | ∉ |
sub | ⊂ |
sup | ⊃ |
sube | ⊆ |
supe | ⊇ |
-= | ≡ |
~= | ≅ |
~~ | ≈ |
prop | ∝ |
Type | See | Type | See |
---|---|---|---|
alpha | α | ||
beta | β | ||
chi | χ | ||
delta | δ | Delta | Δ |
epsilon | ε | ||
varepsilon | ? | ||
eta | η | ||
gamma | γ | Gamma | Γ |
iota | ι | ||
kappa | κ | ||
lambda | λ | Lambda | Λ |
mu | μ | ||
nu | ν | ||
omega | ω | Omega | Ω |
phi | ? | Phi | Φ |
varphi | φ | ||
pi | π | Pi | Π |
psi | ψ | Psi | Ψ |
rho | ρ | ||
sigma | σ | Sigma | Σ |
tau | τ | ||
theta | θ | Theta | Θ |
vartheta | ϑ | ||
upsilon | υ | ||
xi | ξ | Xi | Ξ |
zeta | ζ |
Type | See |
---|---|
and | and |
or | or |
not | ¬ |
=> | ⇒ |
if | if |
iff | ⇔ |
AA | ∀ |
EE | ∃ |
_|_ | ⊥ |
TT | ? |
|-- | ? |
|== | ? |
Type | See |
---|---|
( | ( |
) | ) |
[ | [ |
] | ] |
{ | { |
} | } |
(: | ? |
:) | ? |
{: | |
:} | :} |
Type | See |
---|---|
uarr | ↑ |
darr | ↓ |
rarr | → |
-> | → |
|-> | ? |
larr | ← |
harr | ↔ |
rArr | ⇒ |
lArr | ⇐ |
hArr | ⇔ |
Type | See |
---|---|
hat x | xˆ |
bar x | x¯ |
ul x | x− |
vec x | x→ |
dot x | x. |
ddot x | x.. |
Type | See |
---|---|
bb "AaBbCc" | AaBbCc |
bbb "AaBbCc" | AaBbCc |
cc "AaBbCc" | AaBbCc |
tt "AaBbCc" | AaBbCc |
fr "AaBbCc" | AaBbCc |
sf "AaBbCc" | AaBbCc |
Matrices: [[a,b],[c,d]]
yields to [acbd]
Column vectors: ((a,b),(c,d))
yields to (acbd)
Complex subscripts: lim_(x->oo)
yields to limx→∞
Subscripts must come before superscripts: int_0^1 f(x)dx
yields to ∫10f(x)dx
Attention: Always try to surround the >
and <
characters with spaces so that the html parser does not confuse it with an opening or closing tag!
sin, cos, tan, csc, sec, cot, sinh, cosh, tanh, log, ln, det, dim, lim, mod, gcd, lcm, min, max
Here is a definition of the grammar used to parse AsciiMath expressions. In the Backus-Naur form given below, the letter on the left of the ::=
represents a category of symbols that could be one of the possible sequences of symbols listed on the right. The vertical bar |
separates the alternatives.
c ::= [A-z] | numbers | greek letters | other constant symbols (see below) u ::= ‘sqrt‘ | ‘text‘ | ‘bb‘ | other unary symbols for font commands b ::= ‘frac‘ | ‘root‘ | ‘stackrel‘ binary symbols l ::= ( | [ | { | (: | {: left brackets r ::= ) | ] | } | :) | :} right brackets S ::= c | lEr | uS | bSS | "any" simple expression E ::= SE | S/S | S_S | S^S | S_S^S expression (fraction, sub-, super-, subsuperscript)
标签:
原文地址:http://www.cnblogs.com/fedro/p/4401935.html