Page numbers in Quarto PDFs

I'm guessing this is an easy question, but I can't find it in the docs. How do I turn on page numbering for Quarto documents rendered to PDF? When I start typing p in the YAML and hit tab, pagenumbering is a suggested parameter, but I don't know what kind of value it expects. true gives an error, "bottom" will render but there are no page numbers.

1 Like

Hi @AmeliaMN,

Do you not get page numbers by default with a standard Quarto PDF document? When I render the following document:

---
title: "Untitled"
format: pdf
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

I get page numbers in the bottom center. Does this not match your experience?

In any case, the following should enable page numbering:

---
title: "Untitled"
format: 
  pdf:
    include-in-header: 
      text: '\pagenumbering{arabic}'
---

You can use \pagenumbering{gobble} to remove page numbers.

2 Likes

About this, if you use auto completion in first level of the YAML, you'll get all the possible value that any format can get. pagenumbering for example if for ConTeXt (Pandoc - Pandoc User’s Guide). If you try under

format:
    pdf:
       <here>

You should have pagenumbering proposed.

Same as @mattwarkentin , it should be activated by default, unless you are using a template or documentclass that may change that. It is LaTeX option that you can change as shown above.

1 Like

Doh, I had turned off pagenumbering in my header.tex. Thanks, folks!

I do wish it was easier to find documentation for the YAML parameters. I don't know how I would have figured out I needed to look at ConTeXt.

2 Likes

I pretty much have the Quarto - Reference web page open in my browser at all times and just "cmd+f" search for key words when I'm trying to find info about YAML parameters for a specific format (e.g., PDF).

Yes, that's my first point of reference, as well! But, pagenumbering does not appear in the Quarto docs, at least as far as I can see. I guess it's available via tab completion because it's a ConTeXt parameter, but I would have to know that to be able to go search for it in the ConTeXt documentation. I wish there was a searchable list of all the parameters!

Tab completion under the format key should be the place to look for a specific format. That the way it helps the most to know if an option is supported for a format.

Regarding search, it should have been possible to search on the site but it seems we are missing a page for this format. So the option is known but not documented. I agree that is not helpful.

I’ll see what we can do to improve.

I think I'm using tab-completion wrong, because I haven't found a way to get anything format-specific. Maybe because I don't have indentation quite right in my YAML? I can only get pagenumbering to tab-complete from the top level . E.g.,

---
format: pdf
p
---

If I have my YAML as

---
format:
      pdf:
         p
---

and hit tab, nothing happens. If I get the pdf part indented one more tab, then when I hit tab on the p I'm suggested pdf, plain and pptx, which suggests that the pdf part hasn't been recognized.

Do you have any videos you could point me toward of this sort of tab-completion? As with anything GUI/WISWYG it's so hard to debug via text!

I’ll tru to remember to make a video tomorrow.

In fact see quarto workshop about YAML intelligence a 1:12:06

Can you try this though

format:
    pdf:
        <hit CTRL + Space here>

This can trigger autocompletion I think (I am on my phone so doing by memory )

You also need to have recent version of IDE and quarto. Adding a note on this Just in case…

@AmeliaMN I don't think pagenumbering is a valid YAML option for the standard PDF format. This would explain why it does not show up when using format-specific tab autocompletion (i.e., autocompletion when tabbed inside of the specific format, as @cderv demonstrates above).

The reason it shows up at the top YAML level is because ALL options show up at the top level of YAML, even those not relevant to your specific format.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.