When writing a research paper in a single html page, we can use Pandoc’s fenced Div blocks to create theorem environments. Using the css pseudo element ::before
and counter
property, we can add theorem name, number, and title to the theorem environment. Here is an example.
Suppose we have the theorem.
Then the following css will added theorem name, number and title before the content of the theorem.
To add the section number to the theorem number, we can define a section counter similarly and add to the content of .thm::before
.
Because the counter
value can only be used by the content
property, using the counter to create the theorem number will not help cross-referencing. Instead, within a single html file, we can use jQuery to create numbered theorems and make cross-reference available.
The following are examples.