A thesis to a print-ready PDF
Turn one .wit file into a print-ready PDF essay — title, byline,
epigraph, sections, a data table, a captioned figure and a Works Cited list.
Steps 1–7 use only core vocabulary; step 8 splits the essay into chapter files.
Step 1 — Title and byline
Give the paper an h1 title, then a byline whose lines end in the
void br node so they stack inside one paragraph.
(h1 Let Them Sleep: The Case for Later School Start Times h1) Jordan Ellis@br Ms. Rivera — English 11@br 5 July 2026
Let Them Sleep: The Case for Later School Start Times
Jordan Ellis
Ms. Rivera — English 11
5 July 2026
The three lines become one <p>Jordan Ellis<br> Ms. Rivera …</p> — consecutive non-blank
lines are one paragraph, and @br glued to the word forces the
visible break. It is void, so it never takes a close.
Step 2 — Epigraph
A blockquote holds the quotation and its attribution.
(blockquote "Sleep is the golden chain that ties health and our bodies together." — Thomas Dekker blockquote)
Step 3 — Thesis and sections
Body text is prose — no indentation, a blank line between paragraphs. Open each
section with an h2 and mark emphasis with _italics_, *bold* or the em node.
(h2 The Teenage Clock Runs Late h2) The heart of the problem is not attitude but chemistry — teenagers lose an hour or more of the rest their developing brain requires (em every single night em).
Step 4 — A data table
Pass the rows inline, one row per line. The first row is the header and becomes th cells; every later row is a tr of td.
@table(caption: Recommended versus actual sleep for adolescents, rows: [ [Group, Recommended sleep, Typical school night] [Teens 13 to 18, 8 to 10 hours, 6.5 to 7 hours] ])
| Group | Recommended sleep | Typical school night |
|---|---|---|
| Teens 13 to 18 | 8 to 10 hours | 6.5 to 7 hours |
Step 5 — A captioned figure
figure wraps an img and a figcaption. Figures centre by default; size is a
preset — small (220px), medium (380px), large (600px), full (100%) — or a number or percentage.
@figure @img(src: assets/attendance.svg, alt: Bar chart: attendance rising from 82 to 94 percent after a later start, size: medium) (figcaption Figure 1. On-time attendance before and after a district shifted its start from 7:30 to 8:35. figcaption) figure@
The alt value may hold colons and commas: it runs to the next
declared parameter. The src path is relative to the .wit file.
Step 6 — Works Cited
An ordered list of entries; italicise source titles with em.
(h2 Works Cited h2) @ol (li American Academy of Pediatrics. "School Start Times for Adolescents." (em Pediatrics em), vol. 134, no. 3, 2014, pp. 642–649. li) (li Dekker, Thomas. (em The Pleasant Comedy of Patient Grissell em). 1603. li) ol@
Works Cited
- American Academy of Pediatrics. "School Start Times for Adolescents." Pediatrics, vol. 134, no. 3, 2014, pp. 642–649.
- Dekker, Thomas. The Pleasant Comedy of Patient Grissell. 1603.
For a list that each chapter adds to, see A bibliography across files.
Step 7 — Render to PDF
wit build essay.wit -o essay.pdfResult. A PDF with the title, byline, epigraph, sections, the
sleep table, the attendance figure and the Works Cited list. PDF output
paginates the default HTML theme through a headless system Chrome, so Chrome
must be installed. Use -o essay.html for a styled web page, or --fragment to inspect the markup.
Step 8 — Split into chapters
When the essay grows, give each chapter its own file. A chapter is a block
definition without ::body::, so its use in the master file is
just its name on a line — no close. Each chapter adds its own sources with +#bibliography, and the master renders the collected list with a
loop. Citations use a header, so values go by position.
~ shared/schema.wit #cite(author, year): ::author:: (::year::) !!
~ chapters/01-intro.wit reference ../shared/schema.wit +#bibliography: Dekker, Thomas. _The Pleasant Comedy of Patient Grissell_. 1603. !! #chapter_one (h2 The Teenage Clock Runs Late h2) Sleep, as @cite(Dekker, 1603) put it, is a golden chain. chapter_one#
~ essay.wit reference ./chapters/01-intro.wit reference ./chapters/02-evidence.wit (h1 Let Them Sleep h1) @chapter_one @chapter_two (h2 Works Cited h2) @ol (each @bibliography as entry) (li @entry li) (end) ol@
Result. chapters/02-evidence.wit follows the same
shape. The build prints both chapters, then
<h2>Works Cited</h2><ol> <li>Dekker, Thomas. <em>The Pleasant Comedy of Patient Grissell</em>. 1603.</li> <li>Wahlstrom, Kyla. "Changing Times." <em>NASSP Bulletin</em>, 2002.</li></ol>
Entries arrive in the order the files are referenced, each once however many
files reference it. Build the master file; wit build scans the whole
reference graph first, so it knows chapter_one needs no close.
Pitfalls
- Nest emphasis bold-outside.
_*x*_leaves the inner*literal; write*_x_*instead. - Don't close a chapter.
@chapter_one … chapter_one@raisesE_BODY_WITHOUT_SLOT: the definition has no::body::. - Don't close a void node. Write
@br,@hrand@img(…)alone. - Alt text with a key in it. A value ends at the next
, key:the node declares, soalt: A dial, size: largesets the size. Escape the colon to keep it as text:alt: A dial, size\: large.
Variations
- Citation with a page. Add a parameter:
#citepage(author, year, page): ::author:: (::year::, p. ::page::) !!and write@citepage(Weil, 1952, 117). See A bibliography across files. - Web instead of print.
-o essay.htmlgives the styled document;--rawgives a reset-only page you style yourself. - Chapters with parameters. Number and title each chapter from one definition, as in A manuscript in chapters.
See also
The annotated essay walks a full file block by block; Core vocabulary lists every built-in node used here.