arrowrbook / book

https://arrowrbook.com
6 stars 0 forks source link

Prevent page breaks in the middle of code blocks? #24

Open nealrichardson opened 3 weeks ago

nealrichardson commented 3 weeks ago

Is that something we can do? Some of them look particularly silly, like with a closing parenthesis on the next page.

image

nealrichardson commented 2 weeks ago

https://quarto.org/docs/authoring/article-layout.html#page-breaks is to manually insert page breaks, but that's not exactly what I had in mind.

nealrichardson commented 1 week ago

The CRC guide says:

Don’t use hard-code formatting such as spacing, line breaks or page breaks into your manuscript early on as this is “premature optimization.” LaTeX determines line and page breaks on its own using a sophisticated algorithm, that nonetheless can occasionally provide a sub-optimal result. Manually coding in line or page breaks should only be done at the end, since any edits may make those choices inappropriate after the text reflows.

So I think we do nothing on this right now and ask about it as part of the final copyediting/proofing.

thisisnic commented 1 week ago

That makes sense. There are also some potential options here too: https://stackoverflow.com/questions/75508806/rmarkdown-prevent-code-outputs-from-breaking-across-pages