r - How to deal with double braces in code chunk? -
r - How to deal with double braces in code chunk? -
i writing rmd files introducing whisker package. , utilize slidify compile html slides.
therefore inevitable utilize {{ , }} in code. wrote next code in rmd file:
```{r} tpl <- " <b>against:</b> {{x.against}}<br/> <b>venue:</b> {{x.venue}}<br/> <b>match:</b> {{x.type}}<br/> <b>score:</b> {{x.score}}<br/> <b>result:</b> <span class={{x.result}}>{{x.result}}</span><br/> {{#x.sr}}<b>strike rate:</b> {{x.sr}} {{/x.sr}} " ``` but in parsed html file, braces , content within ignored:
<pre><code class="r">tpl <- " <b>against:</b> <br/> <b>venue:</b> <br/> <b>match:</b> <br/> <b>score:</b> <br/> <b>result:</b> <span class=></span><br/> " </code></pre> it not convenient straight write html in rmd file codes. alternative results='asis' in knitr affecting output not code chunk.
is there solution deal {{ , }} in code chunk? thanks.
slidify expands mustache tags default. there undocumented feature allow pass these tags untouched. here simple example
--- .raw template ```{r} {{ myvariable }} ``` so add together .raw class property slide want behavior.
r markdown knitr slidify
Comments
Post a Comment