Skip to content

nma83/org-autonum

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

org-autonum

Automatic heading numbering in org-mode files.

org-autonum inserts section numbers of the form <<x.y.z>>at the beginning of each heading in the current org-file. By inserting in such format, the section numbers become [dedicated targets] (http://orgmode.org/manual/Internal-links.html). Hence they would be visible for reference in the buffer but not part of any exported output.

Installation

Install org-autonum.el in the load-path.

(require 'org-autonum)

Enable the feature in the file header.

# -*- org-autonum-enable: t; -*-

Add function to org-mode hook.

(add-hook 'org-insert-heading-hook 'nma/org-autonum)

org-insert-heading-hook is used only when M-Enter is used. org-autonum can be added to other hooks such as org-cycle-hook to refresh section numbers when viewing contents for example.

(add-hook 'org-cycle-hook
  (lambda (state) (if (eq state 'contents) (nma/org-autonum))))

About

Tiny function to autonumber org-mode outlines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published