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. \mskip l.100 \end{frame}
Any insights about what the problem might be and how to fix it?
\not\!\perp
.\not
expects a symbol as argument, see 5.5.10 Negations and the \not command in the unicode-math documentation.