Hi everyone! I was just wondering if anyone knew of a workaround for this problem I'm having. I'm having trouble displaying code properly knitting to PDF. I'm posting some sample code to show you what I mean:
---
title: "Untitled"
author: "Me"
date: "9/20/2019"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
\begin{enumerate}
\item
This works just fine.
\end{enumerate}
Now the compiler is going to think I'm still writing in \LaTeX \ instead of `R`.
\begin{enumerate}\item
The code doesn't run or display properly.
```{r}
x <- 0
```
Why????
\end{enumerate}
(Edited to add: I'm new here so I thought the post would display my code, but I swear if I insert an R chunk into RMarkdown in an enumerate environment it won't display correctly!)
I figured out that the problem is the fact that I'm writing the code as part of an enumerate item, and I guess RMarkdown doesn't like that? It worked just fine last semester but I've updated RStudio and this is the first time I'm using RMarkdown since. I'm not sure if this is a bug or what, but I'm a stats grad student so I use RMarkdown ALL THE TIME for my homework assignments (which have problem numbers, so I need to be able to use enumerate!)
I know Markdown has a numbering system which I guess I can use if I have to but I really prefer the look of Latex. Can anyone help me out with this?
Thanks!