quarto-dev / quarto-dev/quarto-cli

Add support for `space-before-numbering` in Typst custom crossrefs

Open
#9,416 1 comment 4 reactions 2 assignees View on GitHub

@gordonwoodhull is already working on this.

Since Apr 18, 2024.

crossref enhancement typst
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/9413

Originally posted by mps9506 April 18, 2024

Description

I'm attempting to use the custom float cross reference types to create supplementary figure and table captions and cross references (eg. Fig S1, Table S1) with the Typst output. Here is what I am currently doing:

---
title: "MWE"
format: typst

crossref:
  custom:
    - kind: float
      key: suppfig
      reference-prefix: Figure S
      caption-location: bottom
      space-before-numbering: false
---

:::{#suppfig-test}
```{r}
#| echo: false
plot(rnorm(50),rnorm(50))
```
test caption
::::

This nearly works but I get an undesired space between the prefix and the number:
image

Looking at the .typ output, the figure block looks like:

#figure([
#block[
#block[
#box(width: 396.0pt, image("mew_files/figure-typst/unnamed-chunk-1-1.svg"))

]
]
], caption: figure.caption(
position: bottom, 
[
test caption
]), 
kind: "quarto-float-suppfig", 
supplement: "Figure S", 
numbering: "1", 
)
<suppfig-test>

There is no obvious way to control spacing using the custom float. I'm wondering if I'm missing a way to specify the numbering parameter via Quarto instead (https://typst.app/docs/reference/model/numbering/)? Something like numbering: "S1"

Here is my session info:

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.1 tools_4.3.1    renv_1.0.3  

output from quarto --version: 1.4.553

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.