I'm not sure whether my thought will be distracting or helpful. Based on your comments so far, it seems that your ultimate objective might be to publish a book from a source collection of one chapter per source document. Page breaks between chapters are a normal formatting feature of book-style output. If you could pre-filter the source such that the header levels are shifted right and the file information is then applied as the top-level header for each resulting sequence of sections, would you be moving closer toward a desired outcome? At this moment, I cannot propose a good way to achieve the above, but depending on your needs it may be worth considering, especially if someone else can suggest an existing feature that supports it. Ultimately, the specific problem you describe is more difficult than you would hope because formatting features such as page breaks are generally determined by the logical structure of the input document applied to the physical design of the output document. If you are able to utilize this design by slightly shifting your approach, you might have more fun and less pain. Of course it would be even simpler if the source already had the needed structure, but it seems you have external constraints or preferences that restrict this possibility. On Monday, September 16, 2019 at 4:15:49 PM UTC-4, Joseph wrote: > > > In addition to adding page breaks between the chapters, I'd like to have > the title (first level-1 heading, in this case) prefixed with an chapter > number taken from the file name. I want to do this dynamically, as I might > rename/resort/reorganize the files based on their names. > > > -- 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/33bca4bd-c1e7-4356-b79c-625ee4792773%40googlegroups.com.