# math

URL: /patitas/api/plugins/math/
Section: plugins
Description: Math plugin for Patitas.

Adds support for LaTeX-style math expressions.

Usage:
    >>> md = create_markdown(plugins=["math"])
    >>> md("Inline: $E = mc^2$")
    '<p>Inline: <span class="math">E = mc^2</span></p>'
    >>> md("$$
E = mc^2
$$")
    '<div class="math-block">E = mc^2</div>'

Syntax:
Inline math: $expression$
Block math: $$expression$$ (on separate lines)

Escaping:
- ``\$`` for literal dollar sign
- Inside code spans, $ is literal

Notes:
- This plugin outputs semantic HTML classes
- Actual math rendering (MathJax, KaTeX) is done client-side
- Block math with display mode is on separate lines

Thread Safety:
This plugin is stateless and thread-safe.

---

> For a complete page index, fetch /patitas/llms.txt.

Open LLM text
(/patitas/api/plugins/math/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fplugins%2Fmath%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fplugins%2Fmath%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fplugins%2Fmath%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fplugins%2Fmath%2Findex.txt)

Module

#
`plugins.math`

Math plugin for Patitas.

Adds support for LaTeX-style math expressions.

Usage:

```
>>> md = create_markdown(plugins=["math"])
>>> md("Inline: $E = mc^2$")
'<p>Inline: <span class="math">E = mc^2</span></p>'
>>> md("$$
```

E = mc^2
$$")
'
E = mc^2
'

Syntax:

Inline math: $expression$
Block math: $$expression$$ (on separate lines)

Escaping:

- `\$`for literal dollar sign

- Inside code spans, $ is literal

Notes:

- This plugin outputs semantic HTML classes

- Actual math rendering (MathJax, KaTeX) is done client-side

- Block math with display mode is on separate lines

Thread Safety:

This plugin is stateless and thread-safe.

1Class

## Classes

`MathPlugin`

1

▼

Plugin adding $math$ and $$math$$ support.

Inline math uses $...$ syntax.
Block math uses $$...$$ …

Plugin adding $math$ and $$math$$ support.

Inline math uses $...$ syntax.
Block math uses $$...$$ on separate lines.

Enable via Markdown(plugins=["math"]).

Note: The actual parsing is controlled by ParseConfig.math_enabled,
which is set by the Markdown class based on the plugins list.

#### Methods

`name`

0

`str`

▼

property

`def name(self) -> str`

##### Returns

`str`
