title: R Markdown pdf_document2 PDF bold greek letters
body: <p>I want to use bold Greek letters in R Markdown 
  and modify a little example from 
  <a href="https://stackoverflow.com/questions/53863797">R Markdown pdf_document2 PDF figure and table numbers by section</a>, which reads as</p>
  
  <pre><code>---
  title: "Testing Bold GreekLetters "
  author: "Authors"
  date: "January 2019"
  output:
    bookdown::pdf_document2:
      fig_caption: yes
      latex_engine: xelatex
      number_sections: true
      toc: yes
      toc_depth: 2
  editor_options:
    chunk_output_type: console
  link-citations: yes
  linkcolor: blue
  subparagraph: yes
  citecolor: blue
  urlcolor: blue
  header-includes:
    \usepackage{amsmath}
    \usepackage{bm}
  ---
  
  # test bold greek letters
  
  $\bm{\alpha}$ and $\bm{\beta}$
  
  $$T^{2}=\left[\overline{\mathbf{X}}_{1}-\overline{\mathbf{X}}_{2}-\left(\boldsymbol{\mu}_{1}-\boldsymbol{\mu}_{2}\right)\right]^{\prime}\left[\left(\frac{1}{n_{1}}+\frac{1}{n_{2}}\right) \mathbf{S}_{\text {pooled }}\right]^{-1}\left[\overline{\mathbf{X}}_{1}-\overline{\mathbf{X}}_{2}-\left(\boldsymbol{\mu}_{1}-\boldsymbol{\mu}_{2}\right)\right]$$
  </code></pre>
  
  <p>Then errors occur as follows</p>
  
  <pre><code>! Improper alphabetic constant.
  &lt;to be read again&gt; 
                  \mitalpha 
  l.93 \(\bm{\alpha}
                  \) and \(\bm{\beta}\) 
  </code></pre>
  
  <p>How can I fix this problem? (PS: <code>\bm</code> in <code>\usepackage{bm}</code>; <code>\boldsymbol</code> in <code>\usepackage{amsmath}</code>)</p>