Zooming in/out in preview mode changes font size in exported pdf

Ufuk Kizilgedik's Avatar

Ufuk Kizilgedik

27 Mar, 2017 05:33 AM

Thank you for the help.

// Please enter a detailed description of the issue
// Description of the issue: Zooming in or out in preview mode changes the font size in the exported pdf.

// Please enter a list of steps required to reproduce the issue
// Steps to reproduce:

1. Open a random text in Marked2
2. Zoom in, say to 160%
3. Export to PDF or print. Here you have huge letters.

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit)
Marked 2 930 (Direct)
OS X Version: 10.11.6
allowPageBreakInCode: 1
bookTxtIsLeanpub: 0
summaryMdIsGitBook: 0
codeIsPoetry: 0
collapsibleHeadlines: 1
convertGithubCheckboxes: 1
convertYAMLToMMD: 1
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 101
defaultProcessor: MultiMarkdown
enableMiniMap: 0
excludeBlockQuotesFromCounts: 0
excludeFootnotesFromCounts: 0
excludeVerbatimFromCounts: 0
excludeCaptionsFromCounts: 0
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: 0
h1IsPageBreak: 0
h2IsPageBreak: 0
hrIsPageBreak: 0
includeMathJax: 0
limitTextWidth: 1
minimalJavaScript: 0
permissionGranted: 1
printHeaderBottomRight: %page
printHeaderFooterFirstPage: 1
printHeaderTopRight: %date
processHTMLFiles: 1
removeMetadataForPreview: 0
removeYAMLHeaders: 0
scrollToEdit: 1
shouldDetectCritic: 1
shouldHighlightMarkupErrors: 1
shouldLoadCritic: 0
syntaxHighlight: 1

  1. Support Staff 1 Posted by Brett on 27 Mar, 2017 05:01 PM

    Brett's Avatar

    This is currently expected behavior. It provides an easier way to adjust
    the output size than having to specify a universal font size or custom
    CSS for print/PDF output of a given document. I understand that it's not
    necessarily intuitive, though, so I may add an export option to always
    print/export at 100%.


  2. 2 Posted by Scott James on 12 Jun, 2018 04:34 PM

    Scott James's Avatar

    Apologies if this is already answered, I've seen this topic come up in different contexts on but couldn't figure out the final answer.

    My goal is to produce a document with 10pt font (not by choice, FWIW, by requirement). I ended up doing the following:

    • Choose Swiss
    • Select 70% zoom because I see in CSS:

    body {
    font-size: 15px; --> 10/15 ~ .67 line-height: 21px; margin: 0 auto; }

    So this works Good Enough. What I'm not so clear on is the meaning of the option:

    "Custom font size for export ".

    Clicking On and Setting this to different values seems to change the exported output but not to 10 pt. Perhaps some sort of scaled-10-pt?

  3. Support Staff 3 Posted by Brett on 13 Jun, 2018 07:25 PM

    Brett's Avatar

    The custom font size essentially adds a font-size: XXpx !important to the output, which should override whatever is in the style. It's a bit screwy right now, as half of the built-in styles are using rem/em to base sizes off of what's specified for the html/body. Because I assume that when setting a custom font size, users would still want headlines and other elements that differ from the paragraph font size to scale accordingly, I'm going to need to find a way to normalize the themes and provide a mechanism that will work with unpredictable custom themes.

    So at this point, the "Custom font size for export" is a bit of a gamble. If you need an exact output font size, the best bet right now is to create a custom theme that outputs exactly what you intend. All of the CSS for the default styles as well as a collection of custom styles is available at https://github.com/ttscoff/markedcustomstyles.


  4. 4 Posted by scott.james on 15 Jun, 2018 02:14 PM

    scott.james's Avatar

    Thanks for the detailed explanation. They accepted my zoom-ing hack for now, so I’m good. But if they get persnickety I’ll do as you say with the explicit CSS.

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