I often use the intersection symbol with a line through it to denote disjoint sets when writing on paper or a whiteboard. However, I haven't found a way to do this in LaTex (just writing $\neg\cap$ results in a misaligned line). Does anyone know how I could fix this? I am very new to Latex so am unfamiliar with how to do anything
2 Answers
I assume you mean \not\cap, which I agree looks bad. Instead you could use the symbol \diagup, which requires the amssymb package. There are a variety of techniques for creating new characters by superimposing one character on another. See for example this question and its answers.
\documentclass{article}
\usepackage{amssymb}
\makeatletter
\newcommand{\disjoint}{\mathrel{\mathpalette\disj@int\relax}}
\newcommand{\disj@int}[2]{%
\ooalign{%
\hfil$\m@th#1\cap$\hfil\cr
\hfil$\m@th#1\diagup$\hfil\cr
}%
}
\makeatother
\begin{document}
$A\disjoint B$
\end{document}
- 42,558
Simple combination of \mathpalette and \ooalign.
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\disj}{\mathrel{\vphantom{\cap}\mathpalette\disj@\relax}}
\newcommand{\disj@}[2]{%
\ooalign{$\m@th#1\cap$\cr$\m@th#1\neg$\cr}%
}
\makeatother
\begin{document}
\begin{gather}
A\disj B
\
\bigcup_{A\disj B}C_A
\end{gather}
\end{document}
The “lucky” circumstance is that \neg and \cap have exactly the same width in the Computer Modern math fonts (one might not be so lucky with other fonts).
- 1,121,712


$\not\cap$? – Sandy G Dec 16 '23 at 15:01