I'm trying to write a set subtraction operation in an AMS formatted template. In the end, what I want should look like A\B. But I'm doing this in math-mode $A\B$
and this gives me errors. I've also tried using the \diagdown
symbol, but it doesn't work either. Is there another way to do this?
1 Answer
\setminus
should be what you are after.
\documentclass{article}
\usepackage{amssymb} % for \smallsetminus
\begin{document}
\[ \mbox{setminus: } A \setminus B,\quad \mbox{smallsetminus: } A \smallsetminus B, \quad \mbox{backslash: } A \backslash B\]
\end{document}
Note that you can find more information here on How to look up a symbol?. In particular, you have the Comprehensive LaTeX symbols and the website Detexify. There is also this post which was mentioned earlier in a comment
-
5You can include also
$\backslash$
, which produces a different spacing, for comparison.– JLDiazDec 9, 2012 at 18:35 -
@JLDiaz Thanks for your comment, you are right, I will update my post.– CorentinDec 9, 2012 at 18:37
-
there is also
\smallsetminus
, available with\usepackage{amssymb}
, for those who prefer a smaller symbol (with the same meaning). Dec 9, 2012 at 18:38 -
\B
as a macro name (probably undefined). What about$A\backslash B$
?