Book to PDF
book_to_pdfConverts several Markdown files into a single PDF, starting each file on a new page and preserving links, outline, and optional table of contents.
Instructions
Makes one PDF of several Markdown files: each from a new page, links between them kept, one outline (and with toc one table of contents). The files a SUMMARY.md lists or a folder holds must lie in that folder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toc | No | One table of contents for the whole book | |
| pdfa | No | PDF/A-3b: every font embedded | |
| pdfua | No | PDF/UA-1, tagged for screen readers (formulas as TeX source) | |
| style | No | Look of the document (default elegant) | |
| inputs | Yes | One SUMMARY.md (mdBook, GitBook), one folder (its SUMMARY.md, or its .md files by name, README.md first), or Markdown files in order | |
| margin | No | compact, normal (default), wide, or margin=N in inches or margin=Npt: margin=0.75in, margin=54pt | |
| output | Yes | The PDF to write, ending in .pdf; an existing file is replaced | |
| dialect | No | github (default), or obsidian: callouts, ==highlights==, %%comments%%, [[wiki links]], ![[embeds]] | |
| diagrams | No | Draw ```mermaid flowcharts, sequence diagrams and pie charts (default true) | |
| footnotes | No | end (default): after the text; page: at the foot of the page of the first reference | |
| page_size | No | a4 (default), a3, a5, letter or legal, each also with -landscape; WIDTHxHEIGHT in mm, cm, in or pt (210x297mm); or WIDTHxauto (210mmxauto: one long page) | |
| toc_depth | No | Heading levels the table of contents lists (default 3) | |
| black_text | No | For black-and-white printers: text, links and code black, fills light grey | |
| page_numbers | No | "N / M" at the foot of every page | |
| highlight_code | No | Colour fenced code by language (default true) | |
| number_headings | No | Number the headings of this many levels: 1, 1.1, 1.1.1 | |
| page_break_before | No | A new page before each heading of level 1 to N (h1: chapters) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ms | Yes | ||
| code | Yes | ||
| bytes | Yes | ||
| pages | Yes | ||
| inputs | Yes | ||
| output | Yes | ||
| status | Yes | ||
| missing_characters | Yes |