How to make theorem-like environments sharing the same counter #10844
Replies: 1 comment 2 replies
-
You'll need a fair bit of LaTeX and Quarto expertise to do this, unfortunately. In HTML formats, Quarto does all of the crossref counter work; you'll need to reimplement that. On top of it, you want this to work on books, which are a particularly complicated part of the codebase, since global state needs to be maintained across different Pandoc renders. In LaTeX formats, Quarto defers the crossref work to LaTeX packages. In order to share counters across these different environments, you'll probably have to write your own environments. To do this in a single page for HTML and LaTeX formats, it will take a combination of filter work and LaTeX packages. Unfortunately, I'm not sure it's possible to make this work in a book at the moment. |
Beta Was this translation helpful? Give feedback.
-
Description
Hi,
I have several lecture notes prepared in Latex, and I would like to transform them into a Quarto book with PDF and HTML outputs.
One of my main issues is the following: I heavily use the standard feature of amsthm package of sharing counters for theorem-like environments:
would make something like Theorem 1, Definition 2, Theorem 3, Remark 4, etc.
My aim is to reproduce the attached picture

As you can see, here there are several "unusual" features:
In Latex, this can all be done using tcolorbox package. In Quarto, I'd prefer to have just:
and then for the PDF output the rest would be done in latex preamble. For HTML, I understand that item 4 can be done using CSS file. However, for 1 and probably 3, I would need some lua filter, I guess.
Hence, the first question is indeed, how to make several theorem-like environments sharing the same counter?
Beta Was this translation helpful? Give feedback.
All reactions