# How to write math formulas in Bear

> Information about math formulas in Bear using LaTeX by MathJax. Learn about Bear's privacy policy. Learn how to add math formulas in Bear.

Source: https://bear.app/faq/how-to-write-math-formulas-in-bear/

![](https://bear.app/faq/images/formula_1.png)

Bear supports rendering math formulas using [LaTeX](https://www.latex-project.org/) syntax, processed by [MathJax](https://www.mathjax.org/) under the hood. It allows you to display inline and block-style mathematical formulas within notes for your any technical documentations, college assignments or anything that requires scientific formulas and equations.

## How to add math formulas
### Using syntax
You can add math formulas using `$` or `$$`, just like adding code and code blocks in Bear.

#### Inline formula
Use single dollar signs to include a formula within a line of text. For example:  `$E = mc^2$`
This will render the formula inline with the surrounding text.

![](https://bear.app/faq/images/formula_2.png)
#### Block formula
Use double dollar signs on their own lines to create a centered, standalone formula. For example:
```
$$
\int_a^b f(x)\, dx = F(b) - F(a)
$$
```

This will render the formula as a block element.

![](https://bear.app/faq/images/formula_3.png)

### Using Menu
You can quickly insert math formulas from the formatting menu:
* On iOS, open the BIU keyboard, long press  ![](https://bear.app/faq/images/math_code_icon.png), then select ![](https://bear.app/faq/images/math_inline_icon.png) for inline formula and  ![](https://bear.app/faq/images/math_block_icon.png) for block formula
* On Mac, go to menu bar -> Format -> Code -> Math/Math block

![](https://bear.app/faq/images/math_keyboard.png)

## Editing formulas

When editing a formula, Bear displays a live preview: to the right of the input for inline formulas, and below for block formulas. To finish editing, simply move the caret outside the LaTeX expression. The LaTeX syntax will then be hidden, just like how Bear automatically hides Markdown formatting for a cleaner reading experience.

To edit an existing formula, simple click or tap the rendered formula, the editing LaTeX will appear for you to edit.

## Error Handling

If a formula contains an error, Bear will display an error message generated by MathJax. Click or tap the error message to edit the formula.

## Additional Resources

For a complete reference of supported syntax, commands, and advanced examples, please refer to [MathJax documentation](https://docs.mathjax.org).
