0

I'm new to R Markdown and got a problem right now. I want to do a Table one with mean and sd for some variables and for that pursue I'm using compareGroups and createTable. There is also a function, called export2latex, which converts the table into LaTex code but unfortunately I don't know how to tell R Markdown that the current chunk is already Latex and it should convert it.

I've tried it with results = 'tex' in the chunk options but without success. Right now it just displays the latex code in my pdf like this image. Here is the image of my code.

Does anybody know how to solve this problem?

UPDATE As mentioned, results="asis" helped out, so thank you. But there occurs a second problem after doing that. It seems like you need to use such a latex generated code as an inline expression, because knitr can't handle the latex math environment. So I did it like this. Now LaTex is able to compile the file but now there appears two dollar signs in my pdf.

Can someone tell me how to get rid of it?

trqkiz
  • 19
  • 3
  • 1
    Hi trqkiz. Welcome to StackOverflow! Please do not post images of code or data here. Please read the info about [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and how to give a [minimale reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610).That way you can help others to help you! – dario Feb 19 '20 at 13:42
  • 1
    `results="tex"` is a Sweave option. RMarkdown uses knitr, so you want `results="asis"`. – user2554330 Feb 19 '20 at 14:56

0 Answers0