Pagination and code blocks

an.leopardi's Avatar


27 Jul, 2014 10:14 AM

I'm including a bunch of code in a project with the Marked <<(file) syntax (super useful!).
Code blocks (and code included from files) however are not split between pages in the paginated output; say, half of a page is left blank and the code block appears at the top of a new page. Is there a way I can make Marked split code blocks and span them between two pages as if they were normal text?

  1. Support Staff 1 Posted by Brett on 27 Jul, 2014 10:57 AM

    Brett's Avatar

    Sure. It's a fine line between horrible cuts and horrible half-blank pages when you're dealing with larger code blocks. Open up the Style preferences and put this in the custom CSS field:

     pre,pre code{page-break-inside:auto;page-break-before:auto;page-break-after:auto;}

    Should fix it in any of the themes.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • Screenshot_2014-07-27_12.14.33.png 197 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac