title: printing inline latex equations from variable in R, trouble with \beta
body: <p>I'd like to store a string of inline latex math in an r object, then output this string so that when rmarkdown is knitted, a latex equation is output in pdf.  I have an error when I include "\beta" in the string.  Here's the example:</p>
  
  <pre><code>---
  title: "Untitled"
  author: "Tedward"
  date: "February 12, 2015"
  output: pdf_document
  ---
  
  ```{r}
  b_0&lt;-"$\beta_0$" 
  ```
  
  `r b_0`
  </code></pre>
  
  <p>error: </p>
  
  <pre><code>&gt;output file: Test_beta.knit.md
  &gt;
  &gt;! Package inputenc Error: Keyboard character used is undefined
  &gt;(inputenc)                in inputencoding `utf8'.
  &gt;
  &gt;See the inputenc package documentation for explanation.
  &gt;Type  H &lt;return&gt;  for immediate help.
  &gt; ...                                              
  &gt;                                                  
  &gt;l.97 $^^H
  &gt;
  &gt;Try running pandoc with --latex-engine=xelatex.
  &gt;pandoc: Error producing PDF from TeX source
  &gt;Error: pandoc document conversion failed with error 43
  &gt;Execution halted
  </code></pre>
  
  <p>This is the same error I'd get if I have copied and pasted a beta character into the rmarkdown file.  I thought about (and tried for a bit) to change the encoding to so as to include beta as a character, but realized that wouldn't solve my problem.  I need the line of text to read $\beta$, not $β$.  I've tried modifying the string to not include "$" :</p>
  
  <pre><code>```{r}
  b_0&lt;-"\beta_0"
  ```
  
  $`r b_0`$
  </code></pre>
  
  <p>And the error is the same.  I think what I'm finding is that R is reading "\beta" and converting it into β, which is not what I want.</p>
  
  <p>What I'd like to be output is β with 0 as subscript.</p>
  
  <p>Please forgive my ignorance of how these things work (I'm not sure how r, rmarkdown, latex, knitr, and pandoc all interact to produce the final pdf).</p>
  
  <p>My ultimate objective is to create a large table that has latex equations (which include \beta) in it.  I'd like to store the equations as variables so they are easy to edit in one location.  If you know another way to achieve this, I'd appreciate it.  I imagine this is possible in LaTex, but I'm more experienced with rmarkdown and hence that's my preference.  My thinking/hope is that there's probably something simple that I'm missing here.</p>
  
  <p>I'm working in Rstudio (0.98.1091.) on os x 10.10.2, with R 3.0.3 </p>