From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33360 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lyndon Drake Newsgroups: gmane.text.pandoc Subject: Re: Moving footnotes to just after paragraph with the citation Date: Tue, 21 Nov 2023 18:55:26 -0800 (PST) Message-ID: <3b95f72e-34ba-486b-9b5d-2b0d01a49088n@googlegroups.com> 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_11860_305634197.1700621726124" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40879"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCKOX6WY7EKBBIG36WVAMGQE66UTXPY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 22 03:55:33 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pg1-f189.google.com ([209.85.215.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r5dOm-000AQu-OB for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Nov 2023 03:55:32 +0100 Original-Received: by mail-pg1-f189.google.com with SMTP id 41be03b00d2f7-5c1af03481bsf6392408a12.1 for ; Tue, 21 Nov 2023 18:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1700621731; x=1701226531; 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=ORbcLtLJVHzbmjM1GdVGaLg25Yr3KAEG7sJyfK4Nf7M=; b=Ufplf0XPaFqXTKk+xdoBGT91zvv2k/2ylo6Bl4Y2rnQYsYocq1YMUxCaVBktHXz/gT NdiD5vsON0lH4b+U/Kpido7MWviaLSMWzrbTvZBFMy4Ie/X40snau8diW5nMK8xKxcfo gN78/Of4bdLT6GWVKhrSroYd953NpYfK+Nb3hGd8K0oiUOe4hhGuslPJHCmzWxXCexuZ 5YoIB5tRQ0qNLh9jO0p3p1AesaQoOZ7QCBTciQrvW3uQ+5tYM5Id3ioNhS0HYG7Hnfkz XQx+vI7WWxcuHU/rcbXizoPZspcuiVkVnmqIhrfsKTUQUA/adrh/9P+hhDBt2P637nbE 01mg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700621731; x=1701226531; 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=ORbcLtLJVHzbmjM1GdVGaLg25Yr3KAEG7sJyfK4Nf7M=; b=BkzrKU2ioTlIdc6ElXGScYkTPXWC+4gI0NlbO452Y5o+iOJS6Cb01ugsZ6o6bdO+xi 4JLvx5/guV47mQZBm2luvF/eGMCwvlJ+TbVU3ysASs9UqZxjvZNRKSZMDOGNZifL19t+ om1zHG7s9zKOHcQg7vRusrwlTfa2epBqV5epXBfr6DkZDjxCcaroAg68wccoEGTy/GUm BKUTmT3nq5BfuTBErusHkyMIpLFQHo4y8mIrHmjo1u+mSqo7sdGBLyw3r4T3c/f8uU+/ 7YPEHP0JovJjkySp9I2ycTT8rX+lHRNMDTsbrBCYtky4iogtFIFAR5i+rwqx8ky/nGRh cYHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700621731; x=1701226531; 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=ORbcLtLJVHzbmjM1GdVGaLg25Yr3KAEG7sJyfK4Nf7M=; b=kJdIsVY4noNuVn6vJXQpReba8C2zd/nvA3IK25x3W2a/IB33XTRn/iFAPI1oAzASlx FCF0AL3k3DyY3nBVriBPa2P4bGG8RUgziPMOhMEg8AshC5ol25N+heQ/bxGzc0COoVWq 3/WlWdAeDbQZuABCR/iKWKomPQf0g9NiIELu6Y+stTGK601IDWML/JJFoJCTqC8RLOy3 zh02JzrUxZg6d7YQlD908lMIAL19fVYgVvqgE/qCcfOeJ55LRtZqDNcjqkZ8bm8r9L9T MsvnkTqQbIJvImA1tIhHQyKeTvz/eK637H1r0TC77n3cXMrA74 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YxlpqzVLXleTbQR92G3k0JwZWejlQRpTF0zKgsoTVaO6OvW2DnQ Ar0qx9+SKSujj49OS+yh7JM= X-Google-Smtp-Source: AGHT+IHi067BmSxGWEEoci9GUihMAhHTg5cJttOi+mDMShPIMdTJaM7o2Av58qWS+dTVIlef00gm/Q== X-Received: by 2002:a05:6a21:2c95:b0:187:dadd:7e9d with SMTP id ua21-20020a056a212c9500b00187dadd7e9dmr769120pzb.10.1700621731366; Tue, 21 Nov 2023 18:55:31 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90b:2391:b0:271:95b4:8f2a with SMTP id mr17-20020a17090b239100b0027195b48f2als283080pjb.2.-pod-prod-00-us-canary; Tue, 21 Nov 2023 18:55:27 -0800 (PST) X-Received: by 2002:a17:903:32cf:b0:1cf:6390:d58e with SMTP id i15-20020a17090332cf00b001cf6390d58emr399112plr.0.1700621727067; Tue, 21 Nov 2023 18:55:27 -0800 (PST) In-Reply-To: X-Original-Sender: isenguard-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:33360 Archived-At: ------=_Part_11860_305634197.1700621726124 Content-Type: multipart/alternative; boundary="----=_Part_11861_1414927655.1700621726124" ------=_Part_11861_1414927655.1700621726124 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Brilliant @EBkysko =E2=80=94 that works exactly as I'd hoped. Thank you! On Tuesday, 21 November 2023 at 19:11:24 UTC-6 EBkysko wrote: > 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 w= rote: > >> 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 Hask= ell=20 >> API... Pandoc was not designed as a source-2-source processor so it does= n't=20 >> make much effort to support Markdown-to-Markdown passes - like the obvio= us=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* footno= te=20 >> bodies at the end, regardless of where they were or whether they could b= e=20 >> inline footnotes, and the Markdown writer probably takes no options whic= h=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/3b95f72e-34ba-486b-9b5d-2b0d01a49088n%40googlegroups.com. ------=_Part_11861_1414927655.1700621726124 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Brilliant @EBkysko =E2=80=94 that works exactly as I'd hoped. Thank you!
= On Tuesday, 21 November 2023 at 19:11:24 UTC-6 EBkysko wrote:
try (with markdown output)

```
--reference-location=3Dblock
```
On Tuesday, November 21, 2023 at 4:23:57=E2=80=AFPM UTC-5 Gwern Branwen wr= ote:
=
This seems possibly tricky? I don't know what the Lua filters can = or cannot do, but I'm not sure how one could solve this using just the = Haskell API... Pandoc was not designed as a source-2-source processor so it= doesn't make much effort to support Markdown-to-Markdown passes - like= the obvious roundtrip will potentially change your Markdown formatting to = a semantically-equivalent but entirely different-looking Markdown doc. (Mac= farlane has said repeatedly that this will not be changed.)
<= br>
In your case, footnotes throw away the positioning informatio= n.
Consider the 3 possibilities:

=C2=A0= =C2=A0=C2=A0 Foo[^foo].

=C2=A0=C2=A0=C2=A0 Foo bar^[Bar.]

=C2= =A0=C2=A0=C2=A0 Foo baz[^baz]

=C2=A0=C2=A0=C2=A0 [^baz]: Baz.
=C2= =A0
=C2=A0=C2=A0=C2=A0 [^foo]: foo.

This parses= into:

[ Para
=C2=A0 =C2=A0 [ Str "Foo&quo= t; , Note [ Para [ Str "foo." ] ] , Str "." ]
, Para=
=C2=A0 =C2=A0 [ Str "Foo"
=C2=A0 =C2=A0 , Space
=C2=A0 = =C2=A0 , Str "bar"
=C2=A0 =C2=A0 , Note [ Para [ Str "Bar= ." ] ]
=C2=A0 =C2=A0 ]
, Para
=C2=A0 =C2=A0 [ Str "Foo&q= uot;
=C2=A0 =C2=A0 , Space
=C2=A0 =C2=A0 , Str "baz"
=C2= =A0 =C2=A0 , Note [ Para [ Str "Baz." ] ]
=C2=A0 =C2=A0 ]
]=

So you can't know 'where' a footn= ote body was put, whether at the end of the doc or elsewhere.
Further, Pandoc will write out the Markdown according to its ow= n conventions, which go opposite of what you want, by putting *all* footnot= e bodies at the end, regardless of where they were or whether they could be= inline footnotes, and the Markdown writer probably takes no options which = would change that:

Foo[^1].

Foo 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/3b95f72e-34ba-486b-9b5d-2b0d01a49088n%40googlegroups.= com.
------=_Part_11861_1414927655.1700621726124-- ------=_Part_11860_305634197.1700621726124--