Caption Numbering
approvedby Caption Numbering Plugin
Automatically number figure/table captions using 6th-level headings (######). - This plugin has not been manually reviewed by Obsidian staff.
Caption Numbering
Automatically number figure/table captions using 6th-level headings (
######) in Obsidian.
Features
- Tag-based auto-numbering: Define custom tags (e.g.,
图/Figure,表/Table,Algorithm). Headings starting with###### 图 xxxare automatically numbered as###### 图 1 xxx,###### 图 2 xxx, etc. - Custom tag management: Add, edit, or delete tags in the settings panel. Each tag gets its own independent counter.
- Chapter prefix numbering(Optional): Optionally prepend the chapter number from section headings (e.g.,
###### 图 1-1 xxxwhen under## 1 System Overview). - Smart tag suggestion: Type
######and a dropdown automatically appears to select a tag. - Auto-numbering: Optional timer-based auto-numbering (every 10 seconds) to keep captions up to date.
- Wikilink cross-reference sync: When a caption heading is renumbered, all
[[#caption]]wikilinks pointing to it are automatically updated:[[#图 1 系统架构]]→[[#图 2 系统架构|图 2]](target + display text updated)[[#图 1 系统架构]]→[[#图 1 系统架构|图 1]](display text auto-added if missing)
- Front matter support: Per-document settings via YAML front matter (e.g.,
caption numbering: 图, 表, auto). - Remove numbering: One-click command to strip all caption numbers.
How to install
From Obsidian Community Plugins (recommended)
- Go to Settings → Community Plugins → Browse.
- Search for "Caption Numbering".
- Click Install, then Enable.
Manual installation
- Download the latest release from the Releases page.
- Unzip into your vault's
.obsidian/plugins/caption-numbering/folder. - Enable the plugin in Settings → Community Plugins.
How to use
Basic workflow
- Open the Command Palette (
Cmd/Ctrl + P). - Type one of the following commands:
| Command | Description |
|---|---|
| Number captions in document | Auto-number all ###### captions with matching tags |
| Remove caption numbering | Strip all numbers from captions |
| Save settings to front matter | Write current tag settings to document front matter |
- You can also assign hotkeys to these commands in Settings → Hotkeys.
Writing captions
There are two ways to create captions:
Method A — Using the tag suggestion popup:
- Type
######(six hash marks + space). - A dropdown appears with your configured tags.
- Select a tag (e.g.,
图). - The cursor is placed after the tag, ready for you to type the caption text.
- Result:
###### 图 系统架构图
Method B — Manually:
###### 图 系统架构图
###### 表 数据对比
###### 算法 快速排序
Running numbering
After writing captions, run the Number captions in document command. The result:
###### 图 1 系统架构图
###### 图 2 流程图
###### 表 1 数据对比
###### 算法 1 快速排序
Chapter prefix numbering
If your document has numbered section headings like:
## 1 系统概述
###### 图 系统架构图
###### 图 流程图
## 2 功能设计
###### 图 部署图
Enable "章节前缀" (Chapter Prefix) in settings. The result:
## 1 系统概述
###### 图 1-1 系统架构图
###### 图 1-2 流程图
## 2 功能设计
###### 图 2-1 部署图
Cross-referencing with wikilinks
You can reference captions using Obsidian's built-in wikilink syntax:
[[#图 1 系统架构]]
After numbering, this automatically becomes:
[[#图 1 系统架构|图 1]]
If the caption is renumbered, the link updates automatically:
[[#图 2 系统架构|图 2]]
Per-document settings via front matter
Add to your document's front matter:
---
caption numbering: 图, 表, auto
---
This sets the tags to 图 and 表 and enables auto-numbering for this document only.
Available options:
图, 表, 算法— comma-separated tag namesauto— enable auto-numberingoff— disable numbering for this document
Settings
| Setting | Description |
|---|---|
| Tags | Add, edit, or delete caption tags. Each tag gets its own counter. |
| Numbering Mode | Single — 图 1, 图 2... / Chapter Prefix — 图 1-1, 图 1-2... |
| Source Heading Level | Which heading level to extract chapter numbers from (1–5) |
| Heading Level Digits | How many digits of the heading number to use (e.g., 1 → 1, 2 → 1.2) |
| Number Separator | Separator between chapter prefix and sequence number (e.g., -, ., :) |
| Auto-numbering | Toggle automatic numbering every 10 seconds |
Development
# Install dependencies
npm install
# Build for development (watch mode)
npm run dev
# Build for production
npm run build
# Run tests
npm test
Suggested to apply together with
License
MIT
Similar Project
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.