0

Suppose I have the following org file (example.org):

* Alpha
** Aleph
* Beta
* Gamma

When I export it to HTML I get:

1. Alpha
1.1. Aleph
2. Beta
3. Gamma

Which is quite useful in most cases. Now suppose I want to have the following HTML output:

2.3.1. Alpha
2.3.1.4. Aleph
4.2. Beta
5. Gamma

How should I amend example.org?

Note that the expected new numbering can't be predicted, it has hence to be specified manually.

4
  • This look pretty arbitrary to me: can you describe an algorithm that would produce this numbering from your input? The standard numbering is of course algorithmically definable (see the code). I'm not sure that yours is.
    – NickD
    Jul 16 at 16:44
  • 1
    I don't think there's a possible algorithm, I would like to specify the numbering manually. The use case is that I need to produce a document that is a selection of headlines (and their content) from another document. So the extract has to reproduce the numbering of the original.
    – crocefisso
    Jul 16 at 16:56
  • Thanks for the edit.
    – crocefisso
    Jul 16 at 16:57
  • 1
    You should add the use case to the question (i.e. not in a comment): it's an integral part of what you are trying to do.
    – NickD
    Jul 16 at 17:19

1 Answer 1

0

The solution is quite simple, example.org has to be written like this:

#+OPTIONS:    num:nil
* 2.3.1. Alpha
** 2.3.1.4. Aleph
* 4.2. Beta
* 5. Gamma
2
  • The trouble with this is that there is no way to generate it from the original file: you need to generate the exported file and then manually copy the section numbers into example.org. Not my idea of fun but, if it works for you, I will not complain (too much).
    – NickD
    Jul 18 at 2:03
  • 1
    Also you can bypass export using M-x org-num-mode from the source file and typing down the numbers instead of copy-pasting them.
    – crocefisso
    Jul 18 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.