unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Giovanni Bono <giovanni.bono@unimi.it>
To: "Gijs Hillenius" <gijs@hillenius.net>
Cc: help-gnu-emacs@gnu.org, Sharon Kimble <boudiccas@skimble.plus.com>
Subject: Re: how to renumber footnotes?
Date: Fri, 17 Apr 2020 14:45:00 +0200	[thread overview]
Message-ID: <87ftd2s2lv.fsf@cb001.local.net> (raw)
In-Reply-To: <87y2qu8g92.fsf@hillenius.net>

Gijs Hillenius <gijs@hillenius.net> writes:

> [...]
>
>> org-footnote can't tell that footnote 1 ([fn:1]) at the beginning is in
>> the right place when confronted with footnote 1 ([fn:1]) half-way
>> through! Which is why I'm looking for some other solution, and I believe
>> that it might be able to be achieved programmatically. Unfortunately my
>> lisp skills are almost nil, hence my request for someone to help.
>
> Ah!
>
> Suppose file A has 372 footnotes, and B has another x. I would create a
> macro that I start just ahead of the second [fn:1], and that adds 372 to
> [fn:1] so it becomes [fn:373] and repeat that to x.
>
> It might take you a few tries, but something like put point at the
> second [fn:1] c-X ( to start recording the macro, search for [fn: copy
> the 1 (+ "yank" 273) paste (<-- I'm missing a step here, I bet), and
> then end the macro-recording with C-x ).

An even simpler manual solution could be adding a sentence with 372
footnotes at the beginning of file-b and merging the relevant part of
file-b with file-a.  Maybe with something like:

(let ((org-footnote-define-inline t)
      (org-footnote-auto-adjust t))
  (dotimes (x 371)
    (insert (concat "a [fn:" (number-to-string (1+ x)) ":a] "))))

Regards,

  Giovanni



  reply	other threads:[~2020-04-17 12:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17  3:58 how to renumber footnotes? Sharon Kimble
2020-04-17  4:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
     [not found]   ` <mailman.453.1587096748.3066.help-gnu-emacs@gnu.org>
2020-04-17  6:26     ` Gijs Hillenius
2020-04-17 10:05       ` Sharon Kimble
2020-04-17 12:10         ` Gijs Hillenius
2020-04-17 12:45           ` Giovanni Bono [this message]
2020-04-17 13:53             ` Giovanni Bono
2020-04-17 12:45           ` Stephen Berman
2020-04-17 10:16   ` Sharon Kimble
2020-04-18  1:37     ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-04-17 16:10 ` Andreas Röhler
2020-04-17 17:03   ` Sharon Kimble
2020-04-17 19:16     ` Andreas Röhler
2020-04-18  6:06     ` Andreas Röhler
2020-04-18  9:00     ` Andreas Röhler
2020-04-19 15:00 ` Andreas Röhler

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87ftd2s2lv.fsf@cb001.local.net \
    --to=giovanni.bono@unimi.it \
    --cc=boudiccas@skimble.plus.com \
    --cc=gijs@hillenius.net \
    --cc=help-gnu-emacs@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.
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).