emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Numbering only second-level headlines in export


From: Jarmo Hurri
Subject: Re: [O] Numbering only second-level headlines in export
Date: Thu, 01 Mar 2018 09:37:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

>> What - if any - would be the recommended way to implement numbering only
>> second-level headlines in an exported document with running numbering
>> (resets with first-level headline change)?
>
> You haven't said what export target you are using.  In any case, I would
> suggest you look at using a counter.  See section 12.5 of the org manual
> but specifically:
>
> ‘{{{n}}}’
> ‘{{{n(NAME)}}}’
> ‘{{{n(NAME,ACTION)}}}’
>      This macro implements custom counters by returning the number of
>      times the macro has been expanded so far while exporting the
>      buffer.  You can create more than one counter using different NAME
>      values.  If ACTION is ‘-’, previous value of the counter is held,
>      i.e.  the specified counter is not incremented.  If the value is a
>      number, the specified counter is set to that value.  If it is any
>      other non-empty string, the specified counter is reset to 1.  You
>      may leave NAME empty to reset the default counter.
>
> I would turn off numbering of headings (num:nil option) and then have
> the counter in each second level heading.

Brilliant, that worked like a charm on first trial. Thanks!

(BTW, my export target is html.)

Jarmo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]