# Quarkdown: One Source, Four Documents — Types, Themes & Page Setup

> Part 3 of the Quarkdown series: how .doctype turns the same source into a web page, paper, book or presentation — plus themes, metadata and page format.

Source: https://www.jpkc.com/db/en/blog/quarkdown-dokumenttypen-themes/

[Part 2](https://www.jpkc.com/db/en/blog/quarkdown-funktionen-skripting/) was about the logic under the hood. Now we look at the visible result — and at Quarkdown's biggest promise: **one source, multiple outputs**. A single line decides whether your `.qd` document becomes a flowing web page, a paginated paper, a presentation or a searchable wiki. On top of that come themes, metadata and the page format — the dials that give a document its character.

## The four document types

You set the type with `.doctype {…}` right at the top. Each type brings its own behavior:

- **`plain`** (default) — a linear flow without page breaks, a responsive layout in the style of Notion or Obsidian. Ideal for websites and knowledge management. Footnotes appear as sidenotes to the right of their reference; PDF export produces a single continuous page.
- **`paged`** — a classic layout with pages. Breaks occur [explicitly](https://quarkdown.com/wiki/page-break) or automatically when content overflows. Footnotes sit at the bottom of the page. This is the type for articles, academic papers and books.
- **`slides`** — a presentation, one slide per screen, horizontally centered. Slide breaks only happen explicitly. On PDF export each slide — and each [fragment](https://quarkdown.com/wiki/slides-fragment) state — becomes its own page.
- **`docs`** — a navigation-first layout with sidebars, a header with a search bar and footer navigation. Uses [subdocuments](https://quarkdown.com/wiki/subdocuments) and a client-side full-text search. The official Quarkdown wiki is itself a `docs` document.

The same content, four completely different artifacts — without touching the text. This is exactly what sets Quarkdown apart from tools that each master only one output format.

## Metadata

By convention, metadata sits at the very top. It follows a "modify-or-echo" principle: with an argument it sets the value, without one it returns it (handy in running text).

```markdown
.docname {My Document}
.doctype {paged}
.doclang {English}

.docauthors
    - Jean Pierre Kolb
        - email: jpk@example.com
```

`.doclang` is more than cosmetics: it determines the target locale for localization, locale-specific fonts and the HTML `lang` attribute — relevant for hyphenation and accessibility. `.dockeywords`, in turn, feeds into SEO metadata on HTML export. For a single author, the shorthand `.docauthor {Name}` is enough.

## Themes: color is separate from layout

A theme defines the look and feel — and Quarkdown cleanly separates the **color** theme from the **layout** theme. You combine the two freely:

```markdown
.theme {paperwhite} layout:{latex}
```

| Color themes | Layout themes |
| --- | --- |
| `paperwhite` (default) | `latex` (default) |
| `darko` | `hyperlegible` |
| `galactic` | `minimal` |
| `beaver` | `beamer` |

Proven combinations: `paperwhite+latex` (an academic LaTeX look, strong for `paged`), `galactic+hyperlegible` (the wiki's theme, with a highly readable font), `darko+minimal` (dark and reduced) and `beaver+beamer` (a Beamer style for presentations). Because color and structure are decoupled, four by four already gives sixteen starting points — custom fonts you set up additionally via `.font`.

## The page format

`.pageformat` controls the geometry of the page. All parameters are optional; multiple calls stack, with later ones overriding earlier ones.

```markdown
.pageformat {A4} margin:{2cm}
```

You can pick a named size (`A0`–`A10`, `B0`–`B5`, `letter`, `legal`, `ledger`) or specify `width`/`height` exactly, flip the orientation (`portrait`/`landscape`), set a background or border, and enable a [multi-column layout](https://quarkdown.com/wiki/multi-column-layout) with `columns`. Particularly elegant is **scoped formatting** in `paged` documents: mirrored margins for books or special formats for the first few pages.

```markdown
.pageformat size:{A4}
.pageformat side:{left}  margin:{2cm 3cm 2cm 1cm}
.pageformat side:{right} margin:{2cm 1cm 2cm 3cm}
```

That gives left (verso) and right (recto) pages different inner and outer margins — classic book typesetting, in four lines.

## FAQ

### Can I switch the document type afterwards?

Yes — that's the whole point. You only change the `.doctype` line and recompile. Content that is type-dependent (such as page breaks or sidenotes) then behaves appropriately for the new type automatically.

### Which type suits a blog or website?

`plain` for individual pages in a flowing-text style, `docs` for an entire knowledge base with navigation and search. Both export as static HTML and can be deployed directly — I cover the path there in a later part.

### Do I need a specific type for a PDF?

No. Each of the four types can be exported as PDF; the result matches the respective HTML layout. A `paged` document becomes a multi-page PDF, a `plain` document a single long page, a presentation one slide per page.

## Further reading

Back to the logic in [part 2: Functions, Variables, Scripting](https://www.jpkc.com/db/en/blog/quarkdown-funktionen-skripting/); the introduction is in [part 1](https://www.jpkc.com/db/en/blog/quarkdown-einstieg/). Next I take apart the **layout** — stacks, containers, boxes, grids and float, the building blocks you use to arrange content on the page. Details on every function mentioned here are in the [official wiki](https://quarkdown.com/wiki).

