# Print & PDF

A separate print layout, not a squeezed screen layout.

Source: https://bugstars-docs.pages.dev/print-and-pdf/

---

Readers who print a runbook get something usable at a desk.

## What changes on paper

| Element | Print behavior |
| --- | --- |
| `chrome` | Header, sidebar, on-this-page, feedback and pager are dropped; content takes the full page width |
| `color` | Forced to plain black on white — code blocks invert to save toner |
| `links` | External URLs are printed after the link text, so a paper copy stays followable |
| `breaks` | Headings never end a page; code blocks and tables never split mid-row |
| `details` | Collapsible sections print expanded — paper has no disclosure triangle |
| `diagrams` | Print their source, since Mermaid renders in the browser |

## Print this page

<PrintButton text="Open print preview"/>

Nothing is generated on a server — it is the same HTML with a print stylesheet at `src/styles/base/_print.css`. Your browser's own shortcut (⌘P, or Ctrl+P on Windows) does exactly the same thing, which is why the button hides itself when JavaScript is off rather than sitting there dead.

## Page setup

<CodeBlock language="css" filename="src/styles/base/_print.css" showCopy={true}>

```
@page {
  margin: 18mm 16mm 20mm;
  size: A4;
}

@media print {
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; }
  :is(h1, h2, h3) { break-after: avoid; }
  pre, table, figure { break-inside: avoid; }
  details::details-content { content-visibility: visible; }
}
```

</CodeBlock>

<Alert variant="note" title="Runbooks are printed more than you think" text="On-call engineers print incident procedures. If a page is meant to be followed under pressure, print it once and read it on paper before you publish."/>
