Addendum: If you choose to just enter the LaTeX commands directly to your markdown sources, pandoc’s internal representation will look like this : Source : ``` *Hello* world! \frontmatter Hi again ``` Output (native): ``` [ Para [ Emph [ Str "Hello" ] , Space , Str "world!" ] , RawBlock (Format "tex") "\\frontmatter" , Para [ Str "Hi" , Space , Str "again" ] ] ``` So you could even just use the LaTeX commands directly, and use a filter to transform the RawBlocks with content \\frontmatter to something else when your target is not LaTeX. Best, Denis Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im Auftrag von denis.maier-NSENcxR/0n0@public.gmane.org Gesendet: Mittwoch, 11. Januar 2023 11:04 An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Cc: isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Betreff: AW: Front, main, and back matter? 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 > Im Auftrag von Lyndon Drake Gesendet: Montag, 26. Dezember 2022 21:13 An: pandoc-discuss > 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. To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1bba18b4-dde6-4423-810a-2a553f9e1916n%40googlegroups.com. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/b48088746ffe40018e63dd41526b1ced%40unibe.ch. -- 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/49968a6819234bc2a33f72f0197fa1c8%40unibe.ch.