From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Numbering only second-level headlines in export Date: Wed, 28 Feb 2018 20:09:26 +0000 Message-ID: <87efl47u6h.fsf@gmail.com> References: <87inahdrt1.fsf@iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er82f-0006VS-Jn for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 15:09:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er82b-0004uc-Iy for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 15:09:33 -0500 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:34712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1er82b-0004th-B6 for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 15:09:29 -0500 Received: by mail-wr0-x22c.google.com with SMTP id m5so3757457wrg.1 for ; Wed, 28 Feb 2018 12:09:29 -0800 (PST) In-Reply-To: <87inahdrt1.fsf@iki.fi> (Jarmo Hurri's message of "Wed, 28 Feb 2018 18:04:10 +0200") 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: Jarmo Hurri Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wednesday, 28 Feb 2018 at 18:04, Jarmo Hurri wrote: > Greetings. > > 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: =E2=80=98{{{n}}}=E2=80=99 =E2=80=98{{{n(NAME)}}}=E2=80=99 =E2=80=98{{{n(NAME,ACTION)}}}=E2=80=99 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 =E2=80=98-=E2=80=99, previous value of the count= er 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. =2D-=20 Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSPXCedOQfhSlwpVw3IkZPY//z2fQUCWpcMdgAKCRDIkZPY//z2 fSwuAKCXthTwmWY+Y12/Ust+TdFvP9Md5gCcDwi8zvtg/1a2mZ4q4xlQZy7N2e0= =TKKA -----END PGP SIGNATURE----- --=-=-=--