emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "András Simonyi" <andras.simonyi@gmail.com>
To: Sharon Kimble <boudiccas@skimble09.plus.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: How to auto-renumber chapters
Date: Wed, 28 Aug 2024 18:20:41 +0200	[thread overview]
Message-ID: <CAOWRwxBGgjA4Y2yBw7SD7MZO4m_YYbzmK1Gpz=5KDZ=3MH5egg@mail.gmail.com> (raw)
In-Reply-To: <87mskxrqdx.fsf@skimble09.plus.com>

Dear All,

On Wed, 28 Aug 2024 at 10:41, Sharon Kimble
<boudiccas@skimble09.plus.com> wrote:

> I now have
> ** Chapter 2
> blah
> ** Chapter 2
> blah de blah
> How can I get these new chapters to autorenumber themselves please, so that they will show Chapter 2, Chapter 3

one way of doing the required renumbering would be performing a
regular expression-based replacement (using the replace-regexp or
query-replace-regexp commands) along the following lines:

regular expression: ^** Chapter \([0-9]+\)
replacement: ** Chapter \,(+ \# 1)

This assumes that the headings to be renumbered have the form "**
Chapter ##.." and the numbering should start with 1 so might need to
be adapted slightly to your use case.

best wishes,
András

> Thanks
>   Sharon.
> - --
> Debian 12.6, Fluxbox 1.3.7, emacs 31.0.50, org 9.7.10
> -----BEGIN PGP SIGNATURE-----
>
> iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmbO4qodHGJvdWRpY2Nh
> c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1seWhAAmzZfon0n2x4cJI0L
> jjT8fdzNLeDp5vEUA1u3EHEJdtMsufPNIJt3L8kLQaL0+7/WaEboy3N/u/3XyPQz
> IioaonnBqO6TAWXoyelpLDof48XI88jEaop/pM5CAaVe7NuPNOI7tkzVcHk53qwE
> Kpy1FTVPKx9CyHLC0vOCfwoVKOzUCNfYWIALvK7wWGs5z3BHAqrcYokOdzselPNm
> 7eoaJjmHvu+nOFQzUMSJdPgTLE4LfXqBY8Rc7QvodRia4KNe8oHwB1Vr/TqWHIio
> ZWfryOyutxAEkCUQD+yYAGD8Fg8h6Gd1GJF6TFea9iJ/cnfnmZjjjY9XwUqHHrOU
> jhW+oS8PmTqU1klKDt3PHf5odN0UuD1CEJQ5VvFjfYjmY6OCL36AILxz+WdPnUmg
> cT6leq/xZKFLLXVr93irUgFgohzLHBBK4pW6Wv9XsIKSA3n9V1Oyzr2t4DPJjJaL
> a5fgSKHGTDpip6mtTG7AS8tkSTamdhaPjDJ9anP1NYV2Lccgx2L4EFUkZcnnqeKq
> h+b5zdOqV75z6oHZvWfMyAOi5fd469/pQ7IqYW2u/Gm/uXQ096Pw2q999+9howeA
> 3U6PGUgzP1GcynzhMCFSLUsyokBwJeVSfPmQep1+UAWxPuy9YJjeZ9k9S3smTk6Y
> aSkmndz1ePMMdQYKS07BPJXhXu4=
> =Y4K2
> -----END PGP SIGNATURE-----
>


  reply	other threads:[~2024-08-28 16:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  8:41 How to auto-renumber chapters Sharon Kimble
2024-08-28 16:20 ` András Simonyi [this message]
2024-08-28 17:55 ` Gregor Zattler
2024-08-31 18:41 ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOWRwxBGgjA4Y2yBw7SD7MZO4m_YYbzmK1Gpz=5KDZ=3MH5egg@mail.gmail.com' \
    --to=andras.simonyi@gmail.com \
    --cc=boudiccas@skimble09.plus.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).