Clew Manual

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]]"
---

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.

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.

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.
Lang or Language
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.

On iPad Clew for iOS has the master note, the chapter in the status bar, the next and previous chapter, the Book panel with its word counts and statuses, and the book's numbers and citations while you write, as here. Reorder by dragging a row's grip, which is small for a finger for now, or with ⌥↑ and ⌥↓ on a keyboard. Of the builds, the iPad has only Print PDF: the panel's one button, and the one on the line above reading view (… · numbers as in the book: Print PDF). It prints the book with each chapter from a new page and hands it to the share sheet. A PDF, LaTeX or HTML build says it needs Clew on a Mac. Proofing a chapter stays on the desktop: it typesets with LaTeX, which the iPad does not have, so the iPad's Book panel has no Proof row and its palette no Proof command.

Reference

ItemDetail
A masterbook: true and a chapters: list of [[links]]; without chapters:, not a book
numberingper chapter (default) or continuous; case and spacing ignored
Chapter titleFirst # heading, else front-matter title, else the file name
Chapter statusIts status: — draft, revised, done
Book panelRight 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 barCh. N of Book; · also in … for a note in two books; click to switch or open the panel
CommandsBook: next chapter, Book: previous chapter, Book: show the Book panel — no default keys
Writing a chapterLive 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 viewA chapter on its own (numbers from 1, other chapters ??); a line above it, … · numbers as in the book: Build
BuildThe 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 PDFbuild/<master> (reading view).pdf: the book as reading view draws it, each chapter from a new page; no TeX
ProofFile → 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 buildbuild/<master>/: index.html, a page per chapter, references.html; the old folder to the Trash
Links and imagesA [[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 keysBibliography, Packages, LaTeX preamble, Lang/Language, Math macros, <style>; anything else warns unless equal to the book's
Not yetParts, front matter, back matter; a PDF, LaTeX or HTML build, or a proof, on the iPad

See also