Specify page properties in themes?

's Avatar


19 Dec, 2012 03:39 PM

I write in text files with the ultimate goal of the content being formatted for the printed page (scientific papers). Consequently, I'd love Marked to preview based on specified page properties (page size, margin size, etc.). That way, when I export to RTF, the words, per line, and page breaks are exactly what I saw in the Marked window. I've only just started working with Marked, but so far I can't find a way to do this. I've looked for simple "wrap to page" options, and searched for CSS solutions, but with no luck. Could I achieve this with something along the lines of the multi-column theme? I am certainly a novice when it comes to CSS, but I happy to tinker. Any tips or thoughts on this are appreciated, and sorry if I am missing something obvious.

  1. Support Staff 1 Posted by Brett on 19 Dec, 2012 05:55 PM

    Brett's Avatar

    Unfortunately, Markdown is not a typesetting language. It renders first to HTML and then to other formats, and there's no more predicting print/rich text output than you'd get from a web page. You can accomplish quite a bit with CSS, but (and especially with RTF) you're probably never going to get an exact replication in an editable format.

  2. 2 Posted by Scott on 20 Dec, 2012 02:33 AM

    Scott's Avatar

    Thanks, Brett. I was not strictly looking for typesetting, just an decent approximation for pagination (e.g. something rough like "wrap to page" page boundaries in TextEdit). I think I might be able to rig something with a column style theme and fiddling with the window size. Either way, Marked is still proving to be a tremendously useful app for me, so thanks.

  3. 3 Posted by Samuel on 05 Nov, 2013 03:10 PM

    Samuel's Avatar

    I use a little "hack" to control page breaks.
    In my (custom) CSS file, I define:

        hr.page-break {
          visibility: hidden;
          border: 0;
          height: 0;
          page-break-before:always; /* for printing */

    Then, in the markdown file, I just insert:

        <hr class="page-break" />

  4. Support Staff 4 Posted by Brett on 05 Nov, 2013 03:18 PM

    Brett's Avatar

    That's exactly what <!--BREAK--> (inserts a page-break-before div) and "Use HRs as Line Breaks" (sets HR to the same as your custom settings) does.

Reply to this discussion

Internal reply

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

Attaching KB article:


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