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 &lt;- &quot; &lt;b&gt;against:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;venue:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;match:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;score:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;result:&lt;/b&gt; &lt;span class=&gt;&lt;/span&gt;&lt;br/&gt; &quot; </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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

ruby on rails - Devise Logout Error in RoR -