r - Expressions in markdown using knitr -


i'm trying use inline expression in .rmd markdown file. i'm converting .rmd file pdf using pandoc. contents of file this:

report  ========================================================  text , expression 100km^2  ```{r} summary(cars) ``` 

i expected 100km^s render normally, renders literally '100km^2'. how can expression render?

you can use latex math mode this,

knit(text="$100 km^2$",output="test.md") pandoc("test.md", format="latex") 

gives me:

enter image description here


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -