From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31799 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 07:35:31 -0800 (PST) Message-ID: References: <2aec84ad-a750-48f2-a0c2-ad7572dcca11n@googlegroups.com> <25474.6699.105043.345344@gargle.gargle.HOWL> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_7190_1044186082.1669476931043" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27456"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD2NNN6DBIIMJZEITQDBUBA7ER2ZI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Nov 26 16:35:36 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f55.google.com ([209.85.160.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oyxDM-0006td-Gk for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 26 Nov 2022 16:35:36 +0100 Original-Received: by mail-oa1-f55.google.com with SMTP id 586e51a60fabf-142e1ae3f62sf3806682fac.16 for ; Sat, 26 Nov 2022 07:35:36 -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=2J1J6gIwBXBvJCxw9BPWGetLT9kUT6gs+PEXhzYeDi0=; b=PGuXqLVlojavk3C9Rwo0cREd5wB5irKB+ahjd4nhJzmKQSzy9UB70Bnpz1RN7Z5Gvl zDgc6dtbCtjXO0Oe53fqRXWDYHNCA6PtrK8pJroZMPL6kq8TpE1nKj4ORLnB8nlJjVJ4 iGDDVNBbaIGP9kgoNJRx2quQV4NR6IlCAKV+62BJwmrvtw+Afoab3IvNGp2YpK4ewA32 VmReGePSoCoiFRvPHww5QC9MVgOmUUjppSnXkToR9tL55uj6msnMivPfCKpl65LZyP9F PLwTaC1NltmjEgBRU09nkqKS2BpVr2wHJZ0574NmJR9++SPexNgUfJf47VCS3THaIbQ0 IArA== 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=2J1J6gIwBXBvJCxw9BPWGetLT9kUT6gs+PEXhzYeDi0=; b=mq7QLf9Z3Qe825JujOhDq+wW7RTXfJwkBDNSorUzOKQmdvz8MclMwwfvBmUNOcRm7v w4u9slm0gFoJdwaWsoG+YD614rM+zvQgvMxb+GD0q04GOTqp7MBw6p4Uvoh7z1eyUkTS besmxfH+u+n2lvkN6LQX32wNoyTwa+tgCBQNzCEZVQWD0RmjeeeevEapwjMCRb9T4DJU FBC2rQPcodIQenjpGSrwSlEfvMXZIaCXefmlhe+XAwzOMZ2tzHA86MFbQMzxocXFZyPX jSqPky01rwKfe8fG+EaYzOadqZmaHTJQdHFuGldTAJ0BUYxMDyYk5G1Z2UM3TjC2SzKh CbUQ== 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=2J1J6gIwBXBvJCxw9BPWGetLT9kUT6gs+PEXhzYeDi0=; b=wnwBz9hYkLQllmZV8igPsWmmRU21iRflQ//XHPMpKkVsCIKfmSMdoHzXU5jdFZ02Ak 7Vrak+ZTpEh394l/YloIcZ3je0gjkL/HNQv3N1DIihQ4eIMJOlTDEmzhXqKRu4mhmPqG 1nm9EwT2ipf52tTvA8xJBXB72b7jDg8t5z0lXQ/3OSRWsyFEUQg9qVdB/6P5rueMz8xC +h/56j5IhFc+bOFmRipKrQHL4yhotYip5jHYIKPwfRyLLansLRzh2aJZdt0AJg61Mj7n 5CdE78sNoSaBDN22EVVkQPw07j9HsCKsE9pHbnnU24XnUG9+1q4NCead/aUI1zjyhTwC uzEA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pn5kvRRuUjHtX8IKMYRxnI7QHJYnKpWhQAbR381i0o9pQNVyfmQ zX5v3nuXdft0MZfbEZtMQqM= X-Google-Smtp-Source: AA0mqf5RufpDlXrHNGN/T+dWnLVBYNpRa9a5EJKrky6RFBZDNT/ZSxRIwOXE+ZhNdWxwV3Xvnzllhg== X-Received: by 2002:a9d:7cc1:0:b0:66c:312d:472c with SMTP id r1-20020a9d7cc1000000b0066c312d472cmr15839594otn.339.1669476935133; Sat, 26 Nov 2022 07:35:35 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:de88:0:b0:345:9a88:c799 with SMTP id v130-20020acade88000000b003459a88c799ls1979881oig.5.-pod-prod-gmail; Sat, 26 Nov 2022 07:35:32 -0800 (PST) X-Received: by 2002:a05:6808:82:b0:35b:84d3:2d1f with SMTP id s2-20020a056808008200b0035b84d32d1fmr6643892oic.25.1669476931871; Sat, 26 Nov 2022 07:35:31 -0800 (PST) In-Reply-To: <25474.6699.105043.345344-4mDQ13Tdud8Jw5R7aSpS0dP8p4LwMBBS@public.gmane.org> 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:31799 Archived-At: ------=_Part_7190_1044186082.1669476931043 Content-Type: multipart/alternative; boundary="----=_Part_7191_923612801.1669476931043" ------=_Part_7191_923612801.1669476931043 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Prince looks decent, but I'm reluctant to use anything that's not freedom= =20 software. On Saturday, November 26, 2022 at 8:52:52 AM UTC-5 H=C3=A5kon Wium Lie wrot= e: > If you use Prince as the PDF generator, you can produce quite advanced=20 > footnotes: > > https://css4.pub/2022/footnotes/ > > Also, Prince supports sidenotes, aiming for the holy grail of Tufte-like= =20 > layout: > > 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= =20 > for the company.) > > H=C3=A5kon Wium Lie haa...-EO96REbE7qRuMpJDpNschA@public.gmane.org www.wiumlie.no/en=20 > > > Thanks! Yeah injecting html in the intermediary document doesn't sound= =20 > very=20 > > promising either (again, because the pages have to be built first befor= e=20 > > footnotes updated with page #s) so maybe I'll abandon weasyprint in thi= s=20 > > case, if this would be easy to do with a *Tex pdf engine. In that=20 > 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=20 > produces=20 > > > the intermediary HTML document that is processed by weasyprint to=20 > 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= =20 > your=20 > > > CSS) that will make weasyprint print the page numbers. The question i= s=20 > > > whether such HTML code exists. It certainly would be possible to do= =20 > this if=20 > > > you converted to PDF via LaTeX, ConTeXt or groff, but I don't know if= =20 > it is=20 > > > possible via weasyprint. > > > > > > Le Friday 25 November 2022 =C3=A0 04:33:05PM, user account a =C3=A9cr= it : > > > > Using pandoc with weasyprint pdf engine to turn the markdown files= =20 > from=20 > > > a blog > > > > (static site generator does the html conversion) into a pdf for=20 > print. > > > >=20 > > > > Would it be possible, perhaps with a custom lua filter or some othe= r=20 > > > mechanism, > > > > to add the page number of the linked-to page? The page numbers won'= t=20 > be=20 > > > known > > > > until pandoc has already created the document, and I don't know=20 > where in=20 > > > 'the > > > > pipeline' the lua filter intervenes compared to when the pages=20 > exist...?=20 > > > And > > > > If the pages exist with their numbers earlier enough, is there an= =20 > object=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= =20 > place?=20 > > > Can > > > > anyone tell me anything about this? > > > >=20 > > > > It's an intimidating rabbit hole for me, particularly because I see= =20 > no=20 > > > mention > > > > of "page number" there in the docs, which makes it seem kinda=20 > hopeless > > > > actually. But maybe one of you know the way and could point me in= =20 > that > > > > direction? > > > >=20 > > > > -- > > > > You received this message because you are subscribed to the Google= =20 > Groups > > > > "pandoc-discuss" group. > > > > To unsubscribe from this group and stop receiving emails from it,= =20 > 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 > > >=20 > https://groups.google.com/d/msgid/pandoc-discuss/a93afb43-c939-40c1-868f-= 1db8eded17d8n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > > > > > > >=20 > > --=20 > > You received this message because you are subscribed to the Google=20 > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/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/ffe38e06-2703-4e9b-b1ca-48310162c97dn%40googlegroups.com. ------=_Part_7191_923612801.1669476931043 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Prince looks decent, but I'm reluctant to use anything that's not freedom s= oftware.

On Saturday, November 26, 2022 at 8:52:52 AM UTC-5 H=C3=A5kon Wium L= ie wrote:
If = you use Prince as the PDF generator, you can produce quite advanced footnot= es:

https://css4.pub/2022/footno= tes/

Also, Prince supports sidenotes, aiming for the holy grail of Tufte-lik= e layout:

https://css4.pub
https://css4.pub/2022/sideno= tes/

To add the page number of the linked-to page (which was the original
question), Prince supports the "target-counter" feature in CS= S.

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 wor= k for the company.)

H=C3=A5kon Wium Lie haa.= ..@wiumlie.no www.wiumlie.no/en=20

> Thanks! Yeah injecting html in the intermediary document doesn= 9;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 weasypr= int 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 w= ith 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 produces=20
> > the intermediary HTML document that is processed by weasypri= nt 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 fi= le (or in your=20
> > CSS) that will make weasyprint print the page numbers. The q= uestion is=20
> > whether such HTML code exists. It certainly would be possibl= e to do this if=20
> > you converted to PDF via LaTeX, ConTeXt or groff, but I don&= #39;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 mar= kdown 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 do= n't know where in=20
> > 'the
> > > pipeline' the lua filter intervenes compared to whe= n the pages exist...?=20
> > And
> > > If the pages exist with their numbers earlier enough, i= s there an object=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, particular= ly because I see no=20
> > mention
> > > of "page number" there in the docs, which mak= es it seem kinda hopeless
> > > actually. But maybe one of you know the way and could p= oint 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 email= s from it, send=20
> > an email
> > > to [1]pandoc= -discus...-/JYPxA39Uh5TLH3MbocFFw@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:p= andoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [2]=20
> > https://grou= ps.google.com/d/msgid/pandoc-discuss/a93afb43-c939-40c1-868f-1db8eded17d8n%= 40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> >
> >
>=20
> --=20
> You received this message because you are subscribed to the Googl= e Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it,= send an email to pandoc-discus.= ..@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2aec84ad-a= 750-48f2-a0c2-ad7572dcca11n%40googlegroups.com.

--
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/ffe38e06-2703-4e9b-b1ca-48310162c97dn%40googlegroups.= com.
------=_Part_7191_923612801.1669476931043-- ------=_Part_7190_1044186082.1669476931043--