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

Addition: `x + y` → `x + y`
Subtraction: `x - y` → `x - y`
Multiplication: `x * y` → `x * y`
Division: `x / y` → `x / y`

Exponents and Subscripts

Superscript: `x^2` → `x^2`
Complex power: `x^(n+1)` → `x^(n+1)`
Subscript: `x_1` → `x_1`
Complex subscript: `x_(i+j)` → `x_(i+j)`

Fractions

Simple: `x/y` → `x/y`
Complex: `(x+1)/(y-1)` → `(x+1)/(y-1)`
Displayed: `frac(x+1)(y-1)` → `frac(x+1)(y-1)`

Roots

Square root: `sqrt(x)` → `sqrt(x)`
Nth root: `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`

Some greek letters do not have Uppercase in AsciiMath

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:

Remember: AsciiMath is designed to be intuitive. If you can type it naturally, it probably works!