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…
~XR0znX{d^n/dx^n (x^n) = n!}XR0znX~
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 ~XR0znX{{::}_(\ \ 92)^238U}XR0znX~ .
~XR0znX{d^n/dx^n (x^n) = n!}XR0znX~
Code | Symbol |
---|---|
+ | |
- | |
* | |
** | |
*** | |
// | |
\\ | |
xx | |
-: | |
|>< | |
><| | |
|><| | |
@ | |
o+ | |
ox | |
o. | |
sum | ~XR0znX{sum}XR0znX~
|
prod | ~XR0znX{prod}XR0znX~
|
^^ | |
^^^ | ~XR0znX{^^^}XR0znX~
|
vv | |
vvv | ~XR0znX{vvv}XR0znX~
|
nn | |
nnn | ~XR0znX{nnn}XR0znX~
|
uu | |
uuu | ~XR0znX{uuu}XR0znX~
|
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 ~XR0znX{{::}_(\ \ 92)^238U}XR0znX~ .
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:
For more details on the AsciiMath notation,
visit https://asciimath.org/.
[[a,b],[c,d]] yields
~XR0znX{[[a,b],[c,d]]}XR0znX~
Column vectors:
((a),(b)) yields
~XR0znX{((a),(b))}XR0znX~
Augmented matrices:
[[a,b,|,c],[d,e,|,f]] yields
~XR0znX{[[a,b,|,c],[d,e,|,f]]}XR0znX~
Matrices can be used for layout:
{(2x,+,17y,=,23),(x,-,y,=,5):} yields
~XR0znX{{(2x,+,17y,=,23),(x,-,y,=,5):}}XR0znX~
Complex subscripts:
lim_(N->oo) sum_(i=0)^N yields
~XR0znX{lim_(N->oo) sum_(i=0)^N}XR0znX~
Subscripts must come before superscripts:
int_0^1 f(x)dx yields
~XR0znX{int_0^1 f(x)dx}XR0znX~
Derivatives:
f'(x) = dy/dx yields
~XR0znX{f'(x) = dy/dx}XR0znX~
For variables other than x, y, z, or t,
you will need grouping symbols:
(dq)/(dp) for
~XR0znX{(dq)/(dp)}XR0znX~
Underbraces:
ubrace(1+2+3+4)_("4 terms") yields
~XR0znX{ubrace(1+2+3+4)_("4 terms")}XR0znX~
Overbraces:
obrace(1+2+3+4)^("4 terms") yields
~XR0znX{obrace(1+2+3+4)^("4 terms")}XR0znX~
Prescripts:
{::}_(\ \ 92)^238U yields
~XR0znX{{::}_(\ \ 92)^238U}XR0znX~
Forced spaces:
\ (backslash followed by a space)
yields a non-breaking space.
Example: a\ b yields ~XR0znX{a\ b}XR0znX~ but a b yields ~XR0znX{a b}XR0znX~
Stacking: use stackrel to stack elements:Example: a\ b yields ~XR0znX{a\ b}XR0znX~ but a b yields ~XR0znX{a b}XR0znX~
stackrel"def"= yields
~XR0znX{stackrel"def"=}XR0znX~
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 ~XR0znX(E = mc^2)XR0znX~ 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 ~XR0znX[E = mc^2]XR0znX~ discovery.
For details on the LaTeX notation,
visit https://www.latex-project.org/.
Einstein's famous ~XR0znX(E = mc^2)XR0znX~ discovery.
Einstein's famous ~XR0znX[E = mc^2]XR0znX~ 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: 10/24 10:44:32 am