From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33359 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: EBkysko Newsgroups: gmane.text.pandoc Subject: Re: Moving footnotes to just after paragraph with the citation Date: Tue, 21 Nov 2023 17:11:24 -0800 (PST) Message-ID: References: <868187f2-1fd4-4009-b48e-2a948749b518n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_11276_797122932.1700615484073" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22987"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDW4B3GJ2UFBBPNK6WVAMGQEVZESBVY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 22 02:11:31 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f183.google.com ([209.85.210.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r5bm6-0005rE-Vq for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Nov 2023 02:11:31 +0100 Original-Received: by mail-pf1-f183.google.com with SMTP id d2e1a72fcca58-6c337ce11cesf8878037b3a.1 for ; Tue, 21 Nov 2023 17:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1700615489; x=1701220289; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=aIHRdOB48XSY4TDYO1+nEfl7fB/5/p86Ev+t+l4vVTo=; b=elRclUWOBf7tfjgkmZw/wOWww39A8guGX93xi+j36EoukVU8smXWLwyN8RJ+AYx/e+ t/sTZUH4NQLabk2EuK7BY6dx6P1it3RPqX6WinsyWIuHv4Q2o/VHz+lZlnLljov7JfZh 7Cu8/Q2SYRhodys77qyRLlBDghdwvj/pQ2G+0kzlwpJOIgeXO4mHVRi77aWAxa7hlAJF 0eC/KRd4fG6AoRCQaEPC5NUe4EkfOkeMZycHwecp4p8zPQFRb0uW5YV5A3g0h47Dm/Kw CWn58kSyxS5/gxWCqUvpViKtdicWDvypndZUcl+hg1Ec4uIMPWQwns1H2mp86VynzTQU 2EbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700615489; x=1701220289; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=aIHRdOB48XSY4TDYO1+nEfl7fB/5/p86Ev+t+l4vVTo=; b=eOfTDNCh8kB/Ws73ff618lK5q6PqXbVl1cGbiBdgFxU0gHmMuL9rubf8tcxua1wcsT /j375dBwqdJgebt9PKgqOb8/XvdGSyWLdXmAUpGmsbbSmc/zIUTwne4wqGMKK7pGCfe7 URcTovM1Gfpj8Yyg6qGtWWxuBhd9l4E5xN0q7+5XUGTgDJD9URJ3ZnKVF50KHLyEMaKz T3Axa02lv8WItaGF2FSL2hQY1BxkURUOXvIUaUWgPsrPUu7PixZWt8x02hnK2QxSZUZf n+fmuR51x9FtEOz9IBaktsXTjnPzg2UdFU2q34hHvavL0T0BEBTacnDqPPaKwf7ayu+0 HmiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700615489; x=1701220289; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=aIHRdOB48XSY4TDYO1+nEfl7fB/5/p86Ev+t+l4vVTo=; b=rIeaOO1aHtD72xBxlWOByyumQvan84CD+L4I4nUz+HYHewPrSOGbcdV80XFzNorikX s8Rvj7W/DIYjnOuwF2WtUebROC1HRXFA5hZxAaHANKogFqu/LFu2lj/+NunDUiI5NLW9 l2BBapJ0M24vlL069JvSzNKt9Z/BxsXzdEPknJc0G4abA7hCkY7aE76y4QdP0U//9q7e AMGiDJh0NgjU3xsiGlHJonLaOm4Vzt07bmh9fQuZX4fURXL/bhRFSmYploS9CvRbuhda 9vCd6AKEnaUoWVlRfZKHadquZTJjOz1I0i7draqDQMLzXA7UD6 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YwJRdoXmrd462oLCd7kwjWK4k40yHCnnUQN2wNM7AzhQD9IN48e W2v5eQyhOQ4x2TNftaRPnrI= X-Google-Smtp-Source: AGHT+IH5X4xydUP66272uGrNMl5CpRiCYYCuWPThg8DPRXan6/TGS1OMuJ8YYN7UDdxbw7XfT6NJYQ== X-Received: by 2002:a05:6a00:39a1:b0:6cb:4bd5:a4c5 with SMTP id fi33-20020a056a0039a100b006cb4bd5a4c5mr1119899pfb.9.1700615489553; Tue, 21 Nov 2023 17:11:29 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a62:79d2:0:b0:6cb:42ac:d295 with SMTP id u201-20020a6279d2000000b006cb42acd295ls2949836pfc.0.-pod-prod-07-us; Tue, 21 Nov 2023 17:11:25 -0800 (PST) X-Received: by 2002:a05:6a02:685:b0:5c2:1ffc:ffb9 with SMTP id ca5-20020a056a02068500b005c21ffcffb9mr178819pgb.5.1700615485003; Tue, 21 Nov 2023 17:11:25 -0800 (PST) In-Reply-To: X-Original-Sender: ebkysko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:33359 Archived-At: ------=_Part_11276_797122932.1700615484073 Content-Type: multipart/alternative; boundary="----=_Part_11277_1573617847.1700615484073" ------=_Part_11277_1573617847.1700615484073 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable try (with markdown output=20 ) ``` --reference-location=3Dblock ```=20 On Tuesday, November 21, 2023 at 4:23:57=E2=80=AFPM UTC-5 Gwern Branwen wro= te: > This seems possibly tricky? I don't know what the Lua filters can or=20 > cannot do, but I'm not sure how one could solve this using just the Haske= ll=20 > API... Pandoc was not designed as a source-2-source processor so it doesn= 't=20 > make much effort to support Markdown-to-Markdown passes - like the obviou= s=20 > roundtrip will potentially change your Markdown formatting to a=20 > semantically-equivalent but entirely different-looking Markdown doc.=20 > (Macfarlane has said repeatedly that this will not be changed.) > > In your case, footnotes throw away the positioning information. > Consider the 3 possibilities: > > Foo[^foo]. > > Foo bar^[Bar.] > > Foo baz[^baz] > > [^baz]: Baz. > =20 > [^foo]: foo. > > This parses into: > > [ Para > [ Str "Foo" , Note [ Para [ Str "foo." ] ] , Str "." ] > , Para > [ Str "Foo" > , Space > , Str "bar" > , Note [ Para [ Str "Bar." ] ] > ] > , Para > [ Str "Foo" > , Space > , Str "baz" > , Note [ Para [ Str "Baz." ] ] > ] > ] > > So you can't know 'where' a footnote body was put, whether at the end of= =20 > the doc or elsewhere. > > Further, Pandoc will write out the Markdown according to its own=20 > conventions, which go opposite of what you want, by putting *all* footnot= e=20 > bodies at the end, regardless of where they were or whether they could be= =20 > inline footnotes, and the Markdown writer probably takes no options which= =20 > would change that: > > Foo[^1]. > > Foo bar[^2] > > Foo baz[^3] > > [^1]: foo. > > [^2]: Bar. > > [^3]: Baz. > > --=20 > gwern > https://gwern.net > --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/aa407627-870e-474e-856e-49559c74d46cn%40googlegroups.com. ------=_Part_11277_1573617847.1700615484073 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
try (with markdown output)

```=
--reference-location=3Dblock
```
On Tuesday, November 21, 2023 at 4:23:57=E2=80=AFPM UTC-5 Gwern Branwen = wrote:
This seems possibly tricky? I don't know what the Lua f= ilters can or cannot do, but I'm not sure how one could solve this usin= g just the Haskell API... Pandoc was not designed as a source-2-source proc= essor so it doesn't make much effort to support Markdown-to-Markdown pa= sses - like the obvious roundtrip will potentially change your Markdown for= matting to a semantically-equivalent but entirely different-looking Markdow= n doc. (Macfarlane has said repeatedly that this will not be changed.)
<= /div>

In your case, footnotes throw away the positioning= information.
Consider the 3 possibilities:

<= div>=C2=A0=C2=A0=C2=A0 Foo[^foo].

=C2=A0=C2=A0=C2=A0 Foo bar^[Bar.]<= br>
=C2=A0=C2=A0=C2=A0 Foo baz[^baz]

=C2=A0=C2=A0=C2=A0 [^baz]: B= az.
=C2=A0
=C2=A0=C2=A0=C2=A0 [^foo]: foo.

T= his parses into:

[ Para
=C2=A0 =C2=A0 [ Str &qu= ot;Foo" , Note [ Para [ Str "foo." ] ] , Str "." ]=
, Para
=C2=A0 =C2=A0 [ Str "Foo"
=C2=A0 =C2=A0 , Space<= br>=C2=A0 =C2=A0 , Str "bar"
=C2=A0 =C2=A0 , Note [ Para [ Str= "Bar." ] ]
=C2=A0 =C2=A0 ]
, Para
=C2=A0 =C2=A0 [ Str &= quot;Foo"
=C2=A0 =C2=A0 , Space
=C2=A0 =C2=A0 , Str "baz&qu= ot;
=C2=A0 =C2=A0 , Note [ Para [ Str "Baz." ] ]
=C2=A0 =C2= =A0 ]
]

So you can't know 'where= 9; a footnote body was put, whether at the end of the doc or elsewhere.

Further, Pandoc will write out the Markdown according= to its own conventions, which go opposite of what you want, by putting *al= l* footnote bodies at the end, regardless of where they were or whether the= y could be inline footnotes, and the Markdown writer probably takes no opti= ons which would change that:

Foo[^1].

F= oo bar[^2]

Foo baz[^3]

[^1]: foo.

[^2]: Bar.

[^= 3]: Baz.

-- =

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/aa407627-870e-474e-856e-49559c74d46cn%40googlegroups.= com.
------=_Part_11277_1573617847.1700615484073-- ------=_Part_11276_797122932.1700615484073--