From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28015 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Julien Dutant Newsgroups: gmane.text.pandoc Subject: Re: Getting LaTeX process custom output files? Date: Fri, 26 Mar 2021 06:14:23 -0700 (PDT) Message-ID: <5157881e-36ea-48ef-ba40-30370eed79e3n@googlegroups.com> References: <04f715c6-bf37-4f03-a780-1c10d4d09740n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1036_1543584334.1616764463605" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19242"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC5Y3356IYILBPHXQIDBUBDJ5VWRS-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Mar 26 14:14:27 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f58.google.com ([209.85.161.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lPmIE-0004rW-Re for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 26 Mar 2021 14:14:26 +0100 Original-Received: by mail-oo1-f58.google.com with SMTP id h18sf4570001oot.8 for ; Fri, 26 Mar 2021 06:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=Gw5OajldBXZmMIUZYWJSWUd6/KHjpdH8tt9FHjSvmRw=; b=ijxbUPbblMWX03yk4wbLlpudi0DxWyaityUsHRP8LgIdldIv1NEXeI64cIITP6gHQL qrTPIsI9tY9KzUkpa/nkm2fmZGSiPiWHmlii/9vPb7EsNwZp4bgzME2laM0QWZF/6zLS IKSJ0bMvB6axDt7BlCX/+AkZkV8Njlqqf/ZOgnfB/cDJoUWD4Mjbytcj4QNrh+DJ+vya H0Aqd/tJTAbYP1mqkXa3FcAiNTn5BRH99ZX0EMmfpz2o9K66F7SS8qNdnC3jTgDur4++ lVvPRcTKwF7GxuusKT0CRcVlCxpz73qHoElTlbnOlKYC4cGce+lpZKacWp8XE4xJDo4U hDlw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=Gw5OajldBXZmMIUZYWJSWUd6/KHjpdH8tt9FHjSvmRw=; b=q2dcEo7zOrePQiklBg3f1EKLrKzggjQsAclm6DFQlw4FpC0/98d2rpJsNE5yldLER7 EQLHBPazAl4k7hbWYiBtx0Kk3CQKuozAeu2Pwk078nQh184znDhg48D0cAEi4cMrFZe0 CvoqDUPVrCtAl3GQIgKRVkyi60y0NHVQKjuObMDJGe9TY0qgstoEIPut9qYeyGyHj8Er IqiVlCyDqdnENUpjCwU2xS15eyTRlATQP43tV20C+TaRCc/NZr5hEb4gcGCQa5N/VAn7 gl3c8SNnVWGsK0BG2zhrp7IFNFYFM1z6w/LkFECAvA5zkpRFAx3YGYynfpquwan6HQCi DHgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=Gw5OajldBXZmMIUZYWJSWUd6/KHjpdH8tt9FHjSvmRw=; b=gwKc8DsL+SxHWjyT1Dwnr+gjpsSVd3Onx1FSYshVQbFvHhgWohGOkR+QdFSwqo4C8+ XnOtuoCenqZ9X+2wlIPVy2orHdoQ/bmMN+gXZm704PRABDdoV8OicLcmUtVyG25p+Pct tA5k5rNJlSeFfnarZA6BoTPYEXCubhXojtow9GPS4DGj1R5jVyUu7x+d31kX0LFxlJ7b jMYQIJaP7rUcj3/JUOls6O+gg0xP9oO4um5VKcpyo4grd01C/GZgqYLzTmuore6geIks yJPG95CL9cuc/VeGyALo19tca8mg0wcU9psHh9fSFpV5oyKQcmQ82uYiJ5Vt+17/HimB jEvw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532vujhyrxStEEeUspVmnngeMDzssVcR5Tj+4MOdLLXrkKmMHKyz iUrbLP9FGwjB43iR3fYjNnA= X-Google-Smtp-Source: ABdhPJz3jDPSSs4EGJQ8IBqfpKsE88z0Wyi1kCpq0pWs58Xy/FZ8IT8Xq8I7iccuFoMSMGDb28TYDA== X-Received: by 2002:a9d:638b:: with SMTP id w11mr11579329otk.273.1616764465911; Fri, 26 Mar 2021 06:14:25 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:4a0f:: with SMTP id x15ls2220453oia.8.gmail; Fri, 26 Mar 2021 06:14:24 -0700 (PDT) X-Received: by 2002:a05:6808:68a:: with SMTP id k10mr7622307oig.120.1616764464193; Fri, 26 Mar 2021 06:14:24 -0700 (PDT) In-Reply-To: X-Original-Sender: julien.dutant-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:28015 Archived-At: ------=_Part_1036_1543584334.1616764463605 Content-Type: multipart/alternative; boundary="----=_Part_1037_544649865.1616764463605" ------=_Part_1037_544649865.1616764463605 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks both, great suggestions. Denis: I'm planning to add a single-chapter= =20 cover page to each separately printed chapter, I suspect it's neater to=20 generate a new PDF for each. Some comment in case someone else needs this: * Using latexmk works well with pdf-engine-opt works well. My .tex is for= =20 Lualatex or Xelatex, so I need to call it with two options, but that seems= =20 to work fine: pandoc --pdf-engine=3Dlatexmk --pdf-engine-opt=3D"-lualatex"=20 --pdf-engine-opt=3D"-outdir=3Dfoo" * Splitting the PDF by bookmarks could be done with a script like=20 this: https://stackoverflow.com/a/10086073 . Haven't tested it out yet.=20 Looks reasonably easy to replicate within a lua filter.=20 All best, Julien On Thursday, March 25, 2021 at 11:07:13 PM UTC denis...-FfwAq0itz3ofv37vnLkPlQ@public.gmane.org wrote: > > -----Urspr=C3=BCngliche Nachricht----- > > Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > dis...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John MacFarlane > > Gesendet: Donnerstag, 25. M=C3=A4rz 2021 20:49 > > An: Julien Dutant ; pandoc-discuss > dis...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > Betreff: Re: Getting LaTeX process custom output files? > >=20 > >=20 > > [...] > > > > > > > Context: I'm writing a lua filter that generates PDFs for a collectio= n > > > of papers. But I would also like it to generate separate PDFs for eac= h > > > chapter. Currently I run my filter with: > > > > [...]=20 > > > > > > > So my Pandoc command generates a collection.pdf with all the chapters= . > > > However, to generate PDFs for each chapter separately, I need to know > > > at which page it starts in the collection PDF. Ideally, I would like > > > to extract this information and add it to chapter1.md's metadata bloc= k > > > in a page-start field, so that I can later generate single chapters > > > directly from those; but it'd be ok if I had to generate the entire > > > collection each time I want to regenerate a single chapter PDF. > > In my workflow I currently let papers always start at page 1 as it's for= =20 > an online-only journal, and I don't think continuous pagination is of muc= h=20 > help here. > > Anyway, when I've tested a workflow similar to what you have in mind, I'v= e=20 > had the best (and easiest) results with always generating an entire issue= ,=20 > and then splitting the pdf with pdftk. That's a trivial task for a script= =20 > if you have the splitpoints available somewhere. > > Denis=20 > --=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/5157881e-36ea-48ef-ba40-30370eed79e3n%40googlegroups.com. ------=_Part_1037_544649865.1616764463605 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks both, great suggestions. Denis: I'm planning to add a single-chapter= cover page to each separately printed chapter, I suspect it's neater to ge= nerate a new PDF for each. Some comment in case someone else needs this:
* Using latexmk works well with pdf-engine-opt works well.= My .tex is for Lualatex or Xelatex, so I need to call it with two options,= but that seems to work fine:

pandoc --pdf-eng= ine=3Dlatexmk --pdf-engine-opt=3D"-lualatex" --pdf-engine-opt=3D"-outdir=3D= foo"

* Splitting the PDF by bookmarks could be don= e with a script like this: https://stackoverflow.com/a/10086073 . Have= n't tested it out yet. Looks reasonably easy to replicate within a lua filt= er. 

All best,

Julie= n


On Thursday, March 25, 2021 at 11:07:13 PM UTC = denis...-FfwAq0itz3ofv37vnLkPlQ@public.gmane.org wrote:
> -----Urspr=C3=BCngliche Nachricht-----
> Von: pandoc-...@googleg= roups.com <pandoc-
> dis...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= > Im Auftrag von John MacFarlane
> Gesendet: Donnerstag, 25. M=C3=A4rz 2021 20:49
> An: Julien Dutant <j= ulien...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>; pandoc-discuss <pandoc-
> dis...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= >
> Betreff: Re: Getting LaTeX process custom output files?
>=20
>=20

[...]

> >
> > Context: I'm writing a lua filter that generates PDFs for= a collection
> > of papers. But I would also like it to generate separate PDFs= for each
> > chapter. Currently I run my filter with:
> >
[...]=20

> >
> > So my Pandoc command generates a collection.pdf with all the = chapters.
> > However, to generate PDFs for each chapter separately, I need= to know
> > at which page it starts in the collection PDF. Ideally, I wou= ld like
> > to extract this information and add it to chapter1.md's m= etadata block
> > in a page-start field, so that I can later generate single ch= apters
> > directly from those; but it'd be ok if I had to generate = the entire
> > collection each time I want to regenerate a single chapter PD= F.

In my workflow I currently let papers always start at page 1 as it'= s for an online-only journal, and I don't think continuous pagination i= s of much help here.

Anyway, when I've tested a workflow similar to what you have in min= d, I've had the best (and easiest) results with always generating an en= tire issue, and then splitting the pdf with pdftk. That's a trivial tas= k for a script if you have the splitpoints available somewhere.

Denis=20

--
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/5157881e-36ea-48ef-ba40-30370eed79e3n%40googlegroups.= com.
------=_Part_1037_544649865.1616764463605-- ------=_Part_1036_1543584334.1616764463605--