I want to use bold Greek letters in R Markdown and modify a little example from R Markdown pdf_document2 PDF figure and table numbers by section, which reads as
---
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]$$
Then errors occur as follows
! Improper alphabetic constant.
<to be read again>
\mitalpha
l.93 \(\bm{\alpha}
\) and \(\bm{\beta}\)
How can I fix this problem? (PS: \bm in \usepackage{bm}; \boldsymbol in \usepackage{amsmath})