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