From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33358 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gwern Branwen Newsgroups: gmane.text.pandoc Subject: Re: Moving footnotes to just after paragraph with the citation Date: Tue, 21 Nov 2023 16:23:15 -0500 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/alternative; boundary="000000000000159ce4060ab0385d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1401"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDFJXQMSYMIRB2V76SVAMGQEZHCUV6Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 21 22:23:59 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f192.google.com ([209.85.210.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r5YDu-00007X-Ob for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 21 Nov 2023 22:23:58 +0100 Original-Received: by mail-pf1-f192.google.com with SMTP id d2e1a72fcca58-6cb73c73936sf5859298b3a.2 for ; Tue, 21 Nov 2023 13:23:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700601837; cv=pass; d=google.com; s=arc-20160816; b=Um0mGtk0rkqiVP8hrAFdEAWWAEgRdfPqyXbTR9nb0IT7j1mAWs7OqxwtAL7kat3EIB I/gLXruWti+noBN7DpyWvuJadSjdkymy5PpHJJGIAuG63ufbEWHnI3DEGD8e481RKIV4 d2bprrZsAsP2VKjqcXLS/32mdEhnMDCYIl9VJUci1Ov0P/Pkgpz4+MUGEHi5kk5YREeo VvhHfJ67LyCUvuem34VaxnBfmCqDyUiMj/++ucAjSI80AUrUYPiIOkE6ler0OmdynYod 6eWNWsWxUhWU4TuTD3ma6tGCMuuJClt4S7r9ZunuodItafdpxpra3+5RyerjlXl7YeCR NbDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature; bh=ZqF7/sNXSrsZaQFHmAF4H4XAMtSGS1U+r/IhxR1vHW8=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=vLBKO/IQzZGA8tUg4qYTsODecbXhFlAQajPyKzqZ+M9QPM2Lcnq9TUnrpteEg/i/qF /yyb41J/LjGuPBtxIPbQrULTKRdVVh3Yd06GCebKfJn4yb67eaNgMPd7djwT6dmNhw8m 1/R1VzQb1k1iJZhUsOLb5Vt24Gej9qOJymXXDnmbI6pvJHpBuSnjRyLLimM1K9jstHjq sfMWOgVXowMWsOvU7g3WOWlEA5oJjNLGH0KryUwNlC5HiiRE2ajH8xBiJOiKHfhF8MFc osrZfKmyd2U6unewT8ak4Mr0tgzTgDUj9NdrzO4I20kCYvnScoo61IWRe/XSX9+TcjTk ML/g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.217.42 as permitted sender) smtp.mailfrom=gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1700601837; x=1701206637; 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-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=ZqF7/sNXSrsZaQFHmAF4H4XAMtSGS1U+r/IhxR1vHW8=; b=pSRPk5sBrCB4HQq4RsX1aGsWlS0Xik+SYQHA82cxP0VwSrmfnqjW5vr5J92bxsYhJE HSU8FJ+3S3W71QFGN5lUy63AYLfzLyzp21SrFLq+4XwQ1vuxfO29h5wqijFq66PQvVUq RwnwzqDt6aNHpp2rKpBi4f9pwP4/40xMGE0oiXQCSyyx9FLT6EXVLI5OYpO2PEkrjux1 c9m6dBJUSPMZUP4DUpOeDLv3LeYnEgg7qIgmVtD47X/PvDlzaomMAArlEp52MCz9Tzvz mE6xZ7nayXC+SVnC0o/llFVAo6NadLocpVFS4U32M1aZZFpGMZQd X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700601837; x=1701206637; 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-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=ZqF7/sNXSrsZaQFHmAF4H4XAMtSGS1U+r/IhxR1vHW8=; b=QcdzZe+VUAiCTM1kRPLkHYUg0KqjUWlrTtN+sVQylHkogTrcqFRQJUB3PH/efmnw3t 1euLtc74/BdMIPmH8kTujenB1zR6Xzw7vKIHT0YPmZrQuFsktD30cj9RUV+Mv+kEXHM0 qp7LGQE1JLbrJNkLJGpGm1Vzhyfbeb0V1QagQ84WtYMzvRMwl9ItgToEzaab/gvsfQ/U O/qbuPQ0alKEVlxY4hrlSP1LqPAOc3VlGoIw3Z/avqpzuESCyibmQWIyaUcovhsEJh3t F3sVsi Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YxQVLvNwRwZm/AWlInYdg+gcg+alxJPGDdQPEqBJduPoOb8cssN 9UUnvOmF8VKHje/h2DEk2eU= X-Google-Smtp-Source: AGHT+IG86qYhyMwLIk+QREo6lAxkNxWJ9uH7MfuMShaeFPZd4dE/U9HxAFNxx8Ymdv9OvNlhnANdpw== X-Received: by 2002:a05:6a00:3922:b0:6cb:4c84:43ce with SMTP id fh34-20020a056a00392200b006cb4c8443cemr420040pfb.34.1700601837427; Tue, 21 Nov 2023 13:23:57 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:6c87:b0:6c4:f04a:2082 with SMTP id jc7-20020a056a006c8700b006c4f04a2082ls6466196pfb.1.-pod-prod-03-us; Tue, 21 Nov 2023 13:23:53 -0800 (PST) X-Received: by 2002:a05:6a21:148f:b0:189:3e6f:ed2c with SMTP id od15-20020a056a21148f00b001893e6fed2cmr239933pzb.23.1700601832962; Tue, 21 Nov 2023 13:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700601832; cv=none; d=google.com; s=arc-20160816; b=ZQQm4mn0x7E4slfpse4PdEQasWuu5CSnZjiy63NmNkPtUZiveclZ4Cq3o6sJykfbH9 pB0cakwDzXO53aA7h14161Bxni9G1s21qJjW46yKhx7esNxPIkPs7wXlYQYt/ElNUGpZ 1V1I4E/ADUD9QlX5pGZSXIz9DkHuONppjk/NCCEQYBNN7wn7rg/n6M6TWZtS2RUpKk0N 9dV8zJZ29I05WLO5el6oa5QKEQKC9QsOb3+qXh6aweCQ2mS4gyS7A2bR94NoRnltvAro 17QasYUc3iL9FsB/FdSEofaaG0iKADd8rx1tY2YKyBIBhgD40WYrk89OgKiTZ4DvJQQo U+eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version; bh=Helj6M4lMIVWEt06bxh8EFZXbqXksY8+XSGXZ/Oc9Tg=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=S/GGN43FhqbHv2Cp5j8SUosTZYoPgat7jO5r1VpMIKfxXmfyT0EWtIG/KW8VGINVHz 4wcOyY413j2Uk8wP72xL7cQuLvePwXrKTmRhkcGhQHc3oVVXD+6SI5zBDs0+djZCVVmL fPCQgDCSZNo/TzxFACSk0q+Snp+hAdLqAxjSG/FoTAZooKMfmYlvJuEzCiclupTpTWLp engNth3RbBJMTJnEb89+S1jjauZbqVudsp+CsN6daHBj7Pz76mTfc6TBPxIdqjEYUjXS zz2PM5D1QShr+wRc1LDReqXME/KLf9qgIZKwRn2qzgaKiik84OgdIrMQihNsX+5GYj4g WGNg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.217.42 as permitted sender) smtp.mailfrom=gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com. [209.85.217.42]) by gmr-mx.google.com with ESMTPS id s13-20020a056a0008cd00b006cb501d5d64si473419pfu.3.2023.11.21.13.23.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Nov 2023 13:23:52 -0800 (PST) Received-SPF: pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.217.42 as permitted sender) client-ip=209.85.217.42; Original-Received: by mail-vs1-f42.google.com with SMTP id ada2fe7eead31-462a978c470so679048137.2 for ; Tue, 21 Nov 2023 13:23:52 -0800 (PST) X-Received: by 2002:a67:e684:0:b0:45d:9f5b:4264 with SMTP id hv4-20020a67e684000000b0045d9f5b4264mr820914vsb.4.1700601831724; Tue, 21 Nov 2023 13:23:51 -0800 (PST) In-Reply-To: <868187f2-1fd4-4009-b48e-2a948749b518n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.217.42 as permitted sender) smtp.mailfrom=gwern0-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:33358 Archived-At: --000000000000159ce4060ab0385d Content-Type: text/plain; charset="UTF-8" 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. (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. [^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 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 *all* footnote 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. -- gwern https://gwern.net -- 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 email 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/CAMwO0gw1W6_CHiCr8RGfDkLjt-dTg4y9dPkbU2UouZt%3D1Lj3Cg%40mail.gmail.com. --000000000000159ce4060ab0385d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 thi= s using just the Haskell API... Pandoc was not designed as a source-2-sourc= e processor so it doesn't make much effort to support Markdown-to-Markd= own passes - like the obvious roundtrip will potentially change your Markdo= wn formatting to a semantically-equivalent but entirely different-looking M= arkdown doc. (Macfarlane has said repeatedly that this will not be changed.= )

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

<= /div>
=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 [^b= az]: Baz.
=C2=A0
=C2=A0=C2=A0=C2=A0 [^foo]: foo.

=
This parses into:

[ Para
=C2=A0 =C2=A0 [ S= tr "Foo" , Note [ Para [ Str "foo." ] ] , Str ".&q= uot; ]
, 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"
=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 'w= here' a footnote body was put, whether at the end of the doc or elsewhe= re.

Further, Pandoc will write out the Markdown ac= cording to its own conventions, which go opposite of what you want, by putt= ing *all* footnote bodies at the end, regardless of where they were or whet= her 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://group= s.google.com/d/msgid/pandoc-discuss/CAMwO0gw1W6_CHiCr8RGfDkLjt-dTg4y9dPkbU2= UouZt%3D1Lj3Cg%40mail.gmail.com.
--000000000000159ce4060ab0385d--