The following minimal example works correctly within RStudio to generate a pdf beamer slide
---
output:
beamer_presentation:
latex_engine: "pdflatex"
---
##
\[
Z \not\!\perp\!\!\!\perp X
\]
Unfortunately it generates an error when using lualatex
or xelatex
engines (as for example below)
---
output:
beamer_presentation:
latex_engine: "lualatex"
---
##
\[
Z \not\!\perp\!\!\!\perp X
\]
The generated error is
! Missing { inserted.
<to be read again>
\mskip
l.100 \end{frame}
Any insights about what the problem might be and how to fix it?