I was trying to write some mathematical formulas and equations in the WordPress block editor, but I found that the core WordPress does not support Latex. After spending several hours, I concluded that you need to install some plugins to use Latex in WordPress. So, I looked for plugins in the WordPress admin area and found that all Latex plugins are very old. I did not find a single plugin tested on the latest version of WordPress. Installing an old plugin means inviting troubles; bad guys love old plugins to enter the WordPress installation.

I googled for the updated Latex plugin, but most of the websites I visited had mentioned the old plugins. Luckily I landed on the JetPack page. JetPack is a plugin from the WordPress team, which is maintained and updated periodically. Although JetPack is not a free plugin, you can use many features without paying, and Latex support for mathematical formulas and equations is one of those free features.

Here are the steps you need to follow to enable the LaTeX markup language to write mathematical equations and formulas:

- Install the plugin “JetPack” by automatic from the WordPress admin area.

- To enable the “Beautiful Math with LaTeX” feature, visit Jetpack → Settings → Writing in your site’s WP Admin.
- Scroll down to the Composing section and toggle on the Use the LaTeX markup language to write mathematical equations and formulas option.

To include LaTeX code in your post, use the following syntax (*remove space between $ and latex*):

`$ latex your-latex-code$`

For example, the following latex code

`$ latex x^2 = 2x +1 $`

produces

According to the JetPack documentation, WordPress puts all of your \LaTeX code inside a \LaTeX math environment. If you try to use \LaTeX that doesn’t work inside the math environment (such as \begin{align} … \end{align}), you will get an error: “formula does not parse.”