From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31991 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lyndon Drake Newsgroups: gmane.text.pandoc Subject: Re: Front, main, and back matter? Date: Fri, 13 Jan 2023 22:00:22 -0800 (PST) Message-ID: <555f7b12-5af4-4a08-89cd-0431698fd59bn@googlegroups.com> References: <1bba18b4-dde6-4423-810a-2a553f9e1916n@googlegroups.com> <49968a6819234bc2a33f72f0197fa1c8@unibe.ch> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2964_1587690817.1673676022522" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26665"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCKOX6WY7EKBB54JRGPAMGQE7HQTWYQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 14 07:00:29 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f62.google.com ([209.85.160.62]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pGZad-0006j5-Ua for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 14 Jan 2023 07:00:28 +0100 Original-Received: by mail-oa1-f62.google.com with SMTP id 586e51a60fabf-15ed2fd118esf2596178fac.20 for ; Fri, 13 Jan 2023 22:00:27 -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=Shh8C9mZiqp3cEqLHGt1JyI73OE0jJuij5DBFOHtcXw=; b=TOERTsmc71wjVR1s1ktblaI6oyx3tZdfXFI1uTQQQv/zma4oLJCzPe68XR36zeJwCZ jntbhrrfIE6SxYJH8doB1nQfSWT7btYKQ8r5I1I6GNqCGna1ExIayLeVgND2aIGPfrIq j0rNsugkaYAkqMEeLMGwWHnmFQtY4BEZe1A1HaMg43BED7Lex1Vg2eWjDVSplP9YT9wp snOz8MzyVpaSxjFvZQGYCPuucxN54beuJ4B7USu6Cwz7DjUB44f5ku3j0EUGJWMUbyPR JkBmtSLoJMSbh3jyD9bb/wf4c2I/IEhxPxqyyFVSOabjzmwV8o/FA+XR4xxud1t/ZtKg behQ== 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=Shh8C9mZiqp3cEqLHGt1JyI73OE0jJuij5DBFOHtcXw=; b=HCcpEbzHQXh3G31BaZAH1b/E4D60stqe9EK+MHu/QUQr6fz0PeTmAFcU3riLDiWths wADpCUkWOKCsWGNQBTEV3YquiZDYDaFH2McL53G1zAM4nB5e0N7Ar/QZulxkDeHWMIWJ a8zUjz5/h6gWfaBK8DcFybBmwKM3d74YOz5h3RvAGWQeNCqFeRY78lnxFzt5yGmr3h6K vtXHoNP1fwrBiO9autZswnHjIdjkGo0ERzWTDNbO5MPfEMe5LEy2Y+M1Zl5IDcEpcvXp MmqDAfd2M2xe1OXOhU4AEhfPxCbtBHG4YyxwaKtMpNjBvnqW4VpoFMoUPzG1nphHZXwv Mc5A== 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=Shh8C9mZiqp3cEqLHGt1JyI73OE0jJuij5DBFOHtcXw=; b=M3cdyTmC4WqovOmn9SMVQQ3Oo4YcT4QcxNjKCGKJpCSgHgRb6TPeK7U/dPdk4mpzsB /QLUfEGnQ8tQfptmgd66TDDoiX+34gsRY4Q4ioelmGndVdNG0UBZ+u/iczcvpGLa1ATj QMUV6jhkS6HqDRtbk2PXcsuGaeMYLeMc7Zep9pJEqr4xnXLZZ5CgVe5yQs4rKi3BAGtw 2CHzCj8Kbv4Cv0KzbNL3LTWsA30I1aYXPcSGe6HLeigETSPLCfIg46NjYHxGKfSqPSU7 KUYzib/DoWLrs6Bg0bu7M+8Gre7rjHsipv4gc84s0DQu+yLwna5VGj+AKzan9EpOxqVW /uWA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2kr9Y/WDywKmOCUdl6/Ek2eL8gLtvfGLKxqBtmUWp1Gcnc1uTXi2 jwLkv/RIwT/HQAu6LufaeQU= X-Google-Smtp-Source: AMrXdXuVr0KAjmyx0Pn20x1E8xmrbwaIUF9zCLpHsR/5DSU6XNDaG45RHIEZMIQ3YZ4QK8CKWk0+og== X-Received: by 2002:a05:6870:559f:b0:15e:f8b5:56b7 with SMTP id n31-20020a056870559f00b0015ef8b556b7mr333248oao.255.1673676026740; Fri, 13 Jan 2023 22:00:26 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:2219:b0:363:d608:9c7f with SMTP id bd25-20020a056808221900b00363d6089c7fls2144864oib.11.-pod-prod-gmail; Fri, 13 Jan 2023 22:00:23 -0800 (PST) X-Received: by 2002:a05:6808:3a83:b0:35a:7d30:3ece with SMTP id fb3-20020a0568083a8300b0035a7d303ecemr4841624oib.21.1673676023395; Fri, 13 Jan 2023 22:00:23 -0800 (PST) In-Reply-To: <49968a6819234bc2a33f72f0197fa1c8-NSENcxR/0n0@public.gmane.org> X-Original-Sender: isenguard-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:31991 Archived-At: ------=_Part_2964_1587690817.1673676022522 Content-Type: multipart/alternative; boundary="----=_Part_2965_582359233.1673676022522" ------=_Part_2965_582359233.1673676022522 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I hadn't thought about doing it that way, but it does make sense. My=20 template is set up to have the \frontmatter and similar commands in it, and= =20 I'd been thinking I would do a filter to shift the appropriate sections up= =20 above the \mainmatter command. But I hadn't realised that the LaTeX would= =20 be left out of other formats. That means I can just put all the LaTeX=20 commands I need, including those currently in the template file, in the MD= =20 file (actually in my Scrivener file, but that's not actually that=20 relevant), and then when I convert to LaTeX it'll end up the way I want it. On Wednesday, 11 January 2023 at 23:12:24 UTC+13 denis...-NSENcxR/0n0@public.gmane.org wrote: > Addendum: > > If you choose to just enter the LaTeX commands directly to your markdown= =20 > sources, pandoc=E2=80=99s internal representation will look like this : > > =20 > > Source : > > =20 > > ``` > > *Hello* world! > > =20 > > \frontmatter > > =20 > > Hi again > > ``` > > =20 > > Output (native): > > =20 > > ``` > > [ Para [ Emph [ Str "Hello" ] , Space , Str "world!" ] > > , RawBlock (Format "tex") "\\frontmatter" > > , Para [ Str "Hi" , Space , Str "again" ] > > ] > > ``` > > =20 > > So you could even just use the LaTeX commands directly, and use a filter= =20 > to transform the RawBlocks with content \\frontmatter to something else= =20 > when your target is not LaTeX. > > =20 > > Best, > > Denis > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > Auftrag von *denis...-NSENcxR/0n0@public.gmane.org > *Gesendet:* Mittwoch, 11. Januar 2023 11:04 > *An:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > *Cc:* isen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > *Betreff:* AW: Front, main, and back matter? > > =20 > > Hi, > > =20 > > if your main/only target is LaTeX, you should be able to just add these= =20 > command directly to your markdown sources. Pandoc will pass those through= =20 > as is when the output is LaTeX, and ignore those for other output formats= . > > =20 > > When you want a more robust solution filters are indeed the way to go.=20 > Something as simple as this might already work : > > =20 > > function Str (elem) > > if elem.text =3D=3D "{{frontmatter}}" then=20 > > if FORMAT:match 'latex' then > > return pandoc.RawBlock('latex','\\fontmatter') > > end > > end > > end > > =20 > > You can add more instructions for other output formats as needed. > > =20 > > Best, > > Denis > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > Auftrag von *Lyndon Drake > *Gesendet:* Montag, 26. Dezember 2022 21:13 > *An:* pandoc-discuss > *Betreff:* Front, main, and back matter? > > =20 > > Hi, > > =20 > > Is there any common approach to dealing with front matter, main matter,= =20 > and back matter? In general front matter is often unnumbered or under a= =20 > different page numbering scheme (i, ii, iii, =E2=80=A6) and includes such= things as=20 > contents, lists of tables and figures, abbreviations, abstract, preface,= =20 > and so forth. Main matter then is the body of the work, typically in=20 > chapters, and then the back matter is such things as appendices, indices,= =20 > and bibliographies. In LaTeX these are indicated by the `\frontmatter`,= =20 > `\mainmatter`, and `\backmatter` commands, but it is possible to do simil= ar=20 > things in other formats albeit with less semantic content. > > =20 > > At the moment, after producing my LaTeX file, I manually move the=20 > `\frontmatter` command to the correct place. I imagine that I might be ab= le=20 > to write a filter to do the same thing but I'm not sure how to start. > > =20 > > Given that this is no doubt a common issue for the production of books,= =20 > I'm also wondering if there might be a good way to approach the issue so= =20 > that (in time) there can be a canonical approach to this? > > =20 > > (There might be similar things around 'Part's of books, and to things suc= h=20 > as variations in citation formatting per-chapter.) > > =20 > > Best, > > Lyndon > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > 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/1bba18b4-dde6-4423-810a-= 2a553f9e1916n%40googlegroups.com=20 > > . > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > 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/b48088746ffe40018e63dd41= 526b1ced%40unibe.ch=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/555f7b12-5af4-4a08-89cd-0431698fd59bn%40googlegroups.com. ------=_Part_2965_582359233.1673676022522 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I hadn't thought about doing it that way, but it does make sense. My templa= te is set up to have the \frontmatter and similar commands in it, and I'd b= een thinking I would do a filter to shift the appropriate sections up above= the \mainmatter command. But I hadn't realised that the LaTeX would be lef= t out of other formats. That means I can just put all the LaTeX commands I = need, including those currently in the template file, in the MD file (actua= lly in my Scrivener file, but that's not actually that relevant), and then = when I convert to LaTeX it'll end up the way I want it.

On Wednesday, 11 = January 2023 at 23:12:24 UTC+13 denis...-NSENcxR/0n0@public.gmane.org wrote:

Addendum:

If you choose to just enter the= LaTeX commands directly to your markdown sources, pandoc=E2=80=99s interna= l representation will look like this=C2=A0:

=C2=A0

Source=C2=A0:

=C2=A0

```

*Hello* world!

=C2=A0

\frontmatter

=C2=A0

Hi again

```

=C2=A0

Output (native):

=C2=A0

```

[ Para [ Emph [ Str "Hello" ] , Spac= e , Str "world!" ]

, RawBlock (Format "tex") "\\fr= ontmatter"

, Para [ Str "Hi" , Space , Str &quo= t;again" ]

]

```

=C2=A0

So you could even just use the LaTeX commands = directly, and use a filter to transform the RawBlocks with content \\frontm= atter to something else when your target is not LaTeX.=

=C2=A0

Best,

Denis

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...@googlegroups.c= om> Im Auftrag von denis...@u= nibe.ch
Gesendet: Mittwoch, 11. Januar 2023 11:04
An: pandoc-...@googlegrou= ps.com
Cc: isen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org=
Betreff: AW: Front, main, and back matter?

=C2=A0

Hi,

=C2=A0

if your main/only target is LaT= eX, you should be able to just add these command directly to your markdown = sources. Pandoc will pass those through as is when the output is LaTeX, and ignore those for other output formats.

=C2=A0

When you want a more robust sol= ution filters are indeed the way to go. Something as simple as this might a= lready work=C2=A0:

=C2=A0

function Str (elem)

=C2=A0 if elem.text =3D=3D "{{frontmatter= }}" then

=C2=A0=C2=A0=C2=A0=C2=A0if FORMAT:match 'l= atex' then

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return pandoc.R= awBlock('latex','\\fontmatter')

=C2=A0=C2=A0=C2=A0 end

=C2=A0 end

end

=C2=A0

You can add more instructions f= or other output formats as needed.

=C2=A0

Best,

Denis

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Lyndon Drake
Gesendet: Montag, 26. Dezember 2022 21:13
An: pandoc-discuss <pa= ndoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Front, main, and back matter?

=C2=A0

Hi,

=C2=A0

Is there any common approach to dealing with front m= atter, main matter, and back matter? In general front matter is often unnum= bered or under a different page numbering scheme (i, ii, iii, =E2=80=A6) an= d includes such things as contents, lists of tables and figures, abbreviations, abstract, preface, and so forth. Mai= n matter then is the body of the work, typically in chapters, and then the = back matter is such things as appendices, indices, and bibliographies. In L= aTeX these are indicated by the `\frontmatter`, `\mainmatter`, and `\backmatter` commands, but it is possi= ble to do similar things in other formats albeit with less semantic content= .

=C2=A0

At the moment, after producing my LaTeX file, I manu= ally move the `\frontmatter` command to the correct place. I imagine that I= might be able to write a filter to do the same thing but I'm not sure = how to start.

=C2=A0

Given that this is no doubt a common issue for the p= roduction of books, I'm also wondering if there might be a good way to = approach the issue so that (in time) there can be a canonical approach to t= his?

=C2=A0

(There might be similar things around 'Part'= s of books, and to things such as variations in citation formatting per-cha= pter.)

=C2=A0

Best,

Lyndon

--
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 pandoc-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1bba18b4-dde6-4423-810a-2a= 553f9e1916n%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 pandoc-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.

--
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/555f7b12-5af4-4a08-89cd-0431698fd59bn%40googlegroups.= com.
------=_Part_2965_582359233.1673676022522-- ------=_Part_2964_1587690817.1673676022522--