Ask Your Question
4

How can custom fonts and attributes be designated for H1-H6 headings within a quarto PDF?

asked 2022-04-22 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-10-13 16:00:00 +0000

nofretete gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-22 11:00:00 +0000

Seen: 11 times

Last updated: Oct 13 '21