Articles
Published · November 18, 2026

Write a Holiday Letter in Markdown and Print It Cleanly

A one-page holiday letter written in Markdown, with hard line breaks for the address and two ways to print it cleanly: browser print with @page CSS, or Pandoc to PDF.

Also in: Español中文हिन्दी

A holiday letter in Markdown is a plain text file with a heading, a few short paragraphs, and a list of the year's highlights. You write it once in a file you own, then turn it into a clean printed page with a small stylesheet or a single Pandoc command. Here's the whole path, from first line to paper.

Quick answer

Write the letter in Markdown, use a backslash at the end of a line wherever you need a line break (address, sign-off), and keep the layout out of the file. Margins and page size belong to the print step: CSS @page if you print from a browser, or Pandoc variables if you make a PDF directly.

The CommonMark spec says Markdown is used to author "books, articles, slide shows, letters, and lecture notes" (CommonMark spec, section 1.1), so a letter is squarely in scope.

Step-by-step: write the letter

Aim for one page. Four short paragraphs, one list, one sign-off. Here's a skeleton you can paste and edit:

## Season's Greetings from the Rivera Family

Dear friends and family,

This was the year we finally repainted the porch, adopted a very
opinionated beagle, and drove the long way to the coast. Here is the
short version.

### The year in four lines

- **March:** Ana started her new job at the library.
- **June:** Mateo graduated from middle school.
- **August:** Two weeks on the coast, one rainstorm, zero regrets.
- **October:** The beagle learned to open the pantry.

We hope your year was kind. Come visit, or write back.

With love,\
The Rivera family\
12 Maple Street\
Springfield

A few choices in that file need a word of explanation.

Hard line breaks for the sign-off and address

In Markdown, lines inside one paragraph run together. For a sign-off or an address you want each line to stay on its own line. CommonMark defines this directly: "A backslash at the end of the line is a hard line break" (CommonMark spec, section 2.4). So foo\ followed by bar renders as two lines.

Use the backslash, not trailing spaces. Two invisible spaces are easy to lose while you edit, and the spec notes that trailing spaces in some places don't cause a hard line break at all. A backslash you can see.

Keep headings and lists plain

An ATX heading needs a space after the # characters, so ## Greetings works and ##Greetings does not. Lists with a dash and a space are understood everywhere. If you share the file somewhere that renders GitHub Flavored Markdown, nothing here changes: GFM is "a strict superset of CommonMark" (GFM spec, section 1.1).

One more thing about the page title. The sample starts at an H2 because many Markdown renderers treat a single H1 as the document title. If your letter is a standalone file, an H1 is fine; use whichever your print route expects.

Print route 1: a browser and a small stylesheet

Markdown has no idea what a page is. Layout for paper comes from CSS paged media, which MDN describes as the properties that control "the presentation of content for print or any other media that splits content into discrete pages" (MDN, CSS paged media).

First turn the letter into an HTML page. If you have Pandoc installed, one command does it:

pandoc letter.md -s --css letter.css -o letter.html

Then write letter.css:

@page {
  size: letter;
  margin: 2cm;
}

body {
  font-family: Georgia, serif;
  font-size: 12pt;
  line-height: 1.5;
  max-width: 36em;
  margin: 0 auto;
}

h2, h3 {
  break-after: avoid;
}

The @page rule is the part that matters for paper. MDN says it "targets and modifies the page's dimensions, orientation, and margins" (MDN, @page), and its own example sets size and margin: 2cm. MDN also warns against viewport-based length units inside @page, so stick to cm, in, or pt there.

Open letter.html in your browser and print or save as PDF. Browser support for the finer points of paged media varies, and MDN labels @page as newly available, so run a preview before you commit to a full print run.

Print route 2: Pandoc straight to PDF

If you would rather skip the HTML step, Pandoc can write the PDF itself:

pandoc letter.md -o letter.pdf

By default, the Pandoc manual says, Pandoc "will use LaTeX to create the PDF, which requires that a LaTeX engine be installed" (Pandoc User's Guide). If you already have LaTeX installed, that's the simplest choice. You can set the margins from the command line with a variable:

pandoc letter.md -V geometry:margin=1in -o letter.pdf

If you do not have LaTeX, the same manual notes that Pandoc can use HTML as an intermediate format, and that "the output can be styled using --css". That lets you reuse the letter.css file from route 1, with a PDF engine that renders HTML. For the wider picture of Pandoc output formats, see our guide to exporting Markdown to PDF and Word with Pandoc. The same approach carries over to other one-page documents, as in this Markdown resume exported to PDF.

One caveat from the manual is worth remembering: Pandoc preserves structural elements of a document, but not formatting details such as margin size. Margins come from your variables or stylesheet, never from the Markdown.

Common problems and fixes

  • The address collapsed into one line. You are missing the backslash at the end of each line. Add it to every line except the last.
  • A heading is stranded at the bottom of the page. In the stylesheet route, break-after: avoid on headings asks the browser to keep them with the next paragraph.
  • The letter spills onto a second page by two lines. Trim a paragraph, or reduce font-size slightly. Fixing the text is usually better than shrinking the type.
  • The PDF step fails with a LaTeX error. Output the intermediate file with -s -o test.tex, as the Pandoc manual suggests for debugging, or switch to the HTML route.

Before you print the whole batch, run one test page on plain paper. If you are mailing the letter, a card address list built from a CSV and a Markdown table keeps the envelopes as tidy as the letter.

Doing this with Carets

Carets is a native notes and code editor for iPhone, iPad, and Mac, and a holiday letter is a good fit. The letter stays a plain .md file, so it is portable and will still open in ten years. You can keep the letter in a "Holidays" project next to the card list and gift list, tag it with letter, and find it again next December without hunting through folders.

Two features help here. Markdown is a first-class format, so headings, lists, and the backslash line breaks are easy to write and read back. And because Carets is built natively for iOS and Mac rather than as a web wrapper, you can draft on your phone and finish on the Mac. Carets edits the file; you still run Pandoc or a browser for the printed page, as described above.

Download Carets for iPhone, iPad, and Mac on the App Store and start this year's letter as a plain text file.

Frequently Asked Questions

Can Markdown set page margins?

No. Markdown describes structure only. Margins and page size belong to the print stage: CSS @page for an HTML route, or Pandoc variables such as geometry for the LaTeX route.

How do I keep an address block on separate lines?

End each line with a backslash. CommonMark defines a backslash at the end of a line as a hard line break, so each line prints on its own line.

Do I need LaTeX to make a PDF with Pandoc?

Pandoc uses LaTeX by default, but it can also use HTML as an intermediate format. In that case you style the result with a CSS file passed through --css.