# Dark theme PDF from Markdown

One switch restyles everything for dark, including math, diagrams and barcodes, not only the page and text colors.

The whole document restyled for dark: page, text, tables, code, math, diagrams, barcodes and SVG icons. Feature: "theme": "dark".

- PDF: https://legivel.com/examples/documents/dark-theme.pdf
- Page: https://legivel.com/examples/documents/dark-theme
- Open in the editor: https://legivel.com/markdown-to-pdf?sample=dark-theme
- More whole documents from Markdown to PDF: https://legivel.com/examples/documents

## Markdown source

````markdown
# Dark theme

Everything follows the theme: page background, body and heading text, tables, quotes, rules, code palettes, diagram colors, math glyphs and the icons drawn from bare path data.

| Element | Themed |
|:--------|:------:|
| tables | yes |
| code | yes |
| math | yes |
| diagrams | yes |

```python
# the dark code palette
def area(r: float) -> float:
    return 3.14159 * r ** 2
```

Math takes the text color: $\displaystyle \int_0^{\infty} e^{-x^2}\,\mathrm{d}x = \frac{\sqrt{\pi}}{2}$

```svg
M12 2 L2 22 H22 Z
```

```mermaid
flowchart LR
  a[Draft] --> b{Review} -->|approved| c([Published])
  b -->|changes| a
```

```barcode
type: qr
data: https://example.com/dark
module-color: #e2e8f0
background: #0f172a
width: 140
```

> Quotes and alerts adapt as well.

> [!TIP]
> Set `"theme": "dark"` in the request, or flip the switch in the editor.
````
