# Mathematical formula & LaTeX

WonderPen supports embedded mathematical formulas, if you are familiar with LaTeX or related syntax, it will be easy to insert all kinds of formulas in WonderPen.

## Formula blocks

Formula blocks refer to formulas that occupy a single paragraph. They are usually wrapped between $$ and $$. E.g:

$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$


Will be rendered as:

If the formula is complex, you can also wrap lines in the middle, for example:

\begin {aligned} \sin \theta &= \sin(\frac{\pi}{4})(1 - 2\sin^2\alpha) - \cos(\frac{\pi}{4}) \cdot 2\sin \alpha \cos \alpha\\ &=\frac{1}{\sqrt{2}}(1 - 2\cdot(\frac{1}{\sqrt{5}})^2) - \frac{1}{\sqrt{2}} \cdot 2 \cdot \frac{1}{\sqrt{5}} \cdot \frac{2}{\sqrt{5}}\\ &= \frac{3}{5\sqrt{2}} - \frac{4}{5\sqrt{2}} \end {aligned}


Will be rendered as:

## Inline Formulas

You can also embed formulas within sentences within a paragraph. This form is called inline formulas. Inline formulas are usually wrapped between $ and $.

E.g:

This formula will be displayed in-line: $\left( \frac{n^2}{6} \right)$


Will be rendered as: