Good morning!
First of all, knitr, Rmarkdown, and Rstudio are the best things since sliced bread, Coca-Cola, etc.
I have one questions, which I'm sure is an easy fix.
I am making up some lecture notes for my students. Some like HTML, while others prefer PDF. I like happy students. So I am using Rmarkdown within Rstudio.
This is on a Mac, R Version 3.2.0.
Here are the lines from the Rmarkdown file:
We will review some of the very fun and interesting concepts that we discussed on Wednesday, August 26.
We know in our hearts that the gamma probability function is the following:
\[
f(x) = \dfrac{\lambda^r}{\Gamma(r)} x^{r-1} e^{-\lambda x},
\]
Here is some more stuff
\[
E[X] = \lambda \cdot \dfrac{\Gamma(2)}{\lambda^2}
\left \lbrack \int_0^{\infty} \dfrac{\lambda^2}{\Gamma(2)}
x e^{-\lambda x} \; dx \right \rbrack, \\
E[X] = \lambda \cdot \dfrac{\Gamma(2)}{\lambda^2} \cdot 1, \\
E[X] = \dfrac{(2-1)!}{\lambda} = \dfrac{1}{\lambda}
\]
This works just fine when I use knitr to HTML. However, when I use knitr to PDF, the second set puts all of the equations on one line.
What can I do to fix this, please?
I also attached the entire file for ease of use.
Thank you for any help.
Sincerely,
Erin