public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Lyndon Drake <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Moving footnotes to just after paragraph with the citation
Date: Tue, 21 Nov 2023 18:55:26 -0800 (PST)	[thread overview]
Message-ID: <3b95f72e-34ba-486b-9b5d-2b0d01a49088n@googlegroups.com> (raw)
In-Reply-To: <aa407627-870e-474e-856e-49559c74d46cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2518 bytes --]

Brilliant @EBkysko — 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 
> <https://pandoc.org/MANUAL.html#options-affecting-specific-writers>)
>
> ```
> --reference-location=block
> ``` 
>
> On Tuesday, November 21, 2023 at 4:23:57 PM UTC-5 Gwern Branwen wrote:
>
>> 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 <https://www.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/3b95f72e-34ba-486b-9b5d-2b0d01a49088n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4122 bytes --]

  parent reply	other threads:[~2023-11-22  2:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 20:24 Lyndon Drake
     [not found] ` <868187f2-1fd4-4009-b48e-2a948749b518n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-21 21:23   ` Gwern Branwen
     [not found]     ` <CAMwO0gw1W6_CHiCr8RGfDkLjt-dTg4y9dPkbU2UouZt=1Lj3Cg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-22  1:11       ` EBkysko
     [not found]         ` <aa407627-870e-474e-856e-49559c74d46cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-22  2:55           ` Lyndon Drake [this message]
     [not found]             ` <3b95f72e-34ba-486b-9b5d-2b0d01a49088n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-22 12:23               ` EBkysko
     [not found]                 ` <ff6a6898-e1c0-413f-b6c2-d81ea2d949d4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-22 12:54                   ` 'William Lupton' via pandoc-discuss
     [not found]                     ` <CAEe_xxh74qC5fLmzhoMjS1gyWwyo=rSKVmbXTs--fH8me-EAeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-23 16:21                       ` Lyndon Drake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b95f72e-34ba-486b-9b5d-2b0d01a49088n@googlegroups.com \
    --to=isenguard-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).