How to use
- Go to https://github.com/nmfs-opensci/quarto_titlepages_v1
- Open the
titlepagesfolder - Pick a title page, eg.
vlineorbg-image - Download (or copy) all the
.texfiles. Typically this is thebefore-body.tex,_titlepage.tex, andin-header.texfiles, but there may be more. How? Clone the repo or click on “raw” and copy and paste the code into your own file. - You can download (or copy)
article.qmdto use as a template and so you know how the YAML is specified for the template you are using.
In the YAML of your qmd document or index.qmd file for a Quarto book project, add this to the PDF format section:
Article class scrartcl
Adding number-sections: true will number the chapters and sections. Remove if you don’t want that.
format:
pdf:
documentclass: scrartcl
number-sections: true
template-partials:
- "before-body.tex"
- "_titlepage.tex"
include-in-header:
- "in-header.tex"
Book class scrbook
The class option “oneside” makes the margins of the even and odd pages the same. The class option “open=any” allows chapters and parts to start on even or odd pages; the default is to only start chapters and parts on odd pages. Note number-sections: false will not work with scrbook. That’s not the way to get rid of chapter numbers with the scrbook class.
format:
pdf:
documentclass: scrbook
classoption: ["oneside", "open=any"]
number-sections: true
template-partials:
- "template/before-body.tex"
- "template/_titlepage.tex"
include-in-header:
- "template/in-header.tex"
How do I add a table of contents
You can add a table of contents (toc: true), list of figures (lof: true) and list of tables (lot: true). The depth of the TOC is specified with toc-depth. Example:
format:
pdf:
documentclass: scrartcl
template-partials:
- "before-body.tex"
- "_titlepage.tex"
include-in-header:
- "in-header.tex"
toc: true
toc-depth: 3
lof: true
lot: true