From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerald Wildgruber Subject: Re: how to convert/normalize plain footnotes into [fn:] ones Date: Wed, 21 Dec 2016 17:48:00 +0100 Message-ID: References: <878tr9xp16.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJk3o-0007Eu-Jh for emacs-orgmode@gnu.org; Wed, 21 Dec 2016 11:48:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJk3l-0000rx-Gu for emacs-orgmode@gnu.org; Wed, 21 Dec 2016 11:48:12 -0500 Received: from mx1-priv.urz.unibas.ch ([131.152.226.164]:33196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJk3l-0000rL-9q for emacs-orgmode@gnu.org; Wed, 21 Dec 2016 11:48:09 -0500 In-reply-to: <878tr9xp16.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: org mode mailing list Hi Nicolas, thanks: I had actually tried that already and came up with the following regex: \([^ ]\)\(\[\)\([0-9]\) --> \1\2fn:\3 i.e. three groupings: 1) no whitespace, 2) "[" and 3) a number, and then introducing "fn:" between "[" and the number: but it is not perfect, as it still gives false positives; do you have something better? The problem unfortunately arises also by pandoc still using the now obsolete syntax of plain footnotes when converting (e.g. latex) to org mode! Gerald. On Mi, Dez 21 2016, Nicolas Goaziou wrote: > Hello, > > Gerald Wildgruber writes: > >> I'm trying to convert older orgmode documents which have plain, >> "[1]"-like footnotes into the newer "[fn:]" format. >> >> Can this be done automatically? > > You could use `query-replace-regexp' a.k.a. C-M-%. > >> Nicolas mentions "org-footnote-normalize" which would turn old footnot= es >> in new ones, but it does nothing in my case except adding a "* >> Footnotes" entry. > > You misunderstood. `org-footnote-normalize' used to turn every footnote > into [1], [2], ... whereas it now turns them into [fn:1], [fn:2],... IO= W > it cannot be used to convert from old syntax to new one. > > Regards, -- Dr.Gerald Wildgruber eikones NFS Bildkritik NCCR Iconic Criticism Universit=C3=A4t Basel Rheinsprung 11 CH-4051 Basel www.eikones.ch T. +41 (0)61 267 18 02 F. +41 (0)61 267 18 11 --------------------- Sent with mu4e