1

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?

2
  • 2
    well if you -- as the answer below suggests -- use unicode-math with lualatex, then you really shouldn't use \not\!\perp. \not expects a symbol as argument, see 5.5.10 Negations and the \not command in the unicode-math documentation. Commented Apr 8, 2022 at 12:33
  • How would you achieve the same result then? Commented Apr 9, 2022 at 13:18

1 Answer 1

2

This is not an answer. It is a tex MWE that reproduces the problem created by adding a negative thinskip \! when compiling with lualatex. \, and \; also generate Missing { inserted. Z \not\! and its variants, but \> does not generate an error.

% !TeX TS-program = lualatex
%%% !TeX TS-program = pdflatex

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifLuaTeX
\usepackage{unicode-math}
\fi
\begin{document}
% uncomment lines to generate "Missing { inserted. Z \not\!"
    \[
%   Z \not\!\perp X % No
%   Z \not\,\perp X % No
%   Z \not\;\perp X % No
    Z \not\>\perp X % Yes
    Z \! X          % Yes
    \]

\end{document}
1
  • 2
    Why has this gotten a downvote? Ross' too long for comment provides a much more suitable LaTeX MWE than having to go through R markdown
    – daleif
    Commented Apr 8, 2022 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .