I am getting an error when I try to include a user defined environment in my R markdown document. I have at the top:
header_includes:
- \usepackage{amsmath}
- \usepackage{amssymb}
- \usepackage{amsthm}
- \newtheorem{assumption}{Assumption}
And then in the document itself, if I write
\begin{assumption}
$a > b$
\end{assumption}
I get the error "! Undefined Control Sequence \begin{assumption}" when I click compile.
I don't get an error if I use a regular proof environment or equation environment. That is,
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
does not give me an error. Of course, including the "header_includes" part in the preamble of a latex document and then using the assumption environment in that latex document is no problem. It would just be nice if I could copy and paste Latex directly into R markdown, since TexStudio has many nice autocompletion features and coloring schemes that make it the better environment to write latex, but Markdown is the easier way to integrate LaTex and code. Any help would be great. Thanks!