An equation numbering tool for Notion.
- Automatically adds equation numbers to LaTeX blocks in Notion documents.
- Automatically replaces equation references with corresponding numbers (similar to LaTeX's
\eqref).
-
Obtain an integration token.
-
Identify the Notion page you want to process and get its Page ID.
-
Set up the AlignEqRefs database and get its Database ID.
Create a .env file in the current directory and add the following:
NOTION_TOKEN=*********************
PAGE_ID=*********************
ALIGN_EQ_REFS_DB_ID=*********************npm i -g @suzu-sys/notion-eq
# OR use it via npx (no installation required)Use \tag{} or \tag{<digits>} in your LaTeX blocks to mark equations for numbering. Any digits you enter will be overwritten with the correct number automatically.
-
Equation block with a single
\tag{}:x^2 + 2x + 1 \tag{} -
Equation block with multiple
\tag{}s:\begin{align} \mathbf U^T\mathbf \Sigma^{-1}\mathbf U &= \mathbf\Lambda\tag{} \\ \mathbf\Sigma^{-1} &= \mathbf U\mathbf\Lambda\mathbf U^T\tag{} \end{align}
To reference a numbered equation, insert a link to the equation block from a text block. The link title does not affect numbering.
If the equation block contains multiple \tag{}s, register the referencing text block in the AlignEqRefs database.
# If installed:
notion-eq
# OR use npx:
npx @suzu-sys/notion-eq| Parameter | Description |
|---|---|
NOTION_TOKEN |
Your Notion integration token |
PAGE_ID |
The ID of the Notion page to process. |
ALIGN_EQ_REFS_DB_ID |
The ID of the AlignEqRefs database. |
EQ_PREFIX (Optional) |
Prefix of equation number in text blocks. Default: ( |
EQ_SUFFIX (Optional) |
Suffix of equation number in text blocks. Default: ) |
Note
EQ_PREFIX and EQ_SUFFIX apply only to how equation numbers appear in text blocks, not in LaTeX blocks.
Page and database IDs are 32-character alphanumeric strings, found at the end of a Notion page or database URL.
| Type | Example URL and ID |
|---|---|
| Page | https://www.notion.so/Sample-Page-9a3f0c7d5b8e1f24c6d07b1e4f3a2d8c?pvs=... |
| Database | https://www.notion.so/0f9b3d7ca1e45f28bdc07e2f6a3c9d14?v=... |
The AlignEqRefs database is used to handle references to individual equations within an equation block that contains multiple \tag{}s.
| Property | Type | Format | Example Value |
|---|---|---|---|
Paragraph Link |
Title | Link to the referencing text block. Link title does not affect numbering. | Link |
Index |
Text | Comma-separated list of 0-based \tag{} indices from the equation block. Only links to blocks with multiple \tag{}s are counted. Each index corresponds to the order of such links in the referencing text block. |
1,0,1 |
Note
Example
ref(U,0) and ref(U,1) refer to individual equations within a block that has multiple \tag{}s.
ref(x^2) refer to a block with only a single \tag{}.
If a text block contains:
"... ref(U,0) ... ref(x^2) ... ref(U,1) ..."
then the Index field should be "0,1".
Links to single-tag blocks (like ref(x^2)) are ignored when determining the order.




