Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subsection numbering as the section #8

Open
t-gummer opened this issue Oct 16, 2024 · 0 comments
Open

Subsection numbering as the section #8

t-gummer opened this issue Oct 16, 2024 · 0 comments

Comments

@t-gummer
Copy link

t-gummer commented Oct 16, 2024

Outline of the problem

The custom title style for subsections uses the numbering for the section instead of the subsection, I believe this is a mistake.

It seems from this article that the intended usage is to use ## as your top section in markdown so the subsection will always be the top section for numbering however, this means that if you use numbered sections (I myself have used # in markdown to create sections) or subsubsection, the numbering looks weird.

Example

For example if I have the following quarto document:

---
title: Title
format:   PrettyPDF-pdf
number-sections: TRUE
---

# Example section

## Example subsection

### Example subsubsection

It produces the following output:

Note that both the section and the subsection has the number 1. The subsection should instead say 1.1.

Hacky fix

For now, my fix in my document has been to put the following in the YAML header of my document:

---
format: 
   PrettyPDF-pdf:
     include-in-header:
       - text: \titleformat{\subsection}{\sffamily\Large\bfseries}{\thesubsection}{1em}{}[{\titlerule[0.8pt]}]
---

Introducing this to the above example yields the correct output as you can see below:

image

Actions

I will submit a pull request to fix this shortly. Although I recognise this could be a breaking change for some people who only use ## and assumed this is fine for numbering purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant