AsciiMath is a simple, human-readable way to write math expressions in plain text. It's often used in platforms that support MathJax or KaTeX
If you are looking for instructions on how to write math and scientific expressions using the more powerful LaTeX format, use this tutorials.
Delimiters in AsciiMath
To tell the browser or renderer that your text is AsciiMath, you need to wrap it with delimiters. The
default
delimiter for AsciiMath is the
`
.
Example:
`int_0^1 x^2 dx`
`int_0^1 x^2 dx`
Note:
- Backtick can be found above the tab key on your keyboard.
- Use a single backtick
`
before and after the expression. - Backticks are different from apostrophes (
'
) or quotation marks ("
).
Basic Syntax
AsciiMath uses simple text representations for mathematical symbols:
`x^2`
→ `x^2`
`sqrt(x)`
→ `sqrt(x)`
`sum_(i=1)^n`
→ `sum_(i=1)^n`
`int_0^1`
→ `int_0^1`
`alpha, beta, gamma`
→ `alpha, beta, gamma`
Common AsciiMath Symbols and Syntax
Basic Operations
`x + y`
→ `x + y`
`x - y`
→ `x - y`
`x * y`
→ `x * y`
`x / y`
→ `x / y`
Exponents and Subscripts
`x^2`
→ `x^2`
`x^(n+1)`
→ `x^(n+1)`
`x_1`
→ `x_1`
`x_(i+j)`
→ `x_(i+j)`
Fractions
`x/y`
→ `x/y`
`(x+1)/(y-1)`
→ `(x+1)/(y-1)`
`frac(x+1)(y-1)`
→ `frac(x+1)(y-1)`
Roots
`sqrt(x)`
→ `sqrt(x)`
`root(n)(x)`
→ `root(n)(x)`
Greek Letters
Lowercase:
`alpha, beta, gamma, delta, pi, theta, lambda, mu`
Result: `alpha, beta, gamma, delta, pi, theta, lambda, mu`
Uppercase:
`Alpha, Beta, Gamma, Delta`
Result: `Alpha, Beta, Gamma, Delta`
Special Functions
`sin(x), cos(x), tan(x)`
`log(x), ln(x)`
`lim_(x->0)`
→ `lim_(x->0)`
Practical Examples
Quadratic Formula
`x = (-b +- sqrt(b^2 - 4ac))/(2a)`
Result: `x = (-b +- sqrt(b^2 - 4ac))/(2a)`
Integral
`int_0^pi sin(x) dx = 2`
Result: `int_0^pi sin(x) dx = 2`
Matrix
`[[1,2],[3,4]]`
Result: `[[1,2],[3,4]]`
Summation
`sum_(i=1)^n i = (n(n+1))/2`
Result: `sum_(i=1)^n i = (n(n+1))/2`
Next Steps
Once you're comfortable with basic AsciiMath:
- Explore advanced symbols and functions
- Learn about combining AsciiMath with LaTeX.
- Practice with complex equations
- Experiment with matrices and advanced notation