I have recently started using Quarto markdown.
Unfortunately following their documentation to generate a page break within my document with {{< pagebreak >}} does not work.
Thanks for any suggestions!
-
4Are you building to one of the supported formats for pagebreak? And what version of Quarto are you using (pagebreak was added this past April)?user5774952– user57749522022-12-23 05:47:12 +00:00Commented Dec 23, 2022 at 5:47
-
Thanks so much! I was using an older version where it was not supported.Moshi– Moshi2022-12-31 07:40:33 +00:00Commented Dec 31, 2022 at 7:40
-
See also hereJulian– Julian2023-01-30 15:39:08 +00:00Commented Jan 30, 2023 at 15:39
Add a comment
|
1 Answer
I have recently experienced the same problem and I discover some way to fix it when rendering into HTML.
The solution consists on adding manually a custom css class to top level elements (don't work with quarto basic syntax nor with p or span tags).
```{=html}
<script>
document.querySelector("your-selector").classList.add("newpage")
</script>
```
.newpage {
page-break-before: always; /* Or after, as your desire */
}
I don't know how to fix it when rendering into PDF, but for now, this works. Maybe with other css properties would work, but actually, I don't know.