public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: <denis.maier-NSENcxR/0n0@public.gmane.org>
To: <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Cc: <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: AW: Front, main, and back matter?
Date: Wed, 11 Jan 2023 10:04:16 +0000	[thread overview]
Message-ID: <b48088746ffe40018e63dd41526b1ced@unibe.ch> (raw)
In-Reply-To: <1bba18b4-dde6-4423-810a-2a553f9e1916n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3165 bytes --]

Hi,

if your main/only target is LaTeX, 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.

When you want a more robust solution filters are indeed the way to go. Something as simple as this might already work :

function Str (elem)
  if elem.text == "{{frontmatter}}" then
    if FORMAT:match 'latex' then
      return pandoc.RawBlock('latex','\\fontmatter')
    end
  end
end

You can add more instructions for other output formats as needed.

Best,
Denis

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

Hi,

Is there any common approach to dealing with front matter, main matter, and back matter? In general front matter is often unnumbered or under a different page numbering scheme (i, ii, iii, …) and includes such things as contents, lists of tables and figures, abbreviations, abstract, preface, and so forth. Main 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 LaTeX these are indicated by the `\frontmatter`, `\mainmatter`, and `\backmatter` commands, but it is possible to do similar things in other formats albeit with less semantic content.

At the moment, after producing my LaTeX file, I manually 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.

Given that this is no doubt a common issue for the production 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 this?

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

Best,
Lyndon
--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1bba18b4-dde6-4423-810a-2a553f9e1916n%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/1bba18b4-dde6-4423-810a-2a553f9e1916n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 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/b48088746ffe40018e63dd41526b1ced%40unibe.ch.

[-- Attachment #2: Type: text/html, Size: 7766 bytes --]

  parent reply	other threads:[~2023-01-11 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AQHZGWZ/tSt910AZI0GxvaBJeZiP0q6ZDb3QgAAIkOA=>
2022-12-26 20:13 ` Lyndon Drake
     [not found]   ` <1bba18b4-dde6-4423-810a-2a553f9e1916n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-11 10:04     ` denis.maier-NSENcxR/0n0 [this message]
     [not found]       ` <b48088746ffe40018e63dd41526b1ced-NSENcxR/0n0@public.gmane.org>
2023-01-11 10:12         ` AW: " denis.maier-NSENcxR/0n0
     [not found]           ` <49968a6819234bc2a33f72f0197fa1c8-NSENcxR/0n0@public.gmane.org>
2023-01-14  6:00             ` Lyndon Drake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b48088746ffe40018e63dd41526b1ced@unibe.ch \
    --to=denis.maier-nsencxr/0n0@public.gmane.org \
    --cc=isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).