[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to auto-renumber chapters
From: |
András Simonyi |
Subject: |
Re: How to auto-renumber chapters |
Date: |
Wed, 28 Aug 2024 18:20:41 +0200 |
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-----
>