Dear All, On Fri, 23 Apr 2021 at 13:49, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> I went ahead and implemented `org-cite-wrap-citation' function in > "oc.el" (from wip-cite-new branch). Here's a quick demo. > --8<---------------cut here---------------start------------->8--- > (defun ngz-cite-demo-export-citation (citation &rest _) > (unless (org-cite-inside-footnote-p citation) > (org-cite-wrap-citation citation)) > "(Doe, 1999)") > > (org-cite-register-processor 'demo > :export-citation #'ngz-cite-demo-export-citation) > --8<---------------cut here---------------end--------------->8--- > > When I export the following document to ASCII > > --8<---------------cut here---------------start------------->8--- > #+cite_export: demo > > Regular footnote[fn:1]. > > Reference outside footnote: [cite:@key] > > Footnote with a reference[fn:2]. > > [fn:1] Definition 1 > > [fn:2] Reference [cite:@key]. > --8<---------------cut here---------------end--------------->8--- > > I get > > --8<---------------cut here---------------start------------->8--- > Regular footnote[1]. > > Reference outside footnote: [2] > > Footnote with a reference[3]. > Footnotes > ───────── > > [1] Definition 1 > > [2] (Doe, 1999) > > [3] Reference (Doe, 1999). > --8<---------------cut here---------------end--------------->8--- Thank you, this is very promising! I've checked the behaviour of citeproc-org with and without a note style now and there is only one additional minor difference which I forgot to mention, I don't know how difficult would it be to implement it: When a citation is wrapped into an anonymous footnote because a note style is used then the space between the citation and the previous token (if there was one) is removed. So for the fragment (using cite links for now) --8<---------------cut here---------------start------------->8--- text1 cite:Smullyan-1995-Logic text2[fn::text3 cite:Sierpinski-1965-Card text4] --8<---------------cut here---------------end--------------->8--- exporting to text with he Chicago author-date CSL style produces the output --8<---------------cut here---------------start------------->8--- text1 (Smullyan, 1995) text2[1] Footnotes ───────── [1] text3 (Sierpiński, 1965) text4 --8<---------------cut here---------------end--------------->8--- while with the Chicago fullnote style --8<---------------cut here---------------start------------->8--- text1[1] text2[2] Footnotes ───────── [1] Raymond M. Smullyan, /First-Order Logic/, 2nd, corrected ed. (Dover, 1995). [2] text3 Wacław Sierpiński, /Cardinal and Ordinal Numbers/, 2nd, revised ed. (PWN–Polish Scientific Publishers, 1965). text4 --8<---------------cut here---------------end--------------->8--- I think this is important for making it possible to switch between note and non-note export styles without changing the Org document, and would be very interested to hear your and other list members' views on this. thanks & best regards, András