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

Numbered appendix causes extra dot in captions when replacing template partials #11694

Open
ndunnewind opened this issue Dec 17, 2024 · 2 comments
Labels
bug Something isn't working latex LaTeX engines related libraries and technologies templates

Comments

@ndunnewind
Copy link

Bug description

#247 reported an extra dot was added to section, figure and table captions when using a numbered appendix. This was fixed in fd73f4e. However, I noticed the dot is still added when replacing any of the template partials, even when template-partials is just an empty list.

Steps to reproduce

---
format:
  pdf:
    documentclass: scrreprt
    template-partials: []
number-sections: true
---

# Introduction

|a|b|
|-|-|
|1|2|

: Some table.

\appendix
# Some appendix

Expected behavior

Image

Actual behavior

Image

Your environment

  • IDE: RStudio 2024.09.0+375
  • OS: Microsoft Windows 11 Home

Quarto check output

$ quarto check
Quarto 1.6.39
[>] Checking environment information...
      Quarto cache location: C:\Users\niels\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.6.39
      Path: C:\Users\niels\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2024.10
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\niels\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: C:/Users/niels/AppData/Local/Programs/Python/Python310/python.exe
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with py -m pip install jupyter

[>] Checking R installation...........OK
      Version: 4.4.1
      Path: C:/PROGRA~1/R/R-44~1.1
      LibPaths:
        - C:/Users/niels/Documents/quarto-bug/renv/library/windows/R-4.4/x86_64-w64-mingw32
        - C:/Users/niels/AppData/Local/R/cache/R/renv/sandbox/windows/R-4.4/x86_64-w64-mingw32/e0da0d43
      knitr: 1.49
      rmarkdown: 2.29

[>] Checking Knitr engine render......OK
@ndunnewind ndunnewind added the bug Something isn't working label Dec 17, 2024
@cscheid cscheid added the latex LaTeX engines related libraries and technologies label Dec 17, 2024
@ndunnewind ndunnewind changed the title Numbered appendix causes extra dot in captions when replacing before-body Numbered appendix causes extra dot in captions when replacing template partials Dec 17, 2024
@ndunnewind
Copy link
Author

Adding classoption: numbers=noendperiod to the PDF options fixes this.

@cderv
Copy link
Collaborator

cderv commented Dec 24, 2024

We do add the classoption automatically

// establish default class options
const defaultClassOptions = ["DIV=11"];
if (format.metadata[kLang] !== "de") {
defaultClassOptions.push("numbers=noendperiod");
}

but only for our default PDF template using Koma script. And we consider our default are used if nothing is modified among templates

const usingCustomTemplates = format.pandoc.template !== undefined ||
format.metadata[kTemplatePartials] !== undefined;
if (
usingCustomTemplates ||
(documentclass &&
![
"srcbook",
"scrreprt",
"scrreport",
"scrartcl",
"scrarticle",
].includes(
documentclass,
))
) {
koma = false;
}

So by setting template-partials, koma = false and so we don't set default classoption including this numbers=noendperiod.

Not sure if we should do it in all case. It is easy enough to add the classoption in the new format your create by providing template partials. If this is safe though, we could try to do it by default but it would be harder to opt-out that it is to opt-in today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working latex LaTeX engines related libraries and technologies templates
Projects
None yet
Development

No branches or pull requests

3 participants