Mathematical Notation
Sage supports mathematical notation using
MathJax,
a cross-browser JavaScript library that
displays math notation in web browsers,
using MathML,
LaTeX,
and AsciiMath markup.
Use the [=] tag for AsciiMath notation…
[=]d^n/dx^n (x^n) = n![end]
The above produces…
~4jd6o4{d^n/dx^n (x^n) = n!}4jd6o4~
Read on for details about AsciiMath.
Note: {: and :} are invisible brackets, as shown above.
They often match with a visible bracket,
though when used together, they make an invisible element.
For example, {::}_(\ \ 92)^238U yields ~4jd6o4{{::}_(\ \ 92)^238U}4jd6o4~ .
For more details on the AsciiMath notation,
visit https://asciimath.org/.
~4jd6o4{d^n/dx^n (x^n) = n!}4jd6o4~
| Code | Symbol |
|---|---|
| + | |
| - | |
| * | |
| ** | |
| *** | |
| // | |
| \\ | |
| xx | |
| -: | |
| |>< | |
| ><| | |
| |><| | |
| @ | |
| o+ | |
| ox | |
| o. | |
| sum | ~4jd6o4{sum}4jd6o4~
|
| prod | ~4jd6o4{prod}4jd6o4~
|
| ^^ | |
| ^^^ | ~4jd6o4{^^^}4jd6o4~
|
| vv | |
| vvv | ~4jd6o4{vvv}4jd6o4~
|
| nn | |
| nnn | ~4jd6o4{nnn}4jd6o4~
|
| uu | |
| uuu | ~4jd6o4{uuu}4jd6o4~
|
| Code | Symbol |
|---|---|
| 2/3 | |
| 2^3 | |
| a_i | |
| sqrt x | |
| root(3)(x) | |
| int | |
| oint | |
| del | |
| grad | |
| +- | |
| O/ | |
| oo | |
| aleph | |
| :. | |
| :' | |
| |...| | |
| |cdots| | |
| vdots | |
| ddots | |
| |\ | | |
| |quad| | |
| /_ | |
| frown | |
| /_\ | |
| diamond | |
| square | |
| |__ | |
| __| | |
| |~ | |
| ~| | |
| CC | |
| NN | |
| | |
| RR | |
| ZZ | |
| "hello" | |
| Code | Symbol |
|---|---|
| = | |
| != | |
| < | |
| > | |
| <= | |
| >= | |
| mlt | |
| < | |
| m | |
| -< | |
| -<= | |
| >- | |
| >-= | |
| in | |
| !in | |
| sub | |
| sup | |
| sube | |
| supe | |
| -= | |
| ~= | |
| ~~ | |
| prop | |
| Code | Symbol |
|---|---|
| and | |
| or | |
| not | |
| => | |
| if | |
| <=> | |
| AA | |
| EE | |
| _|_ | |
| TT | |
| |-- | |
| |== | |
| Code | Symbol |
|---|---|
| ( | |
| ) | |
| [ | |
| ] | |
| { | |
| } | |
| (: | |
| :) | |
| << | |
| >> | |
| {: x ) | |
| ( x :} | |
| abs(x) | |
| floor(x) | |
| ceil(x) | |
| norm(vecx) | |
For example, {::}_(\ \ 92)^238U yields ~4jd6o4{{::}_(\ \ 92)^238U}4jd6o4~ .
| Code | Symbol |
|---|---|
| hat x | |
| bar x | |
| ul x | |
| vec x | |
| tilde x | |
| dot x | |
| ddot x | |
| overset(x)(=) | |
| underset(x)(=) | |
| ubrace(1+2) | |
| obrace(1+2) | |
| overarc(AB) | |
| color(red)(x) | |
| cancel(x) | |
| Code | Symbol |
|---|---|
| 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 | |
| Code | Symbol |
|---|---|
| bb "AaBbCc" | |
| bbb "AaBbCc" | |
| cc "AaBbCc" | |
| tt "AaBbCc" | |
| fr "AaBbCc" | |
| sf "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
~4jd6o4{[[a,b],[c,d]]}4jd6o4~
Column vectors:
((a),(b)) yields
~4jd6o4{((a),(b))}4jd6o4~
Augmented matrices:
[[a,b,|,c],[d,e,|,f]] yields
~4jd6o4{[[a,b,|,c],[d,e,|,f]]}4jd6o4~
Matrices can be used for layout:
{(2x,+,17y,=,23),(x,-,y,=,5):} yields
~4jd6o4{{(2x,+,17y,=,23),(x,-,y,=,5):}}4jd6o4~
Complex subscripts:
lim_(N->oo) sum_(i=0)^N yields
~4jd6o4{lim_(N->oo) sum_(i=0)^N}4jd6o4~
Subscripts must come before superscripts:
int_0^1 f(x)dx yields
~4jd6o4{int_0^1 f(x)dx}4jd6o4~
Derivatives:
f'(x) = dy/dx yields
~4jd6o4{f'(x) = dy/dx}4jd6o4~
For variables other than x, y, z, or t,
you will need grouping symbols:
(dq)/(dp) for
~4jd6o4{(dq)/(dp)}4jd6o4~
Underbraces:
ubrace(1+2+3+4)_("4 terms") yields
~4jd6o4{ubrace(1+2+3+4)_("4 terms")}4jd6o4~
Overbraces:
obrace(1+2+3+4)^("4 terms") yields
~4jd6o4{obrace(1+2+3+4)^("4 terms")}4jd6o4~
Prescripts:
{::}_(\ \ 92)^238U yields
~4jd6o4{{::}_(\ \ 92)^238U}4jd6o4~
Forced spaces:
\ (backslash followed by a space)
yields a non-breaking space.
Example: a\ b yields ~4jd6o4{a\ b}4jd6o4~ but a b yields ~4jd6o4{a b}4jd6o4~
Stacking: use stackrel to stack elements:Example: a\ b yields ~4jd6o4{a\ b}4jd6o4~ but a b yields ~4jd6o4{a b}4jd6o4~
stackrel"def"= yields
~4jd6o4{stackrel"def"=}4jd6o4~
Use the [mathi] and [mathd] tags
for LaTeX notation.
The [mathi] tag
is for inline notation…
Einstein's famous [mathi]E = mc^2[end] discovery.
The above produces…
Einstein's famous ~4jd6o4(E = mc^2)4jd6o4~ discovery.
In contrast, the [mathd] tag
is for "display" notation…
Einstein's famous [mathd]E = mc^2[end] discovery.
The above produces…
Einstein's famous ~4jd6o4[E = mc^2]4jd6o4~ discovery.
For details on the LaTeX notation,
visit https://www.latex-project.org/.
Einstein's famous ~4jd6o4(E = mc^2)4jd6o4~ discovery.
Einstein's famous ~4jd6o4[E = mc^2]4jd6o4~ discovery.
Use the [mathml] tag for MathML notation…
The area of a circle is
[mathml]
<mi>π</mi>
<mo>⁢</mo>
<msup>
<mi>r</mi>
<mn>2</mn>
</msup>
[end]
The above produces…
The area of a circle is
For details on the MathML notation,
visit https://www.w3.org/TR/MathML/
or https://www.iso.org/standard/58439.html.
The area of a circle is
⏱ Last Modified: 1/6/25 11:08:10 am