0

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

Sandy G
  • 42,558
Tuatarian
  • 103

2 Answers2

1

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.

enter image description here

\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}

Sandy G
  • 42,558
1

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}

enter image description here

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).

egreg
  • 1,121,712