Skip to content

Settings Reference

Complete reference for all Markdown PDF settings.

Configuration

Settings are placed in your Zed settings.json:

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        // Settings here
      }
    }
  }
}

Page Layout

page_format

Paper size for the PDF.

TypeDefaultOptions
string"A4"A4, Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A5, A6
json
{ "page_format": "Letter" }

orientation

Page orientation.

TypeDefaultOptions
string"portrait"portrait, landscape
json
{ "orientation": "landscape" }

scale

Zoom factor for page rendering.

TypeDefaultRange
number10.12
json
{ "scale": 0.9 }

margin

Page margins as CSS length values.

TypeDefault
object{ top: "15mm", right: "15mm", bottom: "15mm", left: "15mm" }
json
{
  "margin": {
    "top": "20mm",
    "right": "15mm",
    "bottom": "20mm",
    "left": "15mm"
  }
}

Supported units: mm, cm, in, px, pt

page_ranges

Print only specific pages.

TypeDefault
string"" (all pages)
json
{ "page_ranges": "1-5, 8, 10-12" }

Include background colors and images.

TypeDefault
booleantrue
json
{ "print_background": true }

Content & Rendering

font_family

CSS font-family for document body and header/footer.

TypeDefault
string | nullnull (system fonts)
json
{ "font_family": "Georgia, 'Times New Roman', serif" }

include_default_styles

Include the built-in neutral stylesheet.

TypeDefault
booleantrue
json
{ "include_default_styles": false }

stylesheet_path

Path to a custom CSS file (relative to Markdown file).

TypeDefault
string | nullnull
json
{ "stylesheet_path": "./styles/custom.css" }

breaks

Convert single newlines to <br> elements.

TypeDefault
booleanfalse
json
{ "breaks": true }

emoji

Render emoji shortcodes (:smile: → 😄).

TypeDefault
booleantrue
json
{ "emoji": true }

Syntax Highlighting

highlight

Enable syntax highlighting for code blocks.

TypeDefault
booleantrue
json
{ "highlight": true }

highlight_style

Highlight.js theme filename.

TypeDefault
string"github.css"
json
{ "highlight_style": "atom-one-dark.css" }

Popular themes:

ThemeDescription
github.cssLight GitHub (default)
github-dark.cssDark GitHub
monokai.cssClassic Monokai
atom-one-dark.cssAtom One Dark
atom-one-light.cssAtom One Light
nord.cssNord
vs.cssVisual Studio Light
vs2015.cssVisual Studio Dark
tokyo-night-dark.cssTokyo Night
rose-pine.cssRosé Pine

See highlightjs.org/demo for all 80+ themes.

Structured header configuration.

TypeDefault
object | nullnull
json
{
  "header": {
    "height": "15mm",
    "padding": "0 10mm",
    "font_size": "9px",
    "border_bottom": "1px solid #ddd",
    "left": { "type": "image", "src": "./logo.svg", "height": "12mm" },
    "center": { "type": "title" },
    "right": { "type": "date", "format": "MMMM d, yyyy" }
  }
}

See Header/Footer Schema for complete documentation.

Structured footer configuration.

TypeDefault
object | nullnull
json
{
  "footer": {
    "height": "10mm",
    "center": { "type": "text", "content": "Page {page} of {pages}" }
  }
}

Shorthand Properties

For simple configurations:

json
{
  "header": {
    "height": "15mm",
    "left_image": "./logo.svg",
    "left_image_height": "12mm",
    "center_text": "{title}",
    "right_text": "{date:yyyy-MM-dd}"
  }
}
PropertyDescription
left_textText in left zone
left_imageImage path in left zone
left_image_heightHeight for left image
center_textText in center zone
center_imageImage path in center zone
center_image_heightHeight for center image
right_textText in right zone
right_imageImage path in right zone
right_image_heightHeight for right image

Output

output_directory

Default directory for output PDFs.

TypeDefault
string | nullnull (same as source)
json
{ "output_directory": "./build" }

open_after_export

Open PDF in default viewer after export.

TypeDefault
booleanfalse
json
{ "open_after_export": true }

Priority Order

Settings are applied in this order (later overrides earlier):

  1. Extension defaults
  2. Global settings (settings.json)
  3. Front matter (pdf: block)
  4. Tool arguments (from prompt)

Minimal Example

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        "page_format": "A4",
        "header": {
          "center_text": "{title}",
          "right_text": "{date:yyyy-MM-dd}"
        },
        "footer": {
          "center_text": "Page {page} of {pages}"
        }
      }
    }
  }
}

Full Example

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        "page_format": "A4",
        "orientation": "portrait",
        "scale": 1,
        "print_background": true,
        "margin": {
          "top": "20mm",
          "right": "15mm",
          "bottom": "20mm",
          "left": "15mm"
        },
        "font_family": "Georgia, serif",
        "include_default_styles": true,
        "highlight": true,
        "highlight_style": "github.css",
        "emoji": true,
        "open_after_export": false,
        "header": {
          "height": "18mm",
          "padding": "0 15mm",
          "font_size": "9px",
          "border_bottom": "1px solid #ddd",
          "left": {
            "type": "image",
            "src": "./logo.svg",
            "height": "14mm"
          },
          "center": {
            "type": "title",
            "font_weight": "bold"
          },
          "right": {
            "type": "date",
            "format": "MMMM d, yyyy"
          }
        },
        "footer": {
          "height": "12mm",
          "padding": "0 15mm",
          "font_size": "8px",
          "color": "#666",
          "center": {
            "type": "text",
            "content": "Page {page} of {pages}"
          }
        }
      }
    }
  }
}

Released under the MIT License.