---
title: "Math Equations"
description: "Write LaTeX in Nuxt Starter Kit."
canonical_url: "https://nnsvn.me/products/nuxt-starter-kit/api/integrations/math"
---

> Index of every page on this site: [llms.txt](https://nnsvn.me/llms.txt)

<ct-tabs variant="line">
<div label="KaTeX">
<ct-steps>

### Install Plugins

<ct-pm-install :save-dev="true" name="remark-math rehype-katex">



</ct-pm-install>

### Add Plugins to Nuxt Config

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  devtools: { enabled: true },
  css: [
    'katex/dist/katex.min.css',
  ],
  content: {
    build: {
      markdown: {
        remarkPlugins: [
          'remark-math',
        ],
        rehypePlugins: {
          'rehype-katex': {
            output: 'html',
          },
        },
      },
    },
  },
});
```

### Write LaTeX

```mdc
#### Inline
$E = mc^2$

#### Centered
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

#### Math Block
```math
L = \frac{1}{2} \rho v^2 S C_L
```
```

</ct-steps>
</div>

<div label="MathJax">
<ct-steps>

### Install Plugins

<ct-pm-install :save-dev="true" name="remark-math rehype-mathjax">



</ct-pm-install>

### Add Plugins to Nuxt Config

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  devtools: { enabled: true },
  content: {
    build: {
      markdown: {
        remarkPlugins: [
          'remark-math',
        ],
        rehypePlugins: [
          'rehype-mathjax',
        ],
      },
    },
  },
});
```

### Write LaTeX

```mdc
$E = mc^2$

$$
E = mc^2
$$

```math
E = mc^2
```
```

</ct-steps>
</div>
</ct-tabs>

## Sitemap

See the full [sitemap](https://nnsvn.me/sitemap.md) for all pages.
