-
Notifications
You must be signed in to change notification settings - Fork 4
PDF Styling through LaTeX and KOMA‐Script
As requested by Gwen, to make a PDF of AETR that is attractive enough to distribute to legislators.
Each of the issues will be described in the following sections, but here is a rundown
- Instructing Quarto to render the markdown as PDF
- Interactive vs Static graphs
- Styling the result
- Irritants
- Tables = blech
- Footnotes
PDF Basics covers this pretty well.
- You need to install Tex with
quarto install tinytex
. PDF Engines describes the various distributions and compilation engines that work with Pandoc, but we will stick with the default - You can manually render with
quarto render --to pdf
- Automatic rendering is enabled by adding a
pdf:
section to_quarto.yml
. See the docs for details. - If you would like a link to the PDF added to the web book, that is
downloads: [pdf]
in_quarto.yml
. That is in Customizing Book Output
Our original plotting language was OJS
which seemed so cool! However, ojs figures are rendered by the browser when the HTML pages are viewed - not by Quarto. So the rendered PDF only has code - not the figures. Quarto "recommends" to print pages from the browser to PDF files = twisted. In 2022, the prediction was that adding ojs rendering would be implemented in 3-9 months.
Also:
So we had to abandon OJS if we want to have figures in the PDF, and we have to use R for plotting because we need conditional execution for ggplot interactivity for the web version and static plots for the PDF
Fill in details when we figure it out.
In the format
section of _quarto.yml
, you can specify the documentclass
that sets the basic format of the PDF. Find info in
To summarize, Quarto uses KOMA Script document classes by default, which is basically an extension to LaTeX. koma-script includes classes that include these qualities:
- scrbook: Book with a header on every page, 2-sided, typesetting, chapters
- scrreprt: Report for long articles like theses (with optional 2-sided)
- scrartcl: Articles with no chapters and the title is not a separate page. Render will fail with chapters.
- scrlttr2: Letter ... whatever
- slides?
The guiding light for LaTex overrides is https://cameronpatrick.com/post/2023/07/quarto-thesis-formatting/
To be filled in ...