From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31798 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=27H=C3=A5kon_Wium_Lie=27_via_pandoc=2Ddiscuss?= Newsgroups: gmane.text.pandoc Subject: Re: converting links to footnotes... including page number in footnote?? Date: Sat, 26 Nov 2022 14:52:43 +0100 Message-ID: <25474.6699.105043.345344@gargle.gargle.HOWL> References: <2aec84ad-a750-48f2-a0c2-ad7572dcca11n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24591"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCB6LIOB5YCBBMVURCOAMGQEYBLYKJQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Nov 26 14:52:54 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-io1-f59.google.com ([209.85.166.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oyvbx-00066v-DV for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 26 Nov 2022 14:52:53 +0100 Original-Received: by mail-io1-f59.google.com with SMTP id be26-20020a056602379a00b006dd80a0ba1csf2994405iob.11 for ; Sat, 26 Nov 2022 05:52:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669470772; cv=pass; d=google.com; s=arc-20160816; b=FU7XuvqtCVj+IAT7rqaYgNXVVLyXeeB1XVx+zis6KIGnbSvGI+wEUx0n0aCHbYwsua x2YKFHiOgyuWo5EEF7t4+JIsFPBSPPknzTJZ7GnacWnWyxVMFi6E81B06RmJrsWbfs2U VIS+539dwj5irXCrf7RrJ/TYJII7QVZkXiKnLgCfh3rhRi40emKHsjRzlKP054OJo7H7 1fviNPe6c+qt5nibNb4kM4NnZs6LzAqOn1J3ZCDhajOSU+pWnWStPqX8v5zdfUnCbV8c 7uEWdDcEbhElAY2bxSjCMKWTz27/3CWJT8WFTQ6SMRpn/bkoUmY38wJjQFWOuaQ83cxf SfiQ== 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:references:in-reply-to :subject:to:from:date:message-id:content-transfer-encoding :mime-version:feedback-id:dkim-signature; bh=Iy+gSsuZO7+fTHPbHfMLyP8a9F/Jy2XtO29hM+7aQaA=; b=TORx8gm87rHRnEk3fi8R8PCKaSFCSijcCa1TmfIH+DQkSQDHJpb0cfL4wcB69ge54g RK/ct165Wn/rMsUQi3OOCEl7PGxJ4ixcFcIDl3OLST+r4vdlRxy6tDle9Jc+Y/QTVC6n YmzsYnfqNsmgztWbdvfzv/jIUTOS1UmbZ+AOViDh8WPMPtB2/OigW+KSUgk6/cAde2/9 dCNL1+Uea3BoYly821Kv7bM0e9UlbED1J+cTOQWLNYghmdVG8vj7wSkoAMZLysxgZPKn tKPQ4O+ouahTrwaRPjKXcVLl0iiukDL0Jhy/kIQ8V6DPIMcO9bVWbRqYblDhcPQKvNbW 9R1Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@wiumlie.no header.s=fm1 header.b=i0jHxOxW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=JMjBypPw; spf=pass (google.com: domain of haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org designates 66.111.4.25 as permitted sender) smtp.mailfrom=haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wiumlie.no DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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:references :in-reply-to:subject:to:from:date:message-id :content-transfer-encoding:mime-version:feedback-id:from:to:cc :subject:date:message-id:reply-to; bh=Iy+gSsuZO7+fTHPbHfMLyP8a9F/Jy2XtO29hM+7aQaA=; b=VE5HW6l1N1+w5rCNnT4woPHHsRWcDBQ2duAqSIRhf2hMOi10NaBVS3bobunBbKVodp pzzKsirb+ZbbY+GVL9s6+19X2cDRrziZ2gQVfCY4kY0jDoiIGNQlguWHIrK/mRoMdDVC yUHvH4wXkpMBcd7wkPhIUZ84C46k2HVla/ZxtpeMZ025Gh+7yNQjUXQ+ubpr5GM2+w6u nJ/DQDWxRDhSF3+eCFJe80D4+f40zeH3S1zBP1i5gKyo2AaY2eYypbN3jRm/St/fhY/F gqIHRyqiTP6B1DQtd4XZhsXvebAA5H/lEFKeAe6jasxJKRVj+4ol18SqY61U X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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:references :in-reply-to:subject:to:from:date:message-id :content-transfer-encoding:mime-version:feedback-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Iy+gSsuZO7+fTHPbHfMLyP8a9F/Jy2XtO29hM+7aQaA=; b=J0pEDNExJSEfqurhBBi+9LwNy2OsoYdlo8ByTzdu5ShS6A1qmqONzZeKkvfEplqmhG 4YofQ18abZlX3qUqARELKbNsfKe0/LYr03BaSAXYONVWUU2MfZvV0DXfnaRlCXbMh33O 6EeqHwJyeuVs+J7OC2QKIznqEE+KzIM+AxajCGHH3IW0AwZN8LZpxc+48MhjROOCeFE0 Pi7PlWruDGoHPNccAEXqVf1+TsQ7F2CeC/UMmPfMH6ADvu7fkB7fElVQx+tWfRdUHeoY YzEfNcVgAmjfsYa X-Gm-Message-State: ANoB5pmuSGgHgHVjjuediGTvfe42dSnB6GyfyxMJsJ79gEOCekxSuokN v7EZWZ0HW3WXm4l47A82bFA= X-Google-Smtp-Source: AA0mqf7mb7fMypIWUNbCKo8TASfW012RIY+vU8ofIP/v1lJjLEts3lzUfLEZbrGcDNI2UlZHi6rOUg== X-Received: by 2002:a02:2410:0:b0:363:d253:d340 with SMTP id f16-20020a022410000000b00363d253d340mr10713522jaa.159.1669470772317; Sat, 26 Nov 2022 05:52:52 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a02:a1dc:0:b0:369:7404:3a4c with SMTP id o28-20020a02a1dc000000b0036974043a4cls1019191jah.10.-pod-prod-gmail; Sat, 26 Nov 2022 05:52:49 -0800 (PST) X-Received: by 2002:a02:a58c:0:b0:375:e2e:745d with SMTP id b12-20020a02a58c000000b003750e2e745dmr18956061jam.252.1669470769734; Sat, 26 Nov 2022 05:52:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669470769; cv=none; d=google.com; s=arc-20160816; b=b0bGo/Dk3j/Oal6/2lSLY434wgf4sGbdsNimCyk01aPGI2xygST3bLvfln8NtGp7Sa olzDwuNwMnu8uxU25HXRSJuonc5Iu1Utr+FZk39YAKvQLRLbDZL8REzKL4PDLPleA6HI cGZ/1njLadTlHabFA2WGUtO9WrI2Mg6VdsiFPtGiLBtbyYIqowCepZnV1hw6SSPeD+3b rgpu2URrUgO1OeSmBVsTEOnouTkVa4rDeNFukmN4Hg71KaZbeStXb8cFGWOIUjRgbNr2 8C9cqjMXdVB+ecdp3gmmWmPNLWrwcF1u0/4sDfgHVOaWkc/3bB00CKlLiHL9ZTQC5Nad u/Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:subject:to:from:date:message-id :content-transfer-encoding:mime-version:feedback-id:dkim-signature :dkim-signature; bh=IdkaUk15+7w6lyMPYmjJfW9uj8zrAaacoCMXGFKniNk=; b=O4L7QeQJFif750dVtpQbs8vFjrWq8FQwtXzu48QQ/FvhXXdDxOEw7VfIIf0Kh5WMmi kGOmjt6ay0YhOb+LKCRfc+95Ehbost3V3PUzKBcQZlETW1EkpKCLj1qEEJF1bkwgeK5a +9TtENp1j8xu7DPmUbcfbS21tW06RdMxzDoHeOJV4OFFGKnXyapzskecy1pHXE2KwC9J cPYgsJOEEaOLp/QSwz3XDTAFctr6xIkk2CPHY/fCiFlX/Tw4qyGkTj5EgArK2iYOET3w S0h76LdTV/2QTS4UQz+BZrwqwNnMnmASbPIhy778VskvqPNiAdviNhD3N3zksW+wrdBY pNYg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@wiumlie.no header.s=fm1 header.b=i0jHxOxW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=JMjBypPw; spf=pass (google.com: domain of haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org designates 66.111.4.25 as permitted sender) smtp.mailfrom=haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wiumlie.no Original-Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com. [66.111.4.25]) by gmr-mx.google.com with ESMTPS id v4-20020a92c6c4000000b00302c8c0eca1si269011ilm.5.2022.11.26.05.52.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 05:52:49 -0800 (PST) Received-SPF: pass (google.com: domain of haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org designates 66.111.4.25 as permitted sender) client-ip=66.111.4.25; Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0D0A15C0078; Sat, 26 Nov 2022 08:52:49 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 26 Nov 2022 08:52:49 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenuc fjughrpeggtgfgkfffhffvufgjfhfosehtqhertdertddunecuhfhrohhmpefjnohkohhn ucghihhumhcunfhivgcuoehhrggrkhhonhesfihiuhhmlhhivgdrnhhoqeenucggtffrrg htthgvrhhnpedtgfeggfevjeejkefhudelueffieejvdfghfelfedufeelhfelteettddv udelhfenucffohhmrghinheptghsshegrdhpuhgspdhprhhinhgtvgigmhhlrdgtohhmpd ifihhumhhlihgvrdhnohdpphgrnhguohgtrdhorhhgpdhgohhoghhlvgdrtghomhenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhrggrkhhonh esfihiuhhmlhhivgdrnhho X-ME-Proxy: Feedback-ID: if1d14434:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 26 Nov 2022 08:52:47 -0500 (EST) In-Reply-To: <2aec84ad-a750-48f2-a0c2-ad7572dcca11n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Mailer: VM 8.2.0b under 26.3 (x86_64-pc-linux-gnu) X-Original-Sender: haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@wiumlie.no header.s=fm1 header.b=i0jHxOxW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=JMjBypPw; spf=pass (google.com: domain of haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org designates 66.111.4.25 as permitted sender) smtp.mailfrom=haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wiumlie.no X-Original-From: =?UTF-8?Q?H=C3=A5kon?= Wium Lie 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:31798 Archived-At: If you use Prince as the PDF generator, you can produce quite advanced foot= notes: https://css4.pub/2022/footnotes/ Also, Prince supports sidenotes, aiming for the holy grail of Tufte-like la= yout: https://css4.pub https://css4.pub/2022/sidenotes/ To add the page number of the linked-to page (which was the original question), Prince supports the "target-counter" feature in CSS. https://www.princexml.com/doc/gen-content/ This is often used to create ToCs: https://css4.pub/2022/toc/ (Prince is a commercial product, but free for non-commercial use. I work fo= r the company.) H=C3=A5kon Wium Lie haakon-EO96REbE7qRuMpJDpNschA@public.gmane.org www.wiumlie.no/en=20 > Thanks! Yeah injecting html in the intermediary document doesn't sound v= ery=20 > promising either (again, because the pages have to be built first before= =20 > footnotes updated with page #s) so maybe I'll abandon weasyprint in this= =20 > case, if this would be easy to do with a *Tex pdf engine. In that case..= .=20 > how would one go about this? Would a lua filter be more capable with a= =20 > different pdf engine or would a different mechanism be used? >=20 > On Saturday, November 26, 2022 at 5:28:31 AM UTC-5 Bastien Dumont wrote: >=20 > > The problem is that Pandoc does not produce the PDF document: it produ= ces=20 > > the intermediary HTML document that is processed by weasyprint to prod= uce=20 > > the PDF. So you cannot get page numbers in a Lua filter. > > > > However, you can inject raw HTML code in the intermediary file (or in = your=20 > > CSS) that will make weasyprint print the page numbers. The question is= =20 > > whether such HTML code exists. It certainly would be possible to do th= is if=20 > > you converted to PDF via LaTeX, ConTeXt or groff, but I don't know if = it is=20 > > possible via weasyprint. > > > > Le Friday 25 November 2022 =C3=A0 04:33:05PM, user account a =C3=A9cri= t : > > > Using pandoc with weasyprint pdf engine to turn the markdown files f= rom=20 > > a blog > > > (static site generator does the html conversion) into a pdf for prin= t. > > >=20 > > > Would it be possible, perhaps with a custom lua filter or some other= =20 > > mechanism, > > > to add the page number of the linked-to page? The page numbers won't= be=20 > > known > > > until pandoc has already created the document, and I don't know wher= e in=20 > > 'the > > > pipeline' the lua filter intervenes compared to when the pages exist= ...?=20 > > And > > > If the pages exist with their numbers earlier enough, is there an ob= ject=20 > > or > > > something from which lua can get the page number? > > >=20 > > > I haven't found anything about page numbers in https://pandoc.org/ > > > lua-filters.html#module-pandoc.utils ...am I looking in the wrong pl= ace?=20 > > Can > > > anyone tell me anything about this? > > >=20 > > > It's an intimidating rabbit hole for me, particularly because I see = no=20 > > mention > > > of "page number" there in the docs, which makes it seem kinda hopele= ss > > > actually. But maybe one of you know the way and could point me in th= at > > > direction? > > >=20 > > > -- > > > You received this message because you are subscribed to the Google G= roups > > > "pandoc-discuss" group. > > > To unsubscribe from this group and stop receiving emails from it, se= nd=20 > > an email > > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit [2] > > https://groups.google.com/d/msgid/ > > > pandoc-discuss/a93afb43-c939-40c1-868f-1db8eded17d8n%40googlegroups.= com. > > >=20 > > > References: > > >=20 > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > [2]=20 > > https://groups.google.com/d/msgid/pandoc-discuss/a93afb43-c939-40c1-86= 8f-1db8eded17d8n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > > > >=20 > --=20 > You received this message because you are subscribed to the Google Group= s "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send a= n email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msg= id/pandoc-discuss/2aec84ad-a750-48f2-a0c2-ad7572dcca11n%40googlegroups.com. --=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/25474.6699.105043.345344%40gargle.gargle.HOWL.