---
title: "Mathematics node styles"
description: "Style the math nodes that Tiptap renders with KaTeX."
canonical_url: "https://tiptap.dev/docs/ui-components/node-components/mathematics-node"
---

# Mathematics node styles

Style the math nodes that Tiptap renders with KaTeX.

The `mathematics-node` registry item adds an editable stylesheet to your project. The [Mathematics extension](https://tiptap.dev/docs/editor/extensions/nodes/mathematics.md) creates the math nodes and renders LaTeX with KaTeX.

## Install

In a React project with Tiptap and StarterKit, install the math extension, its renderer, and the node styles.

```bash
npm install @tiptap/extension-mathematics katex
npx @tiptap/cli@latest add mathematics-node
```

## Usage

```tsx
'use client'

import { Mathematics } from '@tiptap/extension-mathematics'
import { EditorContent, useEditor } from '@tiptap/react'
import { StarterKit } from '@tiptap/starter-kit'

import 'katex/dist/katex.min.css'
import '@/components/tiptap-node/mathematics-node/mathematics-node.scss'

export default function MathEditor() {
  const editor = useEditor({
    immediatelyRender: false,
    extensions: [StarterKit, Mathematics],
    content: '<p>Area of a circle: <span data-type="inline-math" data-latex="A=\\pi r^2"></span></p>',
  })

  return <EditorContent editor={editor} />
}
```
