Skip to content

Instantly share code, notes, and snippets.

@gwpl
Created July 22, 2026 16:25
Show Gist options
  • Select an option

  • Save gwpl/7a4ba5a121db765445e14da9cb141190 to your computer and use it in GitHub Desktop.

Select an option

Save gwpl/7a4ba5a121db765445e14da9cb141190 to your computer and use it in GitHub Desktop.
BLUF-box & section separators in Markdown→PDF — the 'fancy frame' is Unicode box-drawing glyphs, not LaTeX. Zero-preamble recipe.

BLUF-box & section separators — a zero-LaTeX Markdown→PDF recipe

The "fancy frame" around a BLUF (Bottom Line Up Front) is not LaTeX — it's typography. Two # H1 headings whose text is Unicode box-drawing glyphs (┌─ BLUF ─┐ on top, └──────┘ on the bottom), with the boxed paragraph sitting between them. Section separators are plain Markdown ---. Both survive any renderer (GitHub preview, pandoc, xelatex) with zero preamble, zero \usepackage, zero template.


The BLUF box (Unicode, not tcolorbox)

The box is two H1 headings made of box-drawing characters, wrapping a paragraph. Paste this verbatim:

# ┌─ BLUF ─────────────────────────────────────────────────────────────┐

**Bottom line first.** One paragraph: the answer, then "read this, skip the
rest unless you want the reasoning."

# └────────────────────────────────────────────────────────────────────┘

Why it works: pandoc renders each # line as a large heading, so the two glyph-lines print as a bold top and bottom border; the paragraph between them reads as the box interior. No header-includes, no fenced div, no LaTeX filter.

The glyphs (copy these):

corner / edge char Unicode
top-left U+250C
top-right U+2510
bottom-left U+2514
bottom-right U+2518
horizontal U+2500

Section separators

A line of exactly --- on its own line, with a blank line above and below, renders as a horizontal rule:

Some content.

---

## Next section

⚠ If there is no blank line above ---, pandoc reads it as a heading underline (setext H2), not a separator. Always surround --- with blank lines. (The --- pair at the very top of a file is YAML frontmatter, not a separator.)

Rendering to PDF

Any pandoc → xelatex pipeline works. A minimal command:

pandoc yourfile.md -o out.pdf --pdf-engine=xelatex \
  -V geometry:a4paper -V geometry:margin=2cm -V mainfont="DejaVu Sans"

The mainfont matters (see gotcha #2). DejaVu Sans / Noto Sans / most modern fonts contain the box-drawing glyphs. You need no LaTeX preamble for the box or separators.

If you want compact, dense output (good for scannable one-pagers), add -V fontsize=9pt -V documentclass=extarticle and tighten \parskip.

Three gotchas

  1. Keep the top ┌──┐ and bottom └──┘ lines the same visual length so the frame looks square. Count the runs.
  2. The print font must contain the box glyphs. xelatex with DejaVu/Noto works. If a font lacks them, fall back to ASCII: +-----++-----+.
  3. --- needs blank lines above and below — otherwise it becomes a heading underline.

Technique reverse-engineered from a real dossier: the "fancy frame" turned out to be plain Unicode box-drawing characters used as heading text — reproducible anywhere, no LaTeX required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment