I have an org-mode file with more than 12000 footnotes (maybe less), I was cleaning it and found that after the conversion some footnotes weren't converted to org-mode footnotes, so I had to manually make them footnotes.
The thing is, since that addition the reference number inside the square brackets must be re-done otherwise I will end with repeated numbers, like: [12] ... [12]
or [10678] ... [10678]
. Is there a way to build a regexp that look for all numbers inside square brackets and replace the text inside them with their respective coincidence number (?) for instance: [12]
is the coincidence number 10 and this other [12]
is coincidence number 11 so [12] ... [12]
becomes [10] ... [11]
?
especial petition: if you are going to post an elisp snippet that solves this problem, please, please, please, comment it on detail because I want to learn elisp too!
[12]
, two of them (reference + footnote) should be renamed[10]
and the other two should be renamed[11]
? That makes the question much more difficult than the way it is currently phrased![12-2]
) to avoid the numbering issue.[fn:name]
syntax rather than hand numbering is a better long term solution.[12-2]
looks after exporting the document ...