An Emacs package that implements Luhmann's numbering system for Org mode.
org-luhmann provides a systematic way to organize your notes using Luhmann's numbering system in Org mode. This system enables:
- Hierarchical numbering (e.g., 1, 1.1, 1.2)
- Branch sequences with letters (e.g., 1a, 1b, 1c)
- Infinite insertion between existing notes
- Automatic number generation based on context
org-luhmann is designed to work incrementally, helping you build your note structure one node at a time. Unlike automatic outline numbering, it:
- Does not automatically number all headings at once
- Generates numbers based on existing context (siblings and parents)
- Lets you choose the relationship of new nodes to existing ones
- Preserves the semantic meaning of your note structure
When you add a new number, org-luhmann analyzes:
- Current heading's level
- Previous sibling's number (if any)
- Parent's number (if any)
- Existing branch sequences
Then offers appropriate numbering options like:
- Next main sequence number (1, 2, 3, ...)
- Next branch letter (1a, 1b, 1c, ...)
- Next sub-number (1.1, 1.2, ...)
- Next parent branch (2.1, 2.2, ...)
This approach ensures that your note structure grows organically and maintains meaningful relationships between notes.
When adding a number, you'll be prompted with these options:
- New main number (e.g., next available top-level number)
- Continue sequence (add letter suffix)
- Branch from current (create sub-number)
- Branch from parent (create sibling number)
This feature has been moved to a separate package: org-workbench. Please refer to its README.md for details.
(use-package org-luhmann
:straight (:host github :repo "yibie/org-luhmann")
:after org
:config
(org-luhmann-setup))- Download
org-luhmann.elto your load-path - Add to your init file:
(require 'org-luhmann)
(org-luhmann-setup)M-x org-luhmann-add-number- Add a Luhmann number to current headingM-x org-luhmann-add-node- Create a new heading with a Luhmann numberM-x org-luhmann-export-region-as-links- Export headings in region as org-mode linksM-x org-luhmann-next-unnumbered-heading- Navigate to next unnumbered headingM-x org-luhmann-previous-unnumbered-heading- Navigate to previous unnumbered heading
* 1 Main topic
** 1.1 First subtopic
** 1.2 Second subtopic
** 1.2a Branch of 1.2
** 1.2b Another branch
** 1.2.1 Sub-subtopic
* 2 Second main topic
The intelligent subtree movement feature allows you to reorganize your knowledge structure:
Before moving:
* 1 AI Research
* 2 Market Analysis
* 3 Technical Details
* 3.1 Implementation
* 3.2 Architecture
* 4 Future Plans
After moving "3 Technical Details" under "1 AI Research":
* 1 AI Research
* 1.1 Technical Details
* 1.1.1 Implementation
* 1.1.2 Architecture
* 2 Market Analysis
* 4 Future Plans ← Number gap preserved (Strategy A)
The org-luhmann-export-region-as-links command allows you to export headings as org-mode links:
- Select a region containing headings, or position cursor on a heading
- Use
C-c l eorM-x org-luhmann-export-region-as-links - Choose a target file (existing files will be appended to, new files will be created)
- The command automatically creates unique IDs for each heading and generates org-mode links
This is useful for creating:
- Table of contents for specific sections
- Reference lists for topics
- Link collections for projects
;; Customize separator between number and title
(setq org-luhmann-title-separator " ")
;; Optional: Use numbers instead of stars for display
(setq org-luhmann-display-style 'number)
(org-luhmann-display-mode 1)The package provides two display styles for headlines:
star: Traditional org-mode stars (default)number: Replace stars with Luhmann numbers
You can toggle the display enhancement with M-x org-luhmann-display-mode.
Move Workbench to a separate package
The workbench feature has been moved to a separate package: org-workbench. Please refer to its README.md for details.
Features
- Digital Workbench Integration: Full card management system with persistent state across sessions, including:
C-c l w(add subtree),C-c l h(add heading),C-c l W(select workbench) commands- Card organization via move up/down functionality and jump-to-original-location links
- Use org-mode as a digital workbench, with all the features of org-mode, including folding/navigation, auto-save, etc.
Multi-Workbench Support: Manage multiple card collections with:
- Workbench selection interface (create/manage options)
- Rename/delete/create workbenches
- Persistent storage across sessions
- Clear header display for current workbench context
Smart Subtree Movement: Complete implementation of:
- Automatic renumbering during moves
- Conflict resolution with letter suffixes (e.g., "3.1" → "3.1a")
- Maintains number gaps to reflect Luhmann's practice
- Added smart navigation for unnumbered headings
- New export functionality for creating org-mode link collections
- Integrated savehist-mode for persistent export history
- Streamlined keyboard shortcuts and removed redundant features
- Improved file selection interface with better user experience
This project is licensed under the MIT License.
Yibie ([email protected])