@AndrewLighten - I can’t find a way to affect .pdf output using cssclass.
Maybe someone else has done so. Until then, here’s a workaround:
You could use HTML in the note like so:
<h2 class="Paginated">The header text</h2>
Then, you have to specify the h2 element and class (reverse of how you do it by page):
@media print {
h2.Paginated {page-break-before: always;}
}
The bonus here is that you don’t need the frontmatter at all, and can use this anywhere. The downside is that it doesn’t render the h2 in edit mode.
A better way…
I’ll offer another alternative…
Make an hr element that serves as a print break. The css:
@media print {
hr.page-break {page-break-before: always; display:none;}
}
Then, anywhere you want a break in the outputted .pdf, add this to the note:
<hr class="page-break">
If you want to hide this break in Obsidian (make the hr line invisible), add this separately:
hr.page-break {border:none; margin:0px;}
You could probably do this with any element you want, really. HR just seemed natural to me.
Hope that helps. Good luck!
edit - display:none broke the page breaks. changed the style of the hr with attached class instead, to render ‘invisible’ in preview mode