2

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!

3
  • 4
    Are you building to one of the supported formats for pagebreak? And what version of Quarto are you using (pagebreak was added this past April)? Commented Dec 23, 2022 at 5:47
  • Thanks so much! I was using an older version where it was not supported. Commented Dec 31, 2022 at 7:40
  • See also here Commented Jan 30, 2023 at 15:39

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.