[Tex/LaTex] How to add a cross-out “/” to any latex symbol?

math-moderelation-symbolssymbols

I want to type something like this

enter image description here

How to add a / in a latex symbol in general? Like the \nexists, \notin.

Best Answer

There are many possible ways, here are three of them:

  1. a simple \not,
  2. \cancel,
  3. or a TikZy strike out.

Some people would call TikZ overkill, others just very flexible, in the end it is up to you to decide.

\documentclass{article}
\usepackage{cancel}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark,shapes.misc}
\begin{document}
$\in$ $\not\in$ $\cancel\in$ $\tikzmarknode[strike out,draw]{1}{\in}$

$B$ $\not B$ $\cancel{B}$ $\tikzmarknode[strike out,draw]{2}{B}$
\end{document}

enter image description here

As you can see, \not works only well for selected symbols. \cancel is arguably nicer but also not too easy to customize. Personally I would say that loading TikZ only for that might be too much, but if you are thinking of using it anyway, this might be a more flexible alternative to the more traditional approaches.