0

I have an Rmd document with R code chunks in between enumerated latex environment. While Knitting the document, an error is encountered at the code evaluation: pSeq <- read.GenBank("NC_00111").

I am getting the following error with the code below:

\begin{enumerate}

```{r echo=FALSE, message=FALSE}
library('ape')

```

\textit{R functions: read.GenBank, ...}

  \begin{enumerate}
    \item the accession number NC\_00111. \newline
    \textit{ only the sequence ...)}

```{r}
pSeq <- read.GenBank("NC_00111")

```
    \item ...

  \end{enumerate}
  \end{enumerate}

Error message:

! Missing $ inserted. <inserted text> 
                $ l.158 chimpSeq <- read.GenBank("NC_
                                   00111")

I am not sure how to overcome this error using the solution provided here. Are there any other workarounds or solutions?

Prradep
  • 5,506
  • 5
  • 43
  • 84
  • 1
    One option would be to end the enumerate, place the R code, and the re-start the enumerate after the code. [Here's](https://tex.stackexchange.com/questions/142/how-can-i-make-an-enumerate-list-start-at-something-other-than-1) how to re-start the numbering with a "fresh" enumerate environment. – DanY Sep 06 '18 at 16:50
  • @DanY Thank you. I would check this one! I would need to check this with nested environments and compare. – Prradep Sep 06 '18 at 16:57

0 Answers0