r - Rmarkdown with pdf output and plain LaTeX code block -
how plain code block rmarkdown
when code block contains tex
code , 1 wants pdf output ?
for example, not work:
--- title: "untitled" output: pdf_document: keep_tex: yes --- hello ! ``` \begin{verbatim} verbatim text \end{verbatim} ```
this generated error: ! latex error: \begin{document} ended \end{verbatim}.
of course, can do:
```{r, eval=false} \begin{verbatim} verbatim text \end{verbatim} ```
but problem when doing that, code block in output can highlighted r highlighting colors (not example above, occur in cases).
you use pandoc's verbatim fenced code block syntax:
~~~latex \begin{verbatim} verbatim text \end{verbatim} ~~~
or also:
```latex \begin{verbatim} verbatim text \end{verbatim} ```
Comments
Post a Comment