Writing
Books
A book is a set of ordinary notes read as one: chapters
in an order, one title, one view of what is done and what is still a
draft — and, when you want it, one document built from the lot. Every
chapter stays a note like any other: it opens, links and previews as
before, and Obsidian sees nothing it cannot read. The demo vault's
Books/Signals is a small book to try things on, and its
Guide/Books note, linked from Welcome, walks through
it. (Not in 0.12.0.)
The master note
A book lives in a master note: one whose front matter
says book: true and lists the chapters, in order, as links.
Books/Signals/Signals.md
---
book: true
title: "Signals: A Short Book"
numbering: per chapter
chapters:
- "[[Senders and Receivers]]"
- "[[Conventions]]"
- "[[Deception]]"
---
- It is the
chapters:key that makes a note a master. A note that saysbook: truewith nochapters:— notes about a book — is just a note. numberingisper chapter, the default (Figure 2.3, Theorem 2.1, equation (2.1)), orcontinuous, straight through the book. Case and spacing in its value do not matter.- A chapter's title is its first
#heading; failing that, thetitlein its front matter; failing that, its file name. Renaming a chapter's note renames it in the list too, as it does every other link to it, and a link's alias ([[Senders and Receivers|Ch. 1]]) survives every change the panel makes. - The master's own text is the book's prelude, before the first
chapter — a dedication, an epigraph, or nothing — except an
@bibliography(or@index) at its end, which goes after the last chapter: the book's one list of references. A title block at its top is the book's title page in its PDF and LaTeX, and its title is the PDF's Title unless the master's header has aTitle(a capital T: the example'stitleis not that key); a chapter's prints as left-aligned lines and names nothing (The title block as LaTeX's title; not in 0.12.0).
The Book panel
A vault with a master has a Book tab in the right sidebar; a vault without one has no such tab. The command Book: show the Book panel opens it. It shows the book of the note you are in — the master or one of its chapters — or, from anywhere else, the book you opened last; a vault with several books has a list to pick from.
Each chapter is a row: its number, its title, its length in words, and its status. Under the list, the totals: 3 chapters · 368 words · 1 draft · 1 revised · 1 done.
- Words are prose: front matter, code, maths and comments are not counted, so the status bar's count for the same note, which counts every word, is larger.
- Status is the chapter's own
status:property —draft,revisedordone— set from the row's status chip. A chapter without one shows —, and the totals count it without a status. - Reorder by dragging a row by its grip, or focus a row and press ⌥↑ or ⌥↓.
- × takes a chapter out of the book; its note stays where it is.
- Add … puts the note you are in at the end of the book.
- A chapter whose link finds no note is shown in red, with no such note.
Every change is an edit to a note — the master's chapters:
list, or a chapter's status: — made the way you would make
it yourself: an open editor takes it as an edit you can undo, and a note
changed elsewhere at the same moment is held for you to resolve, as any
conflict is. A master whose front
matter Clew cannot rewrite safely (comments, unusual YAML) is shown but
not changed.
Moving through a book
In a chapter, the status bar says where you are — Ch. 2 of Signals: A Short Book — and a click on it opens the Book panel. A note can be a chapter of two books: then the status bar names the one you opened or built most recently and adds · also in Course, and a click switches to the other.
Book: next chapter and Book: previous chapter step through the book of the note you are in. Neither has a key of its own; give them one in the hotkey editor.
Writing a chapter
In live edit a chapter shows its book's numbers, the
ones the built book will print: per chapter (Theorem 2.1,
equation (2.1)) or straight through, as the master's
numbering says. That is every number live edit draws: a
reference's, an equation's tag, a numbered heading's and an
environment's heading. A reference can name a label in another chapter.
Typing @ref[ lists the book's labels, each with the chapter
it is in, and Jump to label… lists them all. A click on the
reference opens that chapter at the label's line, and hovering it
previews the label from that chapter's text. The numbers follow your
edits: in any chapter open in an editor, saved or not, and in any other
once it is saved.
Citations follow the book too. A built book has one bibliography (the vault's, the master's, then each chapter's own files, in book order) under the master's citation settings, and in live edit a chapter's citation chips read as the book prints them. In a numeric style a citation's number counts from the first chapter, and a key that only another chapter's bibliography holds is found, as the build finds it. A chapter's own citation style is not used. The build warns about both (below).
Reading view still shows a chapter on its own: there its figures,
theorems and equations number from 1, and a reference to another
chapter prints ??. A quiet line above it says so —
Chapter 2 of Signals: A Short Book · numbers as in the book: —
with a Build button that builds the book's HTML pages,
as the panel's does. The master has the line too (Master of Signals:
A Short Book), since its references into the chapters print
?? there. A note in no book has none.
Building a book
Build — the Book panel's PDF, LaTeX, HTML and Print
PDF buttons, or File → Export → Book as PDF (via
LaTeX), Book as LaTeX, Book as HTML or Book as
PDF (reading view) — makes the whole book
one document: the master's text, then each chapter in order, every
chapter's front matter left out and its # heading made a
chapter (a chapter with no # heading gets one from its
title). Figures, theorems and equations are numbered as the master's
numbering says, and a chapter's footnotes close that
chapter, numbered from 1.
- PDF and LaTeX go into a
build/folder beside the master, named after it —build/Signals.pdf,build/Signals.tex— and a rebuild replaces them. LaTeX's own files (.aux,.log,.bbl…) stay inbuild/too, so nothing lands beside a chapter. The diagrams the build draws are copied intobuild/Signals-figures/, which the.texand the HTML pages share, as a note's export does. The PDF is typeset from a.texper chapter —build/Signals.texincludesbuild/Signals-ch-1.tex,-ch-2.texand on — which prints the same text as one file would and is what lets a chapter be proofed alone (below). Book as LaTeX still writes the onebuild/Signals.tex, the whole book in it. - HTML is a small website in
build/Signals/:index.html, the master's text with the contents; a page for each chapter, with previous, contents and next links; andreferences.html, linked from the contents, when the master ends with@bibliography. Clew opensindex.htmlin your browser when the build is done. Each HTML build replaces the folder, the old one going to the Trash. - Print PDF (Book as PDF (reading view))
prints the book as reading view draws it, with the book's numbers and
no TeX needed. Each chapter starts a new page, as does a further
#heading in a chapter's file, and the references and the index. It goes tobuild/Signals (reading view).pdf, apart from the LaTeX PDF, in the light theme and at Settings' paper size, as a note's reading-view PDF does. - Proof
(File → Export → Proof This Chapter (PDF via
LaTeX), or the Book panel's Proof row,
Proof: Conventions (ch. 2), both there while a chapter
of the book is the open note) typesets that chapter alone, in a few
seconds however long the book. Every other chapter's numbers and pages
come from the book's last full PDF, through LaTeX's
\includeonly, so the chapter keeps the number, the page numbers and the cross-references the book gives it; the master's own text and the references come with it. It goes tobuild/Signals (proof, Conventions).pdf, and the notice says which full PDF the numbers come from. So a proof needs one full PDF first, and rather than number anything wrong it refuses, saying why, when the book has no full PDF yet, when the list or order of its chapters has changed since, when that run's files have been cleared frombuild/, or when the open note is not a chapter of the book. Build the book as PDF, then proof again. In a vault you have not trusted the Proof row is still there, but a proof builds nothing: its notice says a chapter proof (a PDF via LaTeX) is not made in a vault this device does not trust, and offers only trusting the vault (Settings → This vault). - In a vault you have not trusted, a build runs no note code, as any export there does, and its pages are shown in Finder rather than opened, since they may carry the notes' own scripts; the notice says why. The PDF button (Book as PDF (via LaTeX)) builds nothing there: its notice says a book's PDF via LaTeX is not made in a vault this device does not trust, as a note's is not (Trusting a vault), and offers Print PDF instead, or trusting the vault (Settings → This vault). Print PDF and the LaTeX and HTML builds still run.
A [[link]] to another chapter becomes a link to it: in the
PDF it jumps to that chapter, and in an HTML build it opens that
chapter's page. Any other
[[link]] prints as its text, as it does in a note's
export. An image is found from
the chapter it is written in, wherever that chapter sits, and the built
file refers to it by a path relative to itself, never by its full path
on your disk.
A chapter link that finds no note stops the build, naming it. Whatever else the build had to say is listed under the panel's Last build: … · ⚠ 2, and each chapter's row carries its own ⚠ count. Each warning names its chapter and line — Deception:20 book: 2 level-1 headings in this chapter; each starts a chapter — and choosing it opens the chapter at that line.
What a chapter may set for itself
A book has one set of settings, the master's. A chapter's front matter may still add these for itself:
Bibliography- Joins the book's; a clash between two, or a chapter citing from another chapter's file, is warned.
Packages,LaTeX preamble- Join the book's one preamble; clashes are warned.
LangorLanguage- That chapter's hyphenation and, in a book, its language's quotation marks.
Math macros- Added to the book's.
- A
<style> - Applies to that chapter's own page of an HTML build only.
Any other key a chapter sets is the master's to decide, and the build
warns about it by name — unless the chapter sets it to the very value
the book uses. That is why a chapter can keep Resolve citations:
true for its own reading view without a warning, so long as the
master says the same.
Not yet
Only chapters for now. Parts, and front and back matter, are not built
yet: a master that lists parts, frontmatter or
appendices is read without them, and the Book panel says so
by name.
Reference
| Item | Detail |
|---|---|
| A master | book: true and a chapters: list of [[links]]; without chapters:, not a book |
numbering | per chapter (default) or continuous; case and spacing ignored |
| Chapter title | First # heading, else front-matter title, else the file name |
| Chapter status | Its status: — draft, revised, done |
| Book panel | Right sidebar, only in a vault with a master: reorder (grip, ⌥↑/⌥↓), × to remove, Add …, status chip, prose word counts, Build, Proof (with a chapter open) |
| Status bar | Ch. N of Book; · also in … for a note in two books; click to switch or open the panel |
| Commands | Book: next chapter, Book: previous chapter, Book: show the Book panel — no default keys |
| Writing a chapter | Live edit shows the book's numbers and citations; @ref[ and Jump to label… list the book's labels; a click opens the label's chapter |
| Reading view | A chapter on its own (numbers from 1, other chapters ??); a line above it, … · numbers as in the book: Build |
| Build | The panel's PDF / LaTeX / HTML / Print PDF, or File → Export → Book as …; into build/ beside the master; in a restricted vault the PDF is refused |
| Print PDF | build/<master> (reading view).pdf: the book as reading view draws it, each chapter from a new page; no TeX |
| Proof | File → Export → Proof This Chapter (PDF via LaTeX), or the panel's Proof row, with a chapter open: that chapter alone, numbered from the last full PDF, into build/<master> (proof, <chapter>).pdf; refused, saying why, with no full PDF or after the chapters change, and in a restricted vault |
| HTML build | build/<master>/: index.html, a page per chapter, references.html; the old folder to the Trash |
| Links and images | A [[link]] to a chapter links to it; any other prints as its text; an image is found from its chapter, by a relative path |
| Chapter keys | Bibliography, Packages, LaTeX preamble, Lang/Language, Math macros, <style>; anything else warns unless equal to the book's |
| Not yet | Parts, front matter, back matter; a PDF, LaTeX or HTML build, or a proof, on the iPad |
See also
- Exporting notes — the single-note exports a build is made of, and the TeX toolchain.
- Citations and bibliographies — the
@bibliographya master ends with. - Math and theorems — what
numberingnumbers. - Properties and metadata — the front matter a master and its chapters carry.
- Panels — the right sidebar the Book tab sits in.