Gunakan tools ini jika kamu ingin menulis rumus matematika di dalam html
AsciiMath adalah bahasa markup yang mudah ditulis untuk matematika.
Cobalah dalam renderer interaktif:
Untuk memulai, Anda memiliki dua opsi:
Gunakan MathJax untuk merender formula Anda. MathJax adalah mesin tampilan JavaScript open source yang lengkap untuk matematika dan berfungsi di semua browser.
Ini adalah pendekatan yang disarankan!
Mulailah dengan memuat konfigurasi AsciiMath default:
<script
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js?config=AM_CHTML"></script>
Kunjungi halaman Memulai MathJax untuk menemukan opsi CDN lainnya , atau untuk mempelajari cara menginstal MathJax secara lokal di server Anda.
Teks dalam HTML Anda yang terlampir di `
(backticks) sekarang akan dirender sebagai rumus matematika. Pembatas matematika juga dapat disesuaikan. Lihat situs web MathJax untuk informasi lebih lanjut!
Muat file javascript AsciiMath ( dapatkan di GitHub ) di tag head
atau body
di situs web Anda seperti ini:
<script
src="ASCIIMathML.js"></script>
File ini berisi JavaScript untuk mengonversi notasi AsciiMath dan (beberapa) LaTeX ke Presentation MathML. Konversi dilakukan saat halaman HTML dimuat.
Perhatian: Saat ini hanya berfungsi di Firefox dan Safari.
Sementara HTML5 sekarang menyertakan MathML sebagai rekomendasi resmi, browser yang tersisa tampaknya tidak mengimplementasikannya. Untuk kompatibilitas browser terluas, penggunaan MathJax direkomendasikan.
Most AsciiMath symbols attempt to mimic in text what they look like
rendered, like oo
for ∞. Many symbols can also be
displayed using a TeX alternative, but a preceeding backslash is not
required.
Type | TeX alt | See |
---|---|---|
+ | + | |
- | − | |
* | cdot | ⋅ |
** | ast | ∗ |
*** | star | ⋆ |
// | / | |
\\ | backslash setminus |
\ |
xx | times | × |
-: | div | ÷ |
|>< | ltimes | ⋉ |
><| | rtimes | ⋊ |
|><| | bowtie | ⋈ |
@ | circ | ∘ |
o+ | oplus | ⊕ |
ox | otimes | ⊗ |
o. | odot | ⊙ |
sum | ∑ | |
prod | ∏ | |
^^ | wedge | ∧ |
^^^ | bigwedge | ⋀ |
vv | vee | ∨ |
vvv | bigvee | ⋁ |
nn | cap | ∩ |
nnn | bigcap | ⋂ |
uu | cup | ∪ |
uuu | bigcup | ⋃ |
Type | TeX alt | See |
---|---|---|
2/3 | frac{2}{3} | 23 |
2^3 | 23 | |
sqrt x | √x | |
root(3)(x) | 3√x | |
int | ∫ | |
oint | ∮ | |
del | partial | ∂ |
grad | nabla | ∇ |
+- | pm | ± |
O/ | emptyset | ∅ |
oo | infty | ∞ |
aleph | ℵ | |
:. | therefore | ∴ |
:' | because | ∵ |
|...| | |ldots| | |...| |
|cdots| | |⋯| | |
vdots | ⋮ | |
ddots | ⋱ | |
|\ | | | | | |
|quad| | | | | |
/_ | angle | ∠ |
frown | ⌢ | |
/_\ | triangle | △ |
diamond | ⋄ | |
square | □ | |
|__ | lfloor | ⌊ |
__| | rfloor | ⌋ |
|~ | lceiling | ⌈ |
~| | rceiling | ⌉ |
CC | C | |
NN | N | |
Q | ||
RR | R | |
ZZ | Z | |
"hi" | text(hi) | hi |
Type | TeX alt | See |
---|---|---|
= | = | |
!= | ne | ≠ |
< | lt | < |
> | gt | > |
<= | le | ≤ |
>= | ge | ≥ |
mlt | ll | m< |
mgt | gg | m> |
-< | prec | ≺ |
-<= | preceq | ⪯ |
>- | succ | ≻ |
>-= | succeq | ⪰ |
in | ∈ | |
!in | notin | ∉ |
sub | subset | ⊂ |
sup | supset | ⊃ |
sube | subseteq | ⊆ |
supe | supseteq | ⊇ |
-= | equiv | ≡ |
~= | cong | ≅ |
~~ | approx | ≈ |
prop | propto | ∝ |
Type | TeX alt | See |
---|---|---|
and | and | |
or | or | |
not | neg | ¬ |
=> | implies | ⇒ |
if | if | |
<=> | iff | ⇔ |
AA | forall | ∀ |
EE | exists | ∃ |
_|_ | bot | ⊥ |
TT | top | ⊤ |
|-- | vdash | ⊢ |
|== | models | ⊨ |
Type | TeX alt | See |
---|---|---|
( | ( | |
) | ) | |
[ | [ | |
] | ] | |
{ | { | |
} | } | |
(: | langle | ⟨ |
:) | rangle | ⟩ |
<< | ⟨ | |
>> | ⟩ | |
{: x ) | x) | |
( x :} | (x | |
abs(x) | |x| | |
floor(x) | ⌊x⌋ | |
ceil(x) | ⌈x⌉ | |
norm(vecx) | ∥→x∥ |
Type | TeX alt | See |
---|---|---|
uarr | uparrow | ↑ |
darr | downarrow | ↓ |
rarr | rightarrow | → |
-> | to | → |
>-> | rightarrowtail | ↣ |
->> | twoheadrightarrow | ↠ |
>->> | twoheadrightarrowtail | ⤖ |
|-> | mapsto | ↦ |
larr | leftarrow | ← |
harr | leftrightarrow | ↔ |
rArr | Rightarrow | ⇒ |
lArr | Leftarrow | ⇐ |
hArr | Leftrightarrow | ⇔ |
Type | TeX alt | See |
---|---|---|
hat x | ˆx | |
bar x | overline x | ¯x |
ul x | underline x | x–– |
vec x | →x | |
tilde x | ˜x | |
dot x | .x | |
ddot x | ..x | |
overset(x)(=) | overset(x)(=) | x= |
underset(x)(=) | =x | |
ubrace(1+2) | underbrace(1+2) | 1+2 |
obrace(1+2) | overbrace(1+2) | 1+2 |
color(red)(x) | x | |
cancel(x) | x |
Type | See | Type | See |
---|---|---|---|
alpha | α | ||
beta | β | ||
gamma | γ | Gamma | Γ |
delta | δ | Delta | Δ |
epsilon | ε | ||
varepsilon | ɛ | ||
zeta | ζ | ||
eta | η | ||
theta | θ | Theta | Θ |
vartheta | ϑ | ||
iota | ι | ||
kappa | κ | ||
lambda | λ | Lambda | Λ |
mu | μ | ||
nu | ν | ||
xi | ξ | Xi | Ξ |
pi | π | Pi | Π |
rho | ρ | ||
sigma | σ | Sigma | Σ |
tau | τ | ||
upsilon | υ | ||
phi | ϕ | Phi | Φ |
varphi | φ | ||
chi | χ | ||
psi | ψ | Psi | Ψ |
omega | ω | Omega | Ω |
Type | TeX alt | See |
---|---|---|
bb "AaBbCc" | mathbf "AaBbCc" | AaBbCc |
bbb "AaBbCc" | mathbb "AaBbCc" | AaBbCc |
cc "AaBbCc" | mathcal "AaBbCc" | AaBbCc |
tt "AaBbCc" | mathtt "AaBbCc" | AaBbCc |
fr "AaBbCc" | mathfrak "AaBbCc" | AaBbCc |
sf "AaBbCc" | mathsf "AaBbCc" | AaBbCc |
sin, cos, tan, sec, csc, cot, arcsin, arccos, arctan, sinh, cosh, tanh, sech, csch, coth, exp, log, ln, det, dim, mod, gcd, lcm, lub, glb, min, max, f, g.
Matrices: [[a,b],[c,d]]
yields to [abcd]
Column vectors: ((a),(b))
yields to (ab)
Augmented matrices: [[a,b,|,c],[d,e,|,f]]
yields to [abcdef]
Matrices can be used for layout:
{(2x,+,17y,=,23),(x,-,y,=,5):}
yields
{2x+17y=23x−y=5
Complex subscripts: lim_(N->oo) sum_(i=0)^N
yields to limN→∞N∑i=0
Subscripts must come before superscripts:
int_0^1 f(x)dx
yields to ∫10f(x)dx
Derivatives: f'(x) = dy/dx
yields f'(x)=dydx
For variables other than x,y,z, or t you will need grouping symbols:
(dq)/(dp)
for dqdp
Overbraces and underbraces:
ubrace(1+2+3+4)_("4 terms")
yields 1+2+3+44 terms.
obrace(1+2+3+4)^("4 terms")
yields 4 terms1+2+3+4.
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!
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.
v ::= [A-Za-z] | greek letters | numbers | other constant symbols u ::= sqrt | text | bb | other unary symbols for font commands b ::= frac | root | stackrel | other binary symbols l ::= ( | [ | { | (: | {: | other left brackets r ::= ) | ] | } | :) | :} | other right brackets S ::= v | lEr | uS | bSS Simple expression I ::= S_S | S^S | S_S^S | S Intermediate expression E ::= IE | I/I Expression