title: Ryacas latex expression in Knitr
body: <p>I have the following RYacas expression:</p>
  
  <pre><code>longrun_cost &lt;- (c * mu) + h * ( lambda / (mu-lambda))
  </code></pre>
  
  <p>The latex expression of this is as follows :</p>
  
  <pre><code>fmt &lt;- sprintf("TeXForm(%s)", longrun_cost)
  yacas(fmt, retclass = "unquote")
  
  
  $c \mu  + \frac{h \lambda }{\mu  - \lambda } $
  </code></pre>
  
  <p>I want to be able to write this equation in a format that Knitr would understand, but the only solution was copy the latex expression to knitr as</p>
  
  <pre><code>$$c \mu  + \frac{h \lambda }{\mu  - \lambda } $$
  </code></pre>
  
  <p>When I compose an R chunk </p>
  
  <pre><code>```{r}
  longrun_cost &lt;- (c * mu) + h * ( lambda / (mu-lambda))
  fmt &lt;- sprintf("TeXForm(%s)", longrun_cost)
  yacas(fmt, retclass = "unquote")
  
  ```
  </code></pre>
  
  <p>It does not work. Any ideas? Thanks a lot!</p>