4

I would like to obtain a symbol as generated by

\not\!\perp\!\!\!\perp

This does not compile in lualatex (see \! math symbol in R markdown to beamer with xelatex and lualatex failing )

Is there an alternative which will produce the same symbol in lualatex?

5
  • 1
    \documentclass{article}\begin{document}$\not\!\perp\!\!\!\perp$\end{document} runs without issue on my machine both with pdftex and lualatex.
    – campa
    Commented May 17 at 17:17
  • I am very well aware of the different engines. But my crystal ball tells me that you might be loading unicode-math.
    – campa
    Commented May 17 at 17:19
  • So there is no way of having both, is that so? Commented May 17 at 17:21
  • 1
    There might well be a solution, but this is why on this site we always ask for a minimal but complete example which reproduces the issue. I am pretty sure some user here can read minds but most of us cannot, so please help us helping you.
    – campa
    Commented May 17 at 17:23
  • There’s a reproducible example at the link I provided, this is why I didn’t duplicate it here. Unfortunately there’s no solution there, that’s why I asked again. Commented May 17 at 17:25

4 Answers 4

6

For pdflatex you can use

\documentclass{article}
\usepackage{amsmath}

\newcommand{\cind}{\mathrel{\perp\mspace{-9mu}\perp}}
\newcommand{\notcind}{\mathrel{\,\not\!\cind}}

\begin{document}

$A \cind B$

$A \notcind B$

\end{document}

enter image description here

This won't work with unicode-math, that defines differently \not.

There is \notaccent, but depending on the font it might not be the best choice.

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}

\newcommand{\cind}{\mathrel{\perp\mspace{-9mu}\perp}}
\makeatletter
\newcommand{\notcind}{\mathrel{\mathpalette\notcind@\relax}}
\newcommand{\notcind@}[2]{%
  \vphantom{\mathslash}%
  \ooalign{$\m@th#1\cind$\cr\hidewidth$\m@th#1\,\mathslash$\hidewidth\cr}%
}
\makeatother

\begin{document}

$A \cind B$

$A \notcind B$

\end{document}

enter image description here

Alternatively, you could borrow the symbol from another font, here NewComputerModern Math.

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}

\setmathfont{Latin Modern Math}
\setmathfont{NewComputerModernMath-Regular}[range="2AEB]
\setmathfont{Latin Modern Math}[range=]

\newcommand{\cind}{\Vbar}
\newcommand{\notcind}{\mathrel{\,\notaccent{\!\cind}}}

\begin{document}

$A \cind B$

$A \notcind B$

\end{document}

enter image description here

0
5

The newtxmath package, which is compatible with LuaLaTeX, provides a macro called \Perp, which can be negated via \not\Perp.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article} 
\usepackage{newtxmath} % for '\Perp' macro

\begin{document}
$A\Perp B \quad C\not\Perp D$
\end{document}
3

⫫ is U+2AEB which isn't in Latin Modern math but is in (for example) Stix2.

enter image description here

\documentclass{article}

\usepackage{unicode-math}
\setmathfont{STIX Two Math}
\begin{document}

$\not\Vbar$
\end{document}
3

A solution using notaccent

\documentclass{article}
\usepackage{amsmath,unicode-math}
\newcommand{\CI}{\mathrel{\perp\mspace{-10.5mu}\perp}}
\newcommand{\NCI}{\notaccent{\CI}}
\begin{document}
    \[
    A \NCI B \qquad A \CI B
    \]
\end{document}

enter image description here

2
  • Did you try with unicode-math and LuaLaTeX?
    – egreg
    Commented May 17 at 19:22
  • @egreg I totally forget to add back unicode-math. Updated answer for another viable solution using lualatex and unicode-math
    – Mane32
    Commented May 17 at 20:11

You must log in to answer this question.

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