Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use CSS (Cascading Style Sheets) to designate custom fonts and attributes for H1-H6 headings within a Quarto PDF.

Here is an example CSS code snippet to change the font family and font size for H1-H6 headings:

h1 {
    font-family: Arial, sans-serif;
    font-size: 36px;
}

h2 {
    font-family: Times New Roman, serif;
    font-size: 24px;
}

h3 {
    font-family: Verdana, sans-serif;
    font-size: 18px;
}

h4 {
    font-family: Georgia, serif;
    font-size: 16px;
}

h5 {
    font-family: Trebuchet MS, sans-serif;
    font-size: 14px;
}

h6 {
    font-family: Comic Sans MS, sans-serif;
    font-size: 12px;
}

To use this CSS code, you can create a new file named "styles.css" (or any other name you prefer), and add this code to it. Then, save the file in the same directory as your Quarto project.

Next, you need to specify the path to the CSS file in your Quarto project configuration file (quarto.yml or quarto.json). Here is an example configuration setting for using the styles.css file:

assets:
  css:
    - styles.css

With this configuration, Quarto will include the styles.css file in the generated PDF, and the custom fonts and attributes will be applied to your H1-H6 headings.