Compiling your manuscript
Compile turns the documents in your binder into one finished file: a Word manuscript for submission, a print-ready PDF, an EPUB ebook, a web page, a screenplay and more. Your project files are never changed by compiling.
Compiling works in three steps:
- What is compiled — the compile group (normally the whole Manuscript folder), minus anything excluded.
- How each item looks — every item has a section type (Part, Chapter, Scene, …), and the preset's section layout for that type decides whether the title, text, synopsis or notes are included and how they are styled.
- Which format — the output format (PDF, DOCX, EPUB, …) and the page, typography and metadata settings.
A preset bundles all of these choices. Pick a built-in preset, adjust it,
and save your changes as a project preset (stored in dreamwrite.yaml).
Quick Compile
File › Compile… is Ctrl/⌘+Alt+E (as in Scrivener). File › Quick Compile (Ctrl/⌘+Alt+Shift+E) repeats the last compile of this project
— same preset, options and file — in one step. The first time (or from Quick
Compile For…) it asks what the book is for:
| Choice | Preset | Output |
|---|---|---|
| For an agent | Manuscript (Standard Submission) | DOCX |
| For print | Paperback (trim of your choice) | |
| Ebook | Ebook | EPUB |
| Screenplay | Screenplay |
You check the title, author and contact details, see the pre-compile checks and a preview, and compile. Advanced… opens the full Compile dialog with the same settings.
Checks before compiling
The Compile dialog (and dreamwrite compile <preset> --check) lists what may need
attention, per document — click a document to open it:
- Broken links —
[[Title]]where no document (or alias) has that title, and cross-references to documents that aren't part of this compile. - Empty documents in the compile.
- Tracked changes that will be accepted or rejected, and comments that will be left out, because of the Text options.
- Missing images (and a missing cover). In EPUBs and HTML a missing image is replaced by its caption in brackets, so the file stays valid.
Output formats
| Format | Extension | Notes |
|---|---|---|
.pdf | Typeset with the built-in Typst engine: book typography, running headers, footnotes at the page bottom, table of contents, screenplay layout. | |
| Word document | .docx | Real Word styles (Heading 1–6, Title, Quote, Scene Break, Footnote Text, screenplay styles), footnotes and endnotes, comments, tracked changes, headers with page numbers. |
| OpenDocument | .odt | Same features as DOCX, for LibreOffice. |
| EPUB 3 ebook | .epub | One file per chapter, navigation and NCX, cover image, popup footnotes. |
| Web page | .html | One self-contained file with styles, images and a table of contents. |
| Markdown | .md | Optional YAML front matter; comments and tracked changes can be kept as CriticMarkup. |
| Plain text | .txt | One line per paragraph; scripts are laid out in columns. |
| Rich Text | .rtf | Opens in almost any word processor; footnotes, comments and images included. |
| LaTeX | .tex | book, memoir or article class, for XeLaTeX/LuaLaTeX. |
| Fountain | .fountain | Plain-text screenplay. |
| Final Draft | .fdx | Final Draft XML with scene headings, characters, dialogue and dual dialogue. |
Built-in presets
| Preset | Default format | What it's for |
|---|---|---|
| Manuscript (Standard Submission) | DOCX | Standard manuscript format (the “Shunn” format): 12pt Times, double-spaced, 1″ margins, header “Surname / TITLE / page”, name and word count on the first page, chapters a third of the way down a new page, # scene breaks. |
| Paperback 6×9 | Trade paperback interior: Libertinus Serif 11pt, justified and hyphenated, chapters on right-hand pages with drop caps, running headers (author on the left, title on the right), title, copyright and contents pages. | |
| Paperback 5×8 | Compact mass-market interior with small-caps chapter openings. | |
| Ebook | EPUB | Reflowable book styling, cover, navigation, popup footnotes, cross-references for [[links]]. |
| Web page | HTML | A readable single page with a table of contents. |
| Plain Markdown | Markdown | One Markdown file with front matter; keeps tracked changes as CriticMarkup. |
| Proof copy | DOCX | For read-throughs and editors: scene titles, synopses, document notes, labels/status, comments and tracked changes. |
| Outline | DOCX | Titles and synopses only. |
| Screenplay | Industry layout from Fountain: Courier Prime 12pt, 1.5″ left margin, 55 lines a page, (MORE)/(CONT'D), title page, page numbers top right. | |
| Stage play | Act and scene headings centered, character names centered in capitals, stage directions indented in italics. | |
| Stage play (UK) | A4; character names on the left with speeches beside them, stage directions indented in italics. | |
| Radio drama (BBC) | A4; numbered speeches and SFX/GRAMS/FX cues (restarting each scene), numbered scene headings. | |
| Comic script | Each scene heading is a PAGE, each description a numbered PANEL, balloons numbered per page. | |
| Academic paper | DOCX | 12pt serif, 1.5 spacing, left-aligned headings, footnotes, cross-references. |
| Large print | 17pt type on a 7×10 page, generous leading, ragged right, no hyphenation. |
What gets compiled
- Compile group — the Manuscript folder by default. You can instead choose another folder, a set of selected items (each with everything inside it), or a collection.
- Items with Include in compile turned off (
compile: false) are left out, together with everything inside them. Items in the Trash are never compiled. - Filters keep (or, with invert, remove) items by label, status, keyword or any custom metadata field. When filtering for, say, the Scene label, the chapter and part folders around matching scenes stay, so their titles still appear; with invert, a matching folder is removed with everything inside it.
- Collections compile their items in binder order; a folder in a collection brings its contents along.
- Box sets — compile several books (folders of this project, or other
projects) into one omnibus: each book gets a Book title page above its parts
and chapters, with one title page, contents and set of endnotes for the whole
(
books: [{project, root, title, subtitle}]). - Front matter / back matter — pick a folder (for example Front Matter with a dedication and epigraph) to place before or after the text. Its items get the Front Matter / Back Matter section types.
- Images placed in the manuscript are included as figures.
Section types
Every compiled item has a section type. In order of priority it comes from:
- The item's Section type metadata (
section: Epigraphin front matter). - Section type rules in the preset — e.g. “folders at level 1 are Part”,
“text documents at level 3 are Scene”. A rule can match the level (1 = top
level of the compile group), the kind (
folder,text,script,file) and whether a folder contains sub-folders. - The item's label, if a section layout or project section type has that name (turn off with Use labels as section types).
- The structure: a top-level folder that contains folders is a Part, other folders are Chapters, top-level documents are Chapters, deeper documents are Scenes.
Section layouts
A section layout says how items of one section type are rendered. Each preset has layouts for its section types; a layout named Default is used for types without their own layout.
| Setting | Meaning |
|---|---|
| Title | Include the item's title as a heading. |
| Title format | Template for the heading, with placeholders — e.g. Chapter <$t:chapter> or <$n:chapter>. <$title>. \n starts a new line (Part <$t:part>\n<$title>). Identical consecutive lines are shown once. |
| Title prefix / suffix | Text added before/after the title format. |
| Title case | none, UPPERCASE, lowercase, Title Case, Small Caps. |
| Title alignment | left, center, right. |
| Heading level | 1–6, or automatic (by depth in the binder). |
| Sink | How far down the page the title starts (fraction of the page; 0.33 = a third). |
| Text / Synopsis / Notes / Metadata | Which parts of the item to include. Metadata adds a line with label, status, keywords and word count. |
| Break before | Auto (new page before chapters and parts, scene separator between consecutive untitled scenes), none, new page, new right-hand page, scene separator, or a blank line. |
| First paragraph | normal, no indent, small caps (first words), drop cap, or drop cap + small caps. When a chapter folder has no text of its own, its opening style is applied to the first paragraph of its first scene. |
| In table of contents | List titled sections of this type in the contents. |
| Style | A paragraph style for the whole text, e.g. epigraph or centered. |
Placeholders
Placeholders work in title formats and in your text. Counters count once per
section: <$n:chapter> and <$R:chapter> in the same title show the same number.
| Placeholder | Result |
|---|---|
<$n> / <$n:name> | Next number of the default / named counter: 1, 2, 3 |
<$t> / <$t:name> | As words, title case: One, Two, Twenty-One |
<$w>, <$W> | As words, lower / upper case: one, TWO |
<$r>, <$R> | Roman numerals: i, ii / I, II |
<$l>, <$L> | Letters: a, b / A, B |
<$reset:name> | Restart a counter |
<$title> | The item's title |
<$projecttitle>, <$shorttitle>, <$subtitle> | Book title, short title, subtitle |
<$author>, <$surname>, <$firstname> | Author name |
<$wc>, <$wc100>, <$wc500>, <$wc1000> | Word count of the compiled text, exact or rounded |
<$date>, <$date:%Y-%m-%d>, <$year> | Today (or the metadata date), optionally formatted |
<$label>, <$status>, <$synopsis>, <$keywords> | The item's metadata |
<$custom:key> | Any custom metadata field, e.g. <$custom:pov> |
<$toc> | Insert the table of contents here |
<$np> | Page break |
<$include:Title> | Insert the text of another binder item (by title) |
<$store> | The store of this edition (see Store editions) |
<$page>, <$pages>, <$chapter> | Page number, page count, current chapter title — in headers and footers only |
The Placeholders button next to the title format (and in the header and footer editor) lists all of them with examples; clicking one inserts it.
Text options
- Replacements — find/replace applied while compiling, never to your files.
Plain text or regular expressions (
$1refers to groups), optionally whole words or case-insensitive, for text, titles or both. Project-wide replacements live indreamwrite.yamlundercompile.replacements. - Comments (
{>>…<<},{==text==}{>>comment<<},@Name:authors) — remove; keep as real comments (Word/LibreOffice comments with their authors, margin notes in HTML and PDF); show inline in brackets; or turn into footnotes. - Tracked changes (
{++insert++},{--delete--},{~~old~>new~~}) — accept all, reject all, or keep. Kept changes become real tracked changes in Word (w:ins/w:del) and LibreOffice,<ins>/<del>in HTML, and CriticMarkup in Markdown. Other formats accept them (you'll get a warning). Each change keeps its author from the comment written after it ({++new++}{>>@Ann<<}, see FORMAT.md); a comment on a change is anchored on it in Word, and replies become Word comment threads. - Highlights (
{==text==}) — keep as highlighted text or remove the highlight. - Round trip — DOCX files mark each document's text with a hidden bookmark, so File › Import › Import Edited Word File as Suggestions… can bring an editor's copy back as suggestions on the original documents.
- Author comments (
%% … %%) are always removed. - Footnotes (
^[inline]and[^label]) — footnotes at the page bottom (popup notes in ebooks), endnotes at the end, or removed. - Links (
[[Title]]) — plain text, or cross-references to the compiled section (clickable in PDF, DOCX, EPUB and HTML). - Smart typography — curly quotes for the project language,
--/---to em dashes,...to an ellipsis. - Scene separator — text for scene breaks (
***lines and scene-to-scene breaks):#,* * *,❧, or empty for a blank line. - Italics as underline — the traditional manuscript convention (on in the Manuscript preset): emphasis is printed underlined in every format.
- Styles from your text:
[text]{.smallcaps},[text]{.underline},[text]{.name}and::: nameblocks (epigraph,centered,poem, or any name). DOCX and ODT get a style with exactly that name (character styles in Word are shown as “name Char” when a paragraph style has the same name). - Named styles — a preset can define how each style looks (
styles:): font, relative size, bold, italic, small caps, capitals, underline, colour, alignment, left/right indent, space above/below, no first-line indent and extra CSS. The definition applies in PDF, DOCX, ODT, EPUB, HTML and the preview, and overrides the built-in look ofepigraph,centeredandpoem. The Text tab lists the styles used in the manuscript. - Custom CSS — extra CSS for EPUB, HTML and the preview (Text tab).
- Store editions — set Store edition (
retailer: kobo) to build the copy for one store:::: only-koboblocks appear only in the Kobo edition (::: only-apple-koboin either),::: except-amazon(ornot-amazon) in every edition but Amazon's, and<$store>gives the store's name. Store ids:amazon,apple,kobo,google,bn,d2d,smashwords.
Citations
Write citations in Pandoc syntax and Dreamwrite formats them in any CSL style when compiling:
| You write | APA gives |
|---|---|
[@doe2020] | (Doe, 2020) |
[@doe2020, p. 12] | (Doe, 2020, p. 12) |
[see @doe2020, pp. 3-4; also @smith1999] | (see Doe, 2020, pp. 3–4; also Smith, 1999) |
[-@doe2020] | (2020) — the author is already in your sentence |
@doe2020 says… / @doe2020 [p. 4] says… | Doe (2020) says… / Doe (2020, p. 4) says… |
Locators understand the usual abbreviations (p., pp., chap., sec., §, vol.,
fig., n., l., para., …); a bare number is a page. In the editor, type [@ to pick
a reference (search by author, title, year or key), hover a citation to see the formatted
reference, or use Insert Citation… (Ctrl/Cmd+Shift+Y).
The bibliography is declared in dreamwrite.yaml (see docs/FORMAT.md):
citations:
bibliography: references.bib # or a list: [references.bib, extra.json]
style: apa # or chicago-author-date, chicago-notes, mla, ieee, harvard-cite-them-right, …, or a .csl file
locale: en-US # optional; defaults to the project language
- BibTeX/BibLaTeX (
.bib), CSL-JSON (.json) and Hayagriva (.yaml) files are read. Without acitationskey,.bibfiles in the project folder are used. - Zotero: with the Better BibTeX add-on, Export Collection… → Better BibTeX (or Better
CSL JSON) → Keep updated and point
bibliographyat the exported file — it may live anywhere (~/Zotero/thesis.json). Dreamwrite re-reads it only when it changes. Withzotero: true, the citation picker also searches your running Zotero library. - About 80 styles are built in; any other style from the
CSL repository can be used by
downloading its
.cslfile into the project and settingstyle: styles/name.csl.
When compiling, citations are rendered in document order (so numbered styles count 1, 2,
3… and note styles write "Ibid." where appropriate). Note styles such as Chicago (notes)
turn each citation into a footnote, placed after the punctuation. A bibliography of the
cited works is added after the last chapter, titled References, Bibliography or Works
Cited depending on the style, with a hanging indent (the Bibliography paragraph style in
Word/LibreOffice). To place it yourself, put ::: {#refs} + ::: or <$bibliography> in a
document. Unknown keys are left as written and listed in the compile warnings.
The Compile dialog's citation options (options.citations):
| Option | Meaning |
|---|---|
enabled | Format citations (default on when the project has a bibliography). |
style, locale | Override the project's style and language. |
includeBibliography, bibliographyTitle | Add the bibliography; its heading (empty = by style). |
linkCitations | Link author–date and numeric citations to their bibliography entries (HTML, EPUB, PDF, DOCX). |
keepMarkdown | Markdown output keeps [@key] and {#fig:x} unchanged, for processing with Pandoc. |
nocite | Keys to list in the bibliography without citing them (* = all). |
Cross-references
Label figures, tables, equations and sections, then refer to them (pandoc-crossref syntax):
{#fig:orchard}
| Year | Trees |
|------|-------|
| 1911 | 240 |
: Trees planted {#tbl:trees}
# Method {#sec:method}
$$ y = mx + b $$ {#eq:line}
@fig:orchard shows the rows; see [@tbl:trees] and [@fig:orchard; @fig:gate] in @sec:method.
Figures and tables are numbered in order and captioned "Figure 1: …" / "Table 1: …";
references become links: @fig:orchard → "figure 1" ("Figure 1" at the start of a
sentence, or always with @Fig:orchard), [-@fig:orchard] → "1", several labels →
"figures 1 and 2". Sections are numbered by heading level (1, 1.2, …) and equations get
"(1)" at the end of the line.
Page and typography (PDF, DOCX, ODT, RTF, LaTeX, preview)
Trim size (5×8, 5.25×8, 5.5×8.5, 6×9, A5, Letter, A4 or a custom width and height), margins (inside/outside for books) plus a gutter (extra inside margin for the binding), font, size, line spacing (1 = single, 2 = double), justification, hyphenation, first-line indent, paragraph spacing, chapters on right-hand pages, running headers, page numbers and widow/orphan control.
Headers and footers — turn on Custom headers and footers to replace the
preset's running heads with your own left / centre / right text, optionally
different on left- and right-hand pages, e.g. <$page> · <$SHORTTITLE> on the
left and <$chapter> · <$page> on the right. Any placeholder works, plus
<$page>, <$pages> and <$chapter> (the current chapter or part title); a name
in capitals gives capitals. Headers are left off title pages and, unless you turn
it off, pages where a chapter starts. PDF, DOCX (with PAGE, NUMPAGES and
STYLEREF fields) and ODT use them.
Different first content page supplies independent first-page text once, on the first authored front-matter or manuscript page after generated title, copyright and contents pages. Those generated pages stay blank. First-page text takes priority over chapter-opening suppression; empty first-page fields leave that page blank. Later chapter openings retain their usual suppression and odd/even heads. Page numbering does not change. This option applies to prose PDF, DOCX and ODT; script PDF uses its fixed script layout, and the HTML preview does not show running headers or footers. The option is off by default.
Printing — in the desktop app, the printer button opens the system print dialog using vector images of the exact PDF-layout pages, including script pagination, running headers and auto-gutter. It waits for pending edits to save and for all pages to load. The print document remains alive until the dialog finishes. Printer settings can scale pages or add their own headers and footers; check the dialog's settings. Open PDF in viewer remains an explicit fallback for a PDF viewer's printing tools. In a browser, the button prints the current HTML preview. Native dialog/cancel qualification is tracked separately from output and browser tests.
PDFs use fonts installed on your computer plus the built-in Libertinus Serif, Courier Prime, New Computer Modern and DejaVu Sans Mono. If a font isn't found, the next one in a sensible fallback list is used (e.g. Times New Roman → Liberation Serif → TeX Gyre Termes → Libertinus Serif). In PDFs, drop caps are set as a raised initial.
Metadata
Title, subtitle, author, surname and short title (for headers), language,
publisher, ISBN, identifier, description, copyright line, date, contact block
(manuscript and screenplay title pages), keywords (EPUB subjects), a series
name and number (EPUB belongs-to-collection with group-position, plus the
Calibre series entries) and a cover image (a binder item or a file path). Empty
fields fall back to the project settings (series/seriesIndex in
dreamwrite.yaml too).
After compiling
- Open when finished (Output tab) opens the file in its app.
- Run command — a command run on the compiled file, e.g.
epubcheck {file}orkindlegen {file}({file},{dir},{name},{format},{project}are replaced by quoted values; the file path is appended when none is given). Because a preset can arrive with a shared project, Dreamwrite asks before a command runs for the first time and remembers your answer per project (outside the project folder). Its output is shown; a failure is reported as a warning. - Copy as rich text (preview toolbar, or File › Copy as Rich Text) puts the selected documents (or the manuscript) on the clipboard as formatted HTML for Substack, WordPress, Ghost or email.
Pandoc
When Pandoc is installed, the Pandoc output format
converts the compiled Markdown with it — to any format Pandoc writes. Settings
(Output tab, pandoc:): to (e.g. docx, html5, latex, rst, asciidoc,
jats, typst), template, referenceDoc (paths relative to the project),
args (extra command-line arguments) and extension (the output file's
extension, normally derived from to). Images are passed with their full paths;
Pandoc's messages appear as compile notes.
Sharing presets
Export a preset to a .dwpreset.yaml file (the export button in the preset list,
or compile.exportPreset) and import it into another project. The file stores
only what differs from the built-in preset it is based on:
# Dreamwrite compile preset
format: 1
kind: dreamwrite-compile-preset
preset:
name: My submission
base: manuscript
format: docx
options:
sceneSeparator: '* * *'
Scripts
.fountain documents are parsed as Fountain: title page,
scene headings (with #numbers#), action, characters and extensions, dialogue,
parentheticals, dual dialogue (^), transitions, centered text, lyrics, page
breaks, notes ([[ ]], kept only when comments are kept), boneyard (/* */),
sections and synopses (included when the layout includes synopses). Scripts
compile to screenplay-formatted PDF, DOCX, ODT and RTF, as well as Fountain and
Final Draft. Prose documents in a script compile as action.
Screenplay PDFs use the bundled Courier Prime and the same page model as the script
editor's page breaks, Script Report and statistics, so page counts always agree:
Courier 12pt (10 characters per inch, 6 lines per inch), action and scene headings at
1.5″, dialogue at 2.5″, parentheticals at 3.1″, character cues at 3.7″, transitions
right-aligned, 55 lines per page. Scene headings stay with the first lines after them,
a cue stays with two lines of its speech, and a speech that breaks across pages gets
(MORE) and NAME (CONT'D).
Script options (options.script):
| Option | Values |
|---|---|
format | auto (from the style), screenplay, stagePlay, ukStage, radio, comic |
sceneNumbers | off, keep (numbers written as #12A#), auto (number every scene, keeping written ones) |
moreContd, moreText, contdText | (MORE)/(CONT'D) at page breaks and their text |
contdAfterAction | NAME (CONT'D) when a character speaks again after action (not in FDX, where Final Draft adds it) |
boldSceneHeadings | bold scene headings |
revisionMarks, revisionMark, revisionHeader, revisionColorPages | production revisions: asterisks on lines changed since the locked revision, the revision name and date in the header, tinted pages (see revisions in docs/FORMAT.md) |
FDX export writes [[notes]] as ScriptNotes, lyrics as Lyrics and the whole title page;
folder and section titles are structure and are not written as scenes. FDX import maps
them back.
Book design and themes
A theme is a complete interior design for books (the book and web styles): the typefaces, chapter and part openings, ornaments, drop caps, the opening words in small caps, scene breaks, running heads and page numbers, block quotes and epigraphs, the title page, and colours for ebooks. Themes work in every format: PDF (the full design), EPUB and HTML (fonts, headings, ornaments and colours in CSS), and Word/LibreOffice (fonts, sizes and heading styles). Manuscripts, scripts and academic papers ignore themes.
Pick one on the Design tab of the Compile dialog. The built-in themes use fonts that ship with Dreamwrite (SIL Open Font License), so PDFs look the same on every computer:
| Theme | Typefaces | Look |
|---|---|---|
| Classic | EB Garamond | “Chapter One” in letterspaced small caps over the title, a fleuron ❦, two-line drop cap with small caps, ❧ scene breaks. |
| Modern | Source Serif 4 + Inter | Big light numerals, flush left under a short rule, sans-serif running heads with the page number outside, a rule for scene breaks. |
| Romance | Crimson Pro + Pinyon Script | Script chapter titles under a spaced italic label, a drawn flourish, script drop cap, a small heart for scene breaks, wine-red accents in ebooks. |
| Thriller | Source Serif 4 + Oswald | Huge bold numerals, a heavy full-width rule, condensed capitals, page numbers outside. |
| Literary | Spectral | A spaced small-caps number and italic title, deep sink, small-caps openings, chapter titles in the running heads. |
| Fantasy | Alegreya + Cinzel + Cinzel Decorative | Inscriptional capitals, “Chapter One” over ornamented rules, a three-line decorative initial, a vine drawing on part pages. |
| Nonfiction | Source Serif 4 + Inter | “Chapter 1” labels, strong sans headings with a rule, ruled running heads with chapter titles. |
The Paperback 6×9 and Ebook presets use Classic, Paperback 5×8 uses Literary and Large print uses Modern; the others have no theme. A theme controls the chapter/part title format, alignment, sink and opening paragraph of the Chapter and Part section layouts, and the scene separator; a font chosen on the Page tab still wins over the theme's text font (choosing a theme clears it).
Customize opens the theme builder: change the fonts, the chapter number
(“Chapter One”, “Chapter 1”, “One”, “1”, “I”, “— 1 —”), the number and title
case and size, alignment and sink, the ornament (a glyph, rules, a glyph
between rules or a drawing) and where it sits, the initial (raised or drop
cap, 2–4 lines), small-caps openings, the scene break and the accent colour.
Your changes are stored with the compile settings (themeOverrides); Save
as Theme… keeps them as a project theme in dreamwrite.yaml
(compile.themes, stored as differences from the built-in theme it is based
on). Export… writes a theme file you can share, Import… reads one:
format: 1
theme:
name: Winter Garamond
base: classic
chapter: { number: roman, ornament: { kind: glyph, glyph: "✦" } }
colors: { accent: "#224466" }
Embed fonts puts the theme's fonts into EPUBs (as font/ttf resources)
and standalone web pages. Most stores accept embedded fonts; readers can still
choose their own. The live preview always uses the theme's fonts.
Ebook preview
The preview can show the print page, or reflow the book like an ebook inside a Kindle Paperwhite, Kobo Libra, iPhone, iPad or desktop browser frame, with white, sepia and dark reading modes and a text-size control.
Print-ready PDFs
- Trim sizes — all Amazon KDP paperback trims (5×8 to 8.5×11, including
5.06×7.81, 6.14×9.21, 6.69×9.61, 7.44×9.69, 7.5×9.25, 8.25×6, 8.25×8.25,
8.5×8.5 and A4) and IngramSpark's extra sizes (mass market 4.25×6.87, 4.37×7,
4.72×7.48, 5.5×8.25, A5, 6.63×10.25, 8.25×11). Any
WxHsize in inches works as a trim id. - Gutter by page count (
page.autoGutter) — the PDF is laid out, the pages are counted and the inside margin is set from KDP's table (24–150 pages 0.375″, 151–300 0.5″, 301–500 0.625″, 501–700 0.75″, 701–828 0.875″), then laid out again if it changed. - Page limits — a warning when the page count is outside what KDP (24–828, or 590 for large trims) or IngramSpark (18–1,200) prints at that trim.
- Fonts are always embedded (subset). PDF/A (
page.pdfStandard:a-2b,a-2u,a-3bora-4) adds the archival metadata some printers and libraries ask for; compiling fails with a message if a font can't be embedded. (PDF/X is not available in the PDF engine; KDP and IngramSpark accept PDF/A and plain PDFs with embedded fonts.)
| Command | Arguments | Returns |
|---|---|---|
compile.themes | — | [Theme + {families, sample}] — built-ins then project themes; sample is an HTML page of a chapter opening |
compile.themeThumbnail | id or theme (a partial theme with base) | {kind: "svg" | "html", pages: [title page, chapter opening, next page]} |
compile.themeFonts | — | [{family, faces[], bundled}] |
compile.saveTheme | theme: {id?, name, base?, …} | {theme, themes} |
compile.deleteTheme | id | {themes} |
compile.exportTheme | id, path (file or directory) | {path} |
compile.importTheme | path | {theme, themes} |
compile.trims | — | [{id, name, group: KDP | IngramSpark | Standard, width, height}] |
Options: theme (id), themeOverrides (partial theme), page.autoGutter,
page.pdfStandard.
Project presets in dreamwrite.yaml
Saved presets store only what differs from the built-in preset they're based on:
compile:
replacements:
- { find: Tomas, replace: Tomás }
presets:
- id: custom-01j9zk…
name: My submission
base: manuscript
format: docx
options:
sceneSeparator: "* * *"
metadata: { contact: "12 Orchard Lane\nVell" }
layouts:
Chapter: { titleFormat: "Chapter <$n:chapter>" }
For developers: commands
All commands take project (the project key).
| Command | Arguments | Returns |
|---|---|---|
compile.formats | — | [{id, name, extension, mime, binary, trackChanges, comments, script, available}] |
compile.presets | — | [Preset] — built-ins (builtin: true) then project presets |
compile.run | preset?, options?, format?, output, approvePostProcess? | {path, format, bytes, words, warnings, issues, postProcess?} |
compile.preview | preset?, options? | {html, words, warnings, issues} — a full HTML page styled like the target |
compile.check | preset?, options?, format? | {issues: [{severity, kind, message, id, title}], words} |
compile.placeholders | — | [{token, description, example, where}] |
compile.styleNames | preset?, options? | [{name, kind (paragraph|character|unused), count, defined}] |
compile.exportPreset | id, path (file or folder) | {path} |
compile.importPreset | path | {preset, presets} |
compile.postProcess | preset?, options?, path, format?, approve? | {command, ran, output} |
compile.richText | ids?, options? | {html, text, words} |
compile.printFile | preset?, options? | {path} — a PDF in the temp folder |
compile.structure | preset?, options? | [{id, title, depth, kind, sectionType, explicit, part}] |
compile.savePreset | preset: {id?, name, description?, format?, base?, options} | {preset, presets} |
compile.deletePreset | id | {presets} |
script.paginate | id or text, preset?, options? | {pages, linesPerPage, breaks: [{page, line, col}], scenes: [{page, eighths}], titlePage} (line 0-based, col UTF-16) |
script.numberScenes | id? (script or folder; default Manuscript), lock? | {scenes, numbers, changed: [{id, body}]} — writes #n#; with lock, keeps numbers and gives new scenes A/B numbers |
script.report | id? | {pages, scenes[], characters[], cast[], locations[], totals} |
script.lockRevision | name?, next? | revision status (below) |
script.revisionStatus | id? | {current, color, sets, locked[], active, changed: [{id, title, lines, count}]} |
cite.search | q, limit? | [{key, title, author, year, type, container, source?}] — source: "zotero" for live Zotero hits |
cite.get | key, style? | {key, found, type, title, authors[], author, year, container, publisher, doi, url, file, style, reference, referenceHtml, citation, citationHtml} |
cite.library | — | {configured, files[{path, exists, count, error, errors}], count, errors, style, locale, zotero, styles[{id, name, kind, common}]} |
options is merged over the chosen preset's options (objects merge key by key),
so the UI can send only what the user changed. format defaults to the output
file's extension, then the preset's format. output may be a directory (the
file is named after the book title) and is resolved relative to the project.
A Preset is {id, name, description, format, base?, builtin, options};
options (CompileOptions) has these keys (all optional):
Folder selectors resolve an ID first, then an exact project-relative or absolute path under the project root, then the existing display-title lookup. Use a path to distinguish folders with the same title. Display titles containing slashes or backslashes remain supported when no path matches.
style book | manuscript | screenplay | stagePlay | academic | web | plain
script {format, sceneNumbers, moreContd, contdAfterAction, moreText, contdText,
boldSceneHeadings, revisionMarks, revisionMark, revisionHeader, revisionColorPages}
root, ids[], collection, filter {labels[], statuses[], keywords[], metadata{}, invert}
frontMatter, backMatter folder id, path, or title (id/path first)
sectionTypeDefaults[] {level?, kind?, hasSubfolders?, sectionType}
sectionFromLabel bool
layouts { <type>: SectionLayout } SectionLayout = {title, titleFormat, titlePrefix, titleSuffix,
titleCase (none|upper|lower|title|smallCaps), titleAlign (left|center|right),
headingLevel, sink, text, synopsis, notes, meta,
breakBefore (auto|none|page|recto|scene|blank),
firstParagraph (normal|noIndent|smallCaps|dropCap|dropCapSmallCaps),
toc, style}
sceneSeparator, titlePage, copyrightPage, toc, tocTitle, tocDepth
replacements[] {find, replace, regex, caseSensitive, wholeWord, enabled, scope (all|text|titles)}
projectReplacements bool
comments remove | comments | inline | footnotes
highlights bool
footnotes footnotes | endnotes | remove
critic accept | reject | track
links text | crossRef
citations {enabled, style, locale, includeBibliography, bibliographyTitle, linkCitations, keepMarkdown, nocite[]}
typography {quotes, dashes, ellipses, underlineItalics}
metadata {title, subtitle, author, surname, shortTitle, language, publisher, isbn, identifier,
description, cover, copyright, date, contact, keywords[], series, seriesIndex}
page {trim, width, height, marginTop, marginBottom, marginInside, marginOutside, gutter,
font, fontSize, lineSpacing, justify, hyphenate, indent, paragraphSpacing,
chapterRecto, runningHeaders, pageNumbers, widowOrphan,
headerFooter {enabled, header, headerEven, footer, footerEven, evenOdd,
hideOnChapterPages}} each line = {left, center, right}
styles { <name>: {font, size, bold, italic, smallCaps, uppercase, underline, color, align,
indentLeft, indentRight, spaceBefore, spaceAfter, noIndent, css} }
books[] {project, root, title, subtitle} box set
retailer amazon | apple | kobo | google | bn | d2d | smashwords | …
postProcess command run on the compiled file (needs approval)
pandoc {to, template, referenceDoc, args[], extension}
markdownFrontMatter, css, latexClass (book|memoir|article)
Command line
dreamwrite compile --list # presets and formats
dreamwrite compile manuscript # by id …
dreamwrite compile "Paperback 6x9" -o book.pdf # … or by name (case-insensitive)
dreamwrite compile ebook --format html # a preset in another format
dreamwrite compile epub --set toc=true --set metadata.series="The Orchard Cycle"
dreamwrite compile ebook --check # only the pre-compile checks
Without -o the file is written to the current folder, named after the book.
Output piped into another program (dreamwrite outline | head) stops quietly
when the reader closes the pipe.