Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numbered Headings in Org-Mode, Emacs

Tags:

emacs

org-mode

I was wondering if you can get automatic numbering for headings in org-mode,something similar than the one used for simple lists. For example I can have this list:

  1. one
  2. two
  3. three

And I can reorder it to 1. two 2. three 3. one

The list items change but the list numbers stay the same. How can I do something similar with headings so that I can reorder the headings in a similar way.

  • 1 One
  • 2 Two
  • 3 Three

To

  • 1 Two
  • 2 three
  • 3 One
like image 446
Mirko Hernández Avatar asked May 12 '15 14:05

Mirko Hernández


2 Answers

If you are looking for a way to show this in Org itself, then I'm afraid this is not possible. However you can do this easily in the exported document. Look at the exporting chapter in the manual.

You can provide an option like this: #+options: num: 2. Then all headlines at the 2nd level or above will be exported with a number. You could then adjust the headlines as you wish in Org, without affecting the numbers in the exported document.

like image 172
suvayu Avatar answered Oct 27 '22 03:10

suvayu


Orgmode now has a built-in minor mode for this, contributed by Nicolas Goaziou.

Simply do M-x org-num-mode to activate the display of dynamic headline numbering.

like image 34
Charl Botha Avatar answered Oct 27 '22 03:10

Charl Botha