Theorems and other LaTeX-like env support
I've just started using the distill package for personal blogging. Great experience so far.
I wanted to understand if rmarkdown LaTex support is offered similar to bookdown here.
I tried to write a theorem in a distill article by using:
```{theorem}
Here is my theorem.
```
This gave the warning (error):
Warning message:
In get_engine(options$engine) :
Unknown language engine 'theorem' (must be registered via knit_engines$set()).
And no theorem was displayed. Could anyone please explain if/how to get this working for math-based distill blogposts?
UPDATE: I also tried adding the following (on MacOS) to the distill yaml header:
header-includes:
- \usepackage{amsmath}
- \usepackage{amssymb}
- \usepackage{amsthm}
- \usepackage{bm}
- \usepackage{bbm}
- \usepackage{amsfonts}
- \usepackage{mathtools}
And also then did the following:
$$\begin{theorem}
We note that the most interesting theorem is the following:
\begin{align}
x &= 1 \\
y &= 2
\end{align}
\end{theorem}$$
This did not display any equation though. If you omit begin{theorem} tags then align does work as per rmarkdown.
Sorry for the delay on this one. I understand this is now a duplicate of #433
I have put an answer in https://github.com/rstudio/distill/issues/433#issuecomment-1004812002 based on new syntax offered by bookdown for theorem env. It should work for distill but it is surely not the best. It should be more built-in the distill article format.
I also tried adding the following (on MacOS) to the distill yaml header:
You can use LaTeX command for a HTML document. \usepackage won't have any effect when you are rendering to HTML.
You can't use directly LaTeX code inside HTML unless there is a specific support (like with equation environment because we support MathJax JS library which parse and transform this). \begin{theorem} is not something that will work for a generic HTML.