I'm using quarto
to write an online book and need to mimic the environments and counters of a published book. The latter employs five custom framed environments (examples, exercises, remarks, theorems, definitions) with a joined counter (within the chapter).
In quarto
there is very nice infrastructure for creating such cross references for theorems and proofs but they have separate counters. Is it possible to configure/force them to use a joint consecutive counter?
As an example, the following code
The first example is @exm-1.
::: {#exm-1}
This should be Example 1.1.
:::
It is followed by the first exercise, @exr-1
::: {#exr-1}
This should be Exercise 1.2.
:::
is rendered as
The first example is Example 1.1.
Example 1.1
This should be Example 1.1.
It is followed by the first exercise, Exercise 1.1
Exercise 1.1
This should be Exercise 1.2.
Note that the first exercise should receive the number 1.2 (instead of 1.1) because it is the second environment in that chapter.
(Remark: I've also tried to do this via callout blocks as provided through quarto
, see Is it possible in quarto to create custom cross-references to callout blocks?.)