Re: org-footnote renumbering

2020-04-08 Thread Kyle Meyer
Sharon Kimble  writes:

> I'm using 'C-u C-c C-x f r' and it isn't changing the footnote
> numbering! I am adding file-2 to file-1 and then using the key mantra,
> but the footnotes are not changing. In file-1 the last footnote is 756,
> and in file-2 the first footnote is 670 (I've no idea why it suddenly
> starts at 670, but it does.)

Hopefully someone will correct me if I'm mistaken, but I don't think
renumbering will help in the situation you describe.  If you're
concatenating two files with overlapping footnotes, I don't see how Org
would know which reference belongs to which definition.

My understanding is that renumbering is useful in cases where the
references are no longer an ordered, unbroken sequence.  Say you have
this file:

--8<---cut here---start->8---
Pellentesque dapibus.  Aliquam feugiat [fn:1] tellus.  Nulla
facilisis.  Phasellus in [fn:2].

* Footnotes

[fn:1] Vel tortor sodales tellus ultricies commodo.

[fn:2] Proin quam nisl, tincidunt.
--8<---cut here---end--->8---

With point after "Nulla", you insert a footnote ('C-c C-x f'):

--8<---cut here---start->8---
Pellentesque dapibus.  Aliquam feugiat [fn:1] tellus.  Nulla [fn:3]
facilisis.  Phasellus in [fn:2].

* Footnotes

[fn:3] Nullam libero mauris.

[fn:1] Vel tortor sodales tellus ultricies commodo.

[fn:2] Proin quam nisl, tincidunt.
--8<---cut here---end--->8---

By default, the numbering isn't auto-adjusted.  This is where
renumbering with 'C-u C-c C-x f r' comes in.  Calling that gives:

--8<---cut here---start->8---
Pellentesque dapibus.  Aliquam feugiat [fn:1] tellus.  Nulla [fn:2]
facilisis.  Phasellus in [fn:3].

* Footnotes

[fn:2] Nullam libero mauris.

[fn:1] Vel tortor sodales tellus ultricies commodo.

[fn:3] Proin quam nisl, tincidunt.
--8<---cut here---end--->8---


Back to your problem of combining files.  My approach would be

  * Do a regexp search in file A and replace all "[fn:N]" with
"[fn:aN]", making them named references.

Repeat with file B, creating "[fn:bN]" references.

  * Combine file A and file B.  Then convert the references into numbers
by normalizing with 'C-c C-x f n'.

But perhaps others can suggest a better solution.



Re: org-footnote renumbering

2020-04-08 Thread Sharon Kimble
Kyle Meyer  writes:

> Sharon Kimble  writes:
>
>> In the org manual v9.3 on page 139 it explains how to renumber the
>> footnotes. I am presuming from reading it that it requires me to C-c
>> C-x r.
>
> I don't spot any mention of 'C-c C-x r'.  The table in the footnote
> section that lists keys is describing the menu that org-footnote-action
> (bound to 'C-c C-x f' by default) shows when it's called with a prefix
> argument.  So, the full sequence to get to 'r' listed in that table
> would be 'C-u C-c C-x f r`.

Thanks for replying Kyle.

I'm using 'C-u C-c C-x f r' and it isn't changing the footnote
numbering! I am adding file-2 to file-1 and then using the key mantra,
but the footnotes are not changing. In file-1 the last footnote is 756,
and in file-2 the first footnote is 670 (I've no idea why it suddenly
starts at 670, but it does.)

So where should the cursor be when using the key mantra please? On the
new chapter heading? On the first [fn:670]? Or where please?

Thanks
  Sharon.  
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 10.2, fluxbox 1.3.7, emacs 27.0.90, org 9.3.6



Re: org-footnote renumbering

2020-04-07 Thread Kyle Meyer
Sharon Kimble  writes:

> In the org manual v9.3 on page 139 it explains how to renumber the
> footnotes. I am presuming from reading it that it requires me to C-c
> C-x r.

I don't spot any mention of 'C-c C-x r'.  The table in the footnote
section that lists keys is describing the menu that org-footnote-action
(bound to 'C-c C-x f' by default) shows when it's called with a prefix
argument.  So, the full sequence to get to 'r' listed in that table
would be 'C-u C-c C-x f r`.