I don't like the appearance of \setminus (it's big and doesn't look good), and also don't like the appearence of \smallsetminus (its size is perfect but, in my opinion, it's too horizontal and it's not vertically center).

I found that in normal math this is what I can use:

    A \mathbin{\vcenter{\hbox{$\scriptscriptstyle\setminus$}}} B

Which looks like A \xsetminus B. But it's super thin. So I made the next one (I don't really now how many of those commands work, it has a lot of trial and error):

    A \mathbin{\vcenter{\hbox{$\scriptscriptstyle\mathrlap{\setminus}{\hspace{.2pt}\setminus$}}} B

Which looks more like A \xbsmallsetminus B.

At this point I got the desired thickness. But it's ugly if you zoom it, it's not well designed, and does not match the correct size if it's in a subscript (and less in a sub subscript).


Any ideas about how to redefine \setminus in order to get that orientation (the same as the usual \setminus), more or less the height is shown in the pictures and the same thickness of the usual \setminus (in all sizes: displaysytle, textstyle (the same as displaystyle), scriptstyle and scriptscriptstyle)?

I listen to all your ideas (including that ones where you try to convince me that the usual \setminus or \smallsetminus ar perfect).

EDIT: Here your are an example of how all looks (\setminus, my macro, \smallsetminus):


Here another example including @AndrewSwann \fgebackslash (\setminus, \smallsetminus, my macro, modified smaller \fgebackslash, \fgebackslash)


3 Answers 3


Given that you don't like the existing shapes in the available fonts, my other suggestion would be to use tikz to draw the symbol; you can then adjust all parameters and coordinates as you wish.

Sample output



\newcommand{\mysetminusD}{\hbox{\tikz{\draw[line width=0.6pt,line cap=round] (3pt,0) -- (0,6pt);}}}
\newcommand{\mysetminusS}{\hbox{\tikz{\draw[line width=0.45pt,line cap=round] (2pt,0) -- (0,4pt);}}}
\newcommand{\mysetminusSS}{\hbox{\tikz{\draw[line width=0.4pt,line cap=round] (1.5pt,0) -- (0,3pt);}}}



 A\setminus B \qquad A \mysetminus B \qquad
A\smallsetminus B 

\verb+\mysetminus+ in display, script and scriptscript styles
 A\mysetminus B\quad \scriptstyle A\mysetminus B \quad
\scriptscriptstyle A\mysetminus B


The code provides separate commands for displaystyle, textstyle, scriptstyle and scriptscriptstyle and uses \mathchoice to select the correct one. I have put the textstyle version equal to the displaystyle one. In the \tikz command you can now specify exactly which line to use and what width it should have. I have made the ends of the lines round, instead of square, with the line cap option. Finally, if neccessary you can specify a different bounding box for these characters by addingg the tikz construction

\useasboundingbox (-0.5pt,-0.5pt) rectangle (5pt,8pt);

with appropriate choices of coordinates. (This will avoid the \vcenter type juggling you have in your code.)

Addition If you are worried about the overhead of using a tikz command each time, which I don't think is high in this case, then you can instead of using newcommands use boxes as follows with \newsavebox, \sbox and \usebox:

\sbox{\mysetminusD}{\hbox{\tikz{\draw[line width=0.6pt,line cap=round]
(3pt,0) -- (0,6pt);}}}
\sbox{\mysetminusS}{\hbox{\tikz{\draw[line width=0.45pt,line
cap=round] (2pt,0) -- (0,4pt);}}}
\sbox{\mysetminusSS}{\hbox{\tikz{\draw[line width=0.4pt,line cap=round] (1.5pt,0) -- (0,3pt);}}}

  • 2
    I didn't know this: line cap=round. A new little question. With the other methods we are using letters or modified letters, but with this method we are using TikZ every time we write \mysetminus. I don't know if this is a real problem or not. But I would like to save the command into a glyph or letter (I don't know how to say that, like take a snapshot). If this is a silly thing just don't answer me. However, I like the answer.
    – Manuel
    Commented Dec 16, 2012 at 17:38
  • 1
    @Manuel I have updated my answer to include a version that saves the glyphs in boxes. Commented Dec 16, 2012 at 18:29
  • Mmm, sorry, but it's not perfect. I imagined that those saveboxes should work as I have in mind (but they don't, apart that you didn't know what I had in mind because I didn't explained well). My idea, when I say save to a glyph is that it scales with the font: in this case, if you write \Large at the beginning of the document, the \mysetminus doesn't scale and look small. Is possible to make it scale good?
    – Manuel
    Commented Dec 16, 2012 at 19:18
  • 4
    OK that is new information. If you retain the unsaved tikz version, then you can use em as units instead of pt. These following the scaling of the font. For the savedbox version, you could use the graphicx package and a scalebox command, appropriately adapted. Commented Dec 16, 2012 at 19:27

You could rotate \smallsetminus:


  \ifx#1\displaystyle .8\else
    \ifx#1\textstyle .8\else
      \ifx#1\scriptstyle .6\else

$A\rsetminus B_{A\rsetminus B_{A\rsetminus B}}$

enter image description here

  • 1
    Thanks for the great answer. This is more a kind of personal choice, but again this doesn't satisfy me at all. I would like the backslash to be smaller (like the pictures I posted). And if I substitute the \textstyle by the \scriptstyle we are again in the same problem (it's thinner than it should).
    – Manuel
    Commented Dec 15, 2012 at 17:30

As you are not happy with the standard choices I suggest you try the \fgebackslash from the fge package. Here it is in the middle between \setminus and \smallsetminus:

Sample output




\( A\setminus B \qquad A \mysetminus B \qquad
A\smallsetminus B \)

  • Thanks for the answer, but I don't like it. It's too thick and too tall. But at this moment, it's better than my solution because if you define \newcommand{\mysetminus}{\mathbin{\vcenter{\hbox{$\scriptstyle\fgebackslash$}}}} it is very similar and has the extra that it works in a subscript (with \scriptscriptstyle).
    – Manuel
    Commented Dec 15, 2012 at 14:01
  • 2
    Thinking a little bit more, if we could scale only x axis of the symbol we could get a thinner and perfect one. I will look around.
    – Manuel
    Commented Dec 15, 2012 at 17:34

You must log in to answer this question.

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