typst / templates

Templates that are directly maintained by the Typst team.
MIT No Attribution
228 stars 22 forks source link

Independent counters for `image` and `raw` #39

Closed schmidma closed 2 months ago

schmidma commented 2 months ago

In the charged-ieee template the supplement for images and raw text is set to Fig.:

https://github.com/typst/templates/blame/01afc5cb135743517111269cb34b98dc44400b17/charged-ieee/lib.typ#L46

As both raw and image are both counted independently, this leads to confusing numbering when using both raw and image figures in the document:

// [...]

#figure(
  ```rust
  fn main() {}
  ```,
  caption: "This is my code block",
)

#figure(
  image("placeholder.svg"),
  caption: "This is my placeholder image",
)

// [...]

leads to image

I'd expect the code block to be called Listing or all figures to be counted with a single counter