From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31796 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: user account Newsgroups: gmane.text.pandoc Subject: Re: converting links to footnotes... including page number in footnote?? Date: Sat, 26 Nov 2022 05:21:25 -0800 (PST) Message-ID: <2aec84ad-a750-48f2-a0c2-ad7572dcca11n@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3854_1473552153.1669468885348" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37329"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD2NNN6DBIINNJMITQDBUBD742DDA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Nov 26 14:21:30 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f59.google.com ([209.85.210.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oyv7a-0009VT-EO for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 26 Nov 2022 14:21:30 +0100 Original-Received: by mail-ot1-f59.google.com with SMTP id j20-20020a9d7f14000000b0066c532b53eesf2989499otq.18 for ; Sat, 26 Nov 2022 05:21:30 -0800 (PST) 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=SHYNUXfdeuBbimITF3VYhr6AEJfLDdj289/uj/D9EMc=; b=EvbDSx6A62Hxbv5QMhTJ+YG1P38wYT0/lQkyc7EHiw8bfN6U1FKZEU0Ql0UlkWD0f0 Q/M+uzkhBFHgiWL2LA6elzG/zIVLPhOrfYA2rdOkuqMBRA+yhqXD9rpqgDorRZP1G2cu mboKqPYR5+JBOP16I6DxhXT1fCZk7GfiMjVrRxFLJlM9bfFGXV7NxKWd4MHo6Oz2pyI8 P3atDb26m67bpIekNsI/vapYPdhKAAayrG49yJlB6jylLGS8G+jYaP3DcHahQzZoFmGy T6MGlopGQuidfJictFJYFwz/7oELKcMBIUcWxknSOekOIyo3i7MaUqQhTo2m2hj7Guz9 v/nw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=SHYNUXfdeuBbimITF3VYhr6AEJfLDdj289/uj/D9EMc=; b=bWrpBi3iL6etLg9pv+q+FfuEhc5vg7rmJyH6wN1IAeLiZ3Gx7+g6FQTMbSL317rtoc WekQ0WoACZ8Ny4bv/lqnAMpbMhYb34/eDkwKo9uMCf0hMU3yV9ZcXnQMurr+BrKNAR22 AsDJbXlklKHR/krQHxHWrqalRDC1vWl8dums9JL1AurzUKbwWfOv/6UAof01hmbSNddO LsTSSMHbVpE7/eR+e8vmfel0uv6CtrZ8aKxt6CcL17VHz2lLlLTW7j8xJ70l7mqbv4vq sruS/jBfJxLZVOXp5llPYIYckWfySlN7jHNeiqhziiIhTGoREVMq2HO+OMSXU15iWLch vfaA== 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=SHYNUXfdeuBbimITF3VYhr6AEJfLDdj289/uj/D9EMc=; b=Xt7Yht3oAGVvy3wyJHULTMe0xoFbP0qFT13yWf1zOTFVR2Xmr8G5AXNzjXS/ut9GCi 4P2s0n5wqySF5Bv2dJO3p3UgUwjZTuP7pcI1lHbdk6lYhDShT9Q3vkOP2DSKIc0b+099 w1ntOE0OrXBwZlV60S5fjT+xDmjyTlCgaBPQ7BodVY9qL8gPfGmCSV2nbtJ4dxt3PDa6 kv3nG7amEmmBxz0zLU8KwK8LVOsoG0I//FVJWNVPaBm4J36W6m22a0jf7aL7cwi4kAPc lkLj4EZoMNMg1V0fjFprboivyNan1qub9w/pTaiRA107hbhLGt4wadBfpFlc950zhile SpmQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pksKz+bSJvY+eibocEu81T6MkJspp6IdnbpumEiaNKildGFWW5/ LtTXahl+RoeFGbCkEXQ7zH0= X-Google-Smtp-Source: AA0mqf45W8VGJMNbOAkYvkp3OnvQk03kmS2FKAWHZZifzyhj9+y1Mbsofrhn1FfKYH9QTVLPXzL5nQ== X-Received: by 2002:aca:1e06:0:b0:359:f808:2e94 with SMTP id m6-20020aca1e06000000b00359f8082e94mr11847569oic.6.1669468889299; Sat, 26 Nov 2022 05:21:29 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:1147:b0:35a:6687:ef26 with SMTP id u7-20020a056808114700b0035a6687ef26ls1935059oiu.4.-pod-prod-gmail; Sat, 26 Nov 2022 05:21:26 -0800 (PST) X-Received: by 2002:a05:6808:8f6:b0:35a:ce21:ecf0 with SMTP id d22-20020a05680808f600b0035ace21ecf0mr11201740oic.10.1669468886334; Sat, 26 Nov 2022 05:21:26 -0800 (PST) In-Reply-To: X-Original-Sender: mail.user.sadf-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:31796 Archived-At: ------=_Part_3854_1473552153.1669468885348 Content-Type: multipart/alternative; boundary="----=_Part_3855_493178783.1669468885348" ------=_Part_3855_493178783.1669468885348 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks! Yeah injecting html in the intermediary document doesn't sound very= =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? On Saturday, November 26, 2022 at 5:28:31 AM UTC-5 Bastien Dumont wrote: > The problem is that Pandoc does not produce the PDF document: it produces= =20 > the intermediary HTML document that is processed by weasyprint to produce= =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 you= r=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 this = 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=A9crit : > > Using pandoc with weasyprint pdf engine to turn the markdown files from= =20 > a blog > > (static site generator does the html conversion) into a pdf for print. > >=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 where i= n=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 objec= t=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 place= ?=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 hopeless > > actually. But maybe one of you know the way and could point me in that > > direction? > >=20 > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =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-868f-= 1db8eded17d8n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > --=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/2aec84ad-a750-48f2-a0c2-ad7572dcca11n%40googlegroups.com. ------=_Part_3855_493178783.1669468885348 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks! Yeah injecting html in the intermediary document doesn't sound= very promising either (again, because the pages have to be built first bef= ore footnotes updated with page #s) so maybe I'll abandon weasyprint in thi= s case, if this would be easy to do with a *Tex pdf engine. In that case...= how would one go about this? Would a lua filter be more capable with a dif= ferent pdf engine or would a different mechanism be used?

On Saturday, Nove= mber 26, 2022 at 5:28:31 AM UTC-5 Bastien Dumont wrote:
The problem is that Pandoc does = not produce the PDF document: it produces the intermediary HTML document th= at is processed by weasyprint to produce the PDF. So you cannot get page nu= mbers in a Lua filter.

However, you can inject raw HTML code in the intermediary file (or in y= our CSS) that will make weasyprint print the page numbers. The question is = whether such HTML code exists. It certainly would be possible to do this if= you converted to PDF via LaTeX, ConTeXt or groff, but I don't know if = it is possible via weasyprint.

Le Friday 25 November 2022 =C3=A0 04:33:05PM, user account a =C3=A9crit= :
> Using pandoc with weasyprint pdf engine to turn the markdown files= from a blog
> (static site generator does the html conversion) into a pdf for pr= int.
>=20
> Would it be possible, perhaps with a custom lua filter or some oth= er mechanism,
> to add the page number of the linked-to page? The page numbers won= 't be known
> until pandoc has already created the document, and I don't kno= w where in 'the
> pipeline' the lua filter intervenes compared to when the pages= exist...? And
> If the pages exist with their numbers earlier enough, is there an = object 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 = place? Can
> anyone tell me anything about this?
>=20
> It's an intimidating rabbit hole for me, particularly because = I see no mention
> of "page number" there in the docs, which makes it seem= kinda hopeless
> actually. But maybe one of you know the way and could point me in = that
> direction?
>=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 email
> to [1]pandoc-discus...@= googlegroups.com.
> 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-discu= s...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups= .google.com/d/msgid/pandoc-discuss/a93afb43-c939-40c1-868f-1db8eded17d8n%40= googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter

--
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/2aec84ad-a750-48f2-a0c2-ad7572dcca11n%40googlegroups.= com.
------=_Part_3855_493178783.1669468885348-- ------=_Part_3854_1473552153.1669468885348--