bookdown icon indicating copy to clipboard operation
bookdown copied to clipboard

Add axioms to theorem environments

Open AstrickHarren opened this issue 3 years ago • 2 comments

It seems axiom is not implemented and not listed in the table of Theorem environments in bookdown: image

Besides, solution by #422 is not in the list but actually implemented.

AstrickHarren avatar Jun 08 '21 16:06 AstrickHarren

solution has been impletement in #422 as a Proof environment (not Theorem) and is listed as such in the sentence about Proofs env further below the table you linked to

"The proof environments currently supported are proof, remark, and solution"

It seems axiom is not implemented

I think you're right. This could be added the same way as #422 for Exercise to have a default support by bookdown if it is useful to you. We welcome a PR for that. Thanks !

cderv avatar Jun 08 '21 16:06 cderv

Is there a way to customise these theorem environments so that one can define their own environment for "Result", "Observation", etc.

YiquanGu avatar Jul 08 '21 07:07 YiquanGu

You can create any environment you want using Custom Blocks directly: https://bookdown.org/yihui/rmarkdown-cookbook/custom-blocks.html

The Theorems & Proofs environment supported in bookdown are now using the above: https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems What bookdown does specially for this is insuring that the correct LaTeX preamble part will be inserted into the resulting document, and that it will get styled in HTML output. It will also add the specific part so that you can reference those blocks. Currently, referencing custom block like this is only available in bookdown I think.

By customizing the environment, you'll need to add the correct preamble part and you'll need to add some CSS rules so that you get a correct style in HTML.

So I believe you can customize this currently as you would do if you wanted such environment without using bookdown in the first place. But regarding bookdown, it could probably be improved to make it easier to use any environment and at the same time keep the specific features. We welcome any contribution in this direction.

cderv avatar Jul 08 '21 08:07 cderv