Skip to content

Subsection numbering as the section #8

@t-gummer

Description

@t-gummer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions