Snippet Export To Pdf

An Obsidian CSS Snippet in order to enhance document structure and style for export to PDF

CSSAny theme
# Features
- Type scale system based on [vertical rythm best practices](https://www.teotimepacreau.fr/blog/rythme-vertical-css/) on a Minor Third modulo for h1 to h5
- Classic serif style for work-compatible documents
- Typography best practices : lowercase numbers, `all-small-caps` for caps titles, `tabular-nums` for tables...
- Automatic pagination
- Blockquotes

# Obsidian & the hidden customization of CSS snippets in order to control PDF export formatting

Obsidian is amazing, not documenting [hidden CSS customization is not](https://forum.obsidian.md/t/pdf-export-font-style-always-glitches/55008/26) [@kepano](https://www.github.com/kepano)

In order to control the font of the exported PDF you have to tweak [two CSS vars](https://forum.obsidian.md/t/pdf-export-font-style-always-glitches/55008/26) `--font-print` and `--font-text` and [use the precise name of the font as it appears installed in your OS](https://forum.obsidian.md/t/pdf-export-font-style-always-glitches/55008/32) (cc [@OzAmoyal](https://github.com/OzAmoyal) for pointing this); for example "EB Garamond" won't work, it has to be the name under the font directory of the font as it is registered by your OS. Why ? It's not explained in the Obsidian docs.

All CSS rules must have `!important` to take effect. It's mandatory in order to override the native Obsidian CSS that applies when exporting to PDF

How to Install

  1. Download the CSS file below
  2. Move it to your vault's .obsidian/snippets/ folder
  3. Open Obsidian → Settings → Appearance → CSS Snippets → Enable it
Download snippet.css

Stats

Stars

0

Forks

0

Last updated 4mo ago

Tags

obsidian