6.1 Book Structure
book type projects are designed for authoring books.
It combines multiple documents (chapters) into a single manuscript.
It supports a variety of formats: PDF, HTML, EPUB, DOCX, etc.
Best to use book if you want both PDF and HTML outputs.
The _quarto.yml file contains the book project structure.
project:
type: book
book:
chapters:
- index.qmd
- preface.qmd
- part: dice.qmd
chapters:
- basics.qmd
- packages.qmd
- part: cards.qmd
chapters:
- objects.qmd
- notation.qmd
- modifying.qmd
- environments.qmd
- references.qmd
appendices:
- tools.qmd
- resources.qmd
bibliography: references.bib
format:
html:
theme: cosmo
pdf:
documentclass: scrreprt
epub:
cover-image: cover.pngThe
index.qmdfile is required (because Quarto books also produce a website in HTML format). This page should include the preface, acknowledgements, etc.bookspecifies title, author, chatperters, and other book-level metadata.chaptersproperty includes one or more book chapters.
You can divide your book into parts using
partwithin the bookchapters.- The
references.qmdfile will include the generated bibliography (see References below for details).
Note that the markdown files
dice.qmdandcards.qmdcontain the part title (as a level one heading) as well as some introductory content for the part.If you just need a part title then you can alternatively use this syntax:
formatspecifies output formats and their options.For example, you can specify themes for HTML and pdf macros.
ref: