Open Cody-Kerr opened 1 year ago
There were two things: one was an error when using the option which as fixed using a workaround in Quarto and the fact that LaTeX format template does not support the option in Pandoc (https://github.com/jgm/pandoc/issues/4764).
A workaround:
---
format:
pdf:
number-sections: true
include-in-header:
text: |
\setcounter{section}{-1}
---
## test
Thank you so much! The solution you posted works in my test document and in the primary document I need to render for my project.
Do you know if there's a plan in the future to have Pandoc support the number-offset for PDF rendering in Quarto?
There is an open issue as I said. Now, it would be better for Pandoc to fix this than for Quarto to do this downstream.
Thank you.
Let's keep this open.
We probably need to update Quarto reference page to stop listing number-offset
as a valid option for pdf format until this is resolved update:
A workaround:
--- format: pdf: number-sections: true include-in-header: text: | \setcounter{section}{-1} --- ## test
This doesn't seem to work for book projects (at least with Quarto 1.5.57).
Bug description
When rendering a Quarto document to PDF, the number-offset YAML header is not working.
Steps to reproduce
Expected behavior
Using the number-offset YAML option should offset the numbering in a PDF output.
Actual behavior
I'm trying to offset the section/heading numbers so that the first level 1 heading starts at 0. The default starts at 1. When I set number-offset: -1 for the PDF output option, it doesn't work. I've also tied a positive offset to test such as number-offset: 2. That doesn't work either. I read on one site that this was a bug on PDF outputs (https://github.com/quarto-dev/quarto-cli/issues/3126) but that it would be fixed in version 1.3. I'm assuming that meant Quarto version 1.3. When using the same YAML option for HTML output, the number offset works, but it is still not working for PDF outputs.
I know there is a version of pandoc available that is 3.1.8 but I haven't tried that yet as I've read that RStudio comes bundled with a pandoc version and that changing to a non-bundled version could cause issues.
Your environment
Here are the versions I'm running: R: 4.3.1 RStudio: 2323.06.2 +561 Quarto: 1.3.450 Pandoc: 3.1.1
Quarto check output
[>] Checking versions of quarto binary dependencies... Pandoc version 3.1.1: OK Dart Sass version 1.55.0: OK [>] Checking versions of quarto dependencies......OK [>] Checking Quarto installation......OK Version: 1.3.450 Path: C:\Users\Cody\AppData\Local\Programs\Quarto\bin CodePage: 1252
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....(None)
Unable to locate an installed version of Python 3. Install Python 3 from https://www.python.org/downloads/
[>] Checking R installation...........OK Version: 4.3.1 Path: C:/PROGRA~1/R/R-43~1.1 LibPaths:
[>] Checking Knitr engine render......OK