From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Re: Numbering only second-level headlines in export Date: Thu, 01 Mar 2018 09:37:23 +0200 Message-ID: <87muzs6ybw.fsf@iki.fi> References: <87inahdrt1.fsf@iki.fi> <87efl47u6h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erImV-0001iV-FP for emacs-orgmode@gnu.org; Thu, 01 Mar 2018 02:37:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erImS-0000Jh-Co for emacs-orgmode@gnu.org; Thu, 01 Mar 2018 02:37:35 -0500 Received: from [195.159.176.226] (port=40286 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erImS-0000JN-5F for emacs-orgmode@gnu.org; Thu, 01 Mar 2018 02:37:32 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1erIkN-0006P2-4a for emacs-orgmode@gnu.org; Thu, 01 Mar 2018 08:35:23 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org >> 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