How to use

  1. Go to https://github.com/nmfs-opensci/quarto_titlepages_v1
  2. Open the titlepages folder
  3. Pick a title page, eg. vline or bg-image
  4. Download (or copy) all the .tex files. Typically this is the before-body.tex, _titlepage.tex, and in-header.tex files, but there may be more. How? Clone the repo or click on “raw” and copy and paste the code into your own file.
  5. You can download (or copy) article.qmd to 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