InkCop integrates the KaTeX math engine. The examples below use a source + rendered result format. You can copy the content from the source blocks directly into your document, and MarkdownRenderer will recognize and render the formulas automatically.

Tip: Use $...$ and $$...$$ directly. Code blocks are only for showing the raw source, not for placing formulas inside them.

Inline Formulas

Source

Inline formulas in text should be wrapped with `$`.

For example, `$E = mc^2$` renders as an inline formula.

Rendered Result

Inline formulas in text should be wrapped with $.

For example, $E = mc^2$ renders as an inline formula: E=mc2E = mc^2.

Block Formulas

Source

Block formulas should be wrapped with `$$`.

$$
\frac{\partial u}{\partial t} = \alpha \nabla^2 u
$$

Rendered Result

Block formulas should be wrapped with $$.

ut=α2u\frac{\partial u}{\partial t} = \alpha \nabla^2 u

Common Examples

Summation

Source

$$\sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n$$

Rendered Result

i=1nxi=x1+x2++xn\sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n

Integral

Source

$$\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$

Rendered Result

0ex2dx=π2\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}

Statistics

Source

$$\bar{x} = \frac{1}{n}\sum_{i=1}^{n}x_i$$

$$\sigma = \sqrt{\frac{1}{N}\sum_{i=1}^{N}(x_i - \mu)^2}$$

Rendered Result

xˉ=1ni=1nxi\bar{x} = \frac{1}{n}\sum_{i=1}^{n}x_i

σ=1Ni=1N(xiμ)2\sigma = \sqrt{\frac{1}{N}\sum_{i=1}^{N}(x_i - \mu)^2}

Supported LaTeX Commands

InkCop’s KaTeX supports most common LaTeX math commands, including:

  • Greek letters: \alpha, \beta, \gamma, \delta, \theta, \lambda, and more
  • Operators: \sum, \prod, \int, \lim, \max, \min
  • Relations: \leq, \geq, \neq, \approx, \equiv
  • Arrows: \rightarrow, \leftarrow, \Leftrightarrow
  • Fonts: \mathbb{R}, \mathcal{L}, \mathbf{x}
  • Fractions: \frac{a}{b}, \dfrac{a}{b}
  • Subscripts and superscripts: x^2, x_i, x_{ij}^{(k)}

Usage Tips

ℹ️

If you are not familiar with LaTeX syntax, you can simply describe the formula to the AI assistant. For example, ask it to write the LaTeX code for Bayes’ theorem, and it will generate the corresponding code.

Formula Numbers

For formulas that need numbering or references, add a \tag{} label after the formula.

Source

$$
\mathbf{A}\mathbf{x} = \mathbf{b}\tag{1}
$$

Rendered Result

Ax=b(1)\mathbf{A}\mathbf{x} = \mathbf{b}\tag{1}

Migrating from Older Documents

If your old documents use plain text formulas with the $...$ syntax, InkCop will automatically convert them into renderable math nodes when the document is opened. For new documents, we recommend writing them using the “source + rendered result” format shown above.