I'm using bookdown to type up my notes from some of my math courses. I want to use theorems and proofs as described here but I'm having issues with rendering when I actually knit the .pdf file. Basically, the .pdf renders what appears to be code, without actually formatting correctly, as I would be able to do "manually" in LaTeX.
I have tried switching between outputs (both HTML and .pdf knits have the same issue), I've used devtools::install_github('rstudio/bookdown')
to install the development version of bookdown, and I've followed the following links, to no avail: here, and here, though this is a simple error that I'm certain I took care of.
Here is my header:
---
title: "title"
author: author
date: '`r format(Sys.Date(), format="%B %d, %Y")`'
output:
pdf_document:
fig_caption: yes
toc: yes
html_document:
toc: yes
description: description
documentclass: book
header-includes:
- \usepackage{amssymb}
- \usepackage{amsmath}
- \usepackage{amsthm}
- \usepackage{tikz}
- \usepackage{hyperref}
- \usepackage{float}
- \usepackage{multirow}
link-citations: yes
numbersections: yes
bibliography: book.bib
site: bookdown::bookdown_site
biblio-style: apalike
---
And here is what I've tried
```{proposition}
If $X$ is a random variable and $X = c$, where $c \in [-\infty, \infty]$, then $\mathbb{E}[X] = c$.
```
```{proof}
Define a function $f(x)$ s.t. $f(x) = \begin{cases} 1 &\mbox{if } x = c \\ 0 &\mbox{otherwise} \end{cases}.$
```
Edit: I've also tried directly pasting in the examples here with no luck.
As mentioned earlier, I'm expecting something like Theorem 2.1 on this page, but instead it prints what appears to look like code. I've uploaded an example here, and the same thing happens if I switch to HTML.
As @Yihui Xie pointed out, I was using the incorrect output format. That link actually helped me figure out that I did not want a long, single document in the first place and figure out the appropriate book formatting, but I checked the output following the instructions on that page, as well as by creating the proper formatting and both work now. Thank you!