# Typesetting “hollow slash” [duplicate]

How can I typeset the hollow forward and backward slashes (in mathmode) as used in the attached image? They need to be used alongside normal forward and backward slashes.

## marked as duplicate by Werner, schtandard, Raaja, Phelype Oleinik, Stefan PinnowAug 17 at 6:15

• stmaryrd has \fatslash and \fatbslash, but I can never remember how it interacts with amssymb. – campa Aug 16 at 11:39
• Have a google on: latex double slash symbol. – albert Aug 16 at 11:40
• @campa If you change your comment to an answer I'll accept it. The spacing is a bit weird but that can be tweaked. – mattghg Aug 16 at 12:15
• Uhm, that's true, especially for \fatslash. The glyph isn't at all centred in its box: there is a huge space on the left, and the glyph protrudes on the right. That's quite strange... – campa Aug 16 at 12:25
• @campa stmaryrd plays well with amssymb. Agreed, the bounding box is very strange. – Andrew Swann Aug 16 at 14:24

These symbols are defined by the stmaryrd package under the names \fat(b)slash (the spacing for \fatslash is not so good):

\documentclass{article}

\usepackage{stmaryrd}

\begin{document}

$A\fatbslash B\qquad C \fatslash D$

\end{document}


Edit: as suggested by @AndrewSwann, we can have a much better spacing for \fatslash using this code:

\documentclass{article}

\usepackage{stmaryrd}
\newcommand{\myfatslash}{\mathbin{\mkern-6mu\fatslash}}

\begin{document}

$A\fatbslash B\qquad C\myfatslash D$

\end{document}


• +1 The spacing can be helped with \newcommand{\myfatslash}{\mathbin{\mkern-6mu\fatslash}} – Andrew Swann Aug 16 at 14:23

You can use \holwd to set the gap.

\documentclass[12pt]{article}
\usepackage{stackengine}
\newcommand\hollowslash{\setbox0=\hbox{/}\def\holwd{3pt}%
\stackengine{-.3pt}{/}{\rlap{\kern-1pt\rule{\holwd}{.4pt}}}{O}{r}{F}{F}{S}%
\kern\dimexpr\holwd-\wd0-.2pt\relax%
\stackengine{-.4pt}{/}{\llap{\rule{\holwd}{.4pt}\kern-1pt}}{U}{l}{F}{F}{S}%
}
\newcommand\hollowbackslash{\setbox0=\hbox{\textbackslash}\def\holwd{2.8pt}%
\stackengine{-.4pt}{\textbackslash}{\rlap{\kern-1pt\rule{\holwd}{.4pt}}}{U}{r}{F}{F}{S}%
\kern\dimexpr\holwd-\wd0-.2pt\relax%
\stackengine{-.3pt}{\textbackslash}{\llap{\rule{\holwd}{.4pt}\kern-1pt}}{O}{l}{F}{F}{S}%
}
\usepackage{amsmath}
\begin{document}
$C\hollowslash(A\hollowbackslash B)$
\end{document}


If you don't mind loading the graphicx package, you can use \reflectbox to cut down on the code. Here it is with \holwd set to 2pt:

\documentclass[12pt]{article}
\usepackage{stackengine}
\newcommand\hollowslash{\setbox0=\hbox{/}\def\holwd{2pt}%
\stackengine{-.3pt}{/}{\rlap{\kern-1pt\rule{\holwd}{.4pt}}}{O}{r}{F}{F}{S}%
\kern\dimexpr\holwd-\wd0-.2pt\relax%
\stackengine{-.4pt}{/}{\llap{\rule{\holwd}{.4pt}\kern-1pt}}{U}{l}{F}{F}{S}%
}
\newcommand\hollowbackslash{\reflectbox{\hollowslash}}
\usepackage{amsmath,graphicx}
\begin{document}
$C\hollowslash(A\hollowbackslash B)$
\end{document}


• Great and fantastic! – Sebastiano Aug 16 at 12:07
• Interesting, but I don't understand why your \dimexpr works. Isn't a \relax at the end a required part of the syntax? – Harald Hanche-Olsen Aug 16 at 14:07
• @HaraldHanche-Olsen I should add it, but I don't believe it is mandatory unless I start nesting things. The reason it is best practice is to cover those situations when you don't know in advance what will follow. If what follows just happened to be +3pt, that would get sucked into the \dimexpr unexpectedly. I knew that \stackengine, which actually follows the dimensional calculation, would not be confused for a dimensional operation. – Steven B. Segletes Aug 16 at 14:12
• OK. I just looked it up, and it says \dimexpr⟨dimen expr⟩⟨optional spaces and \relax⟩, which makes it clear that the \relax is also optional. I have clearly been too hasty reading the docs. – Harald Hanche-Olsen Aug 16 at 14:13
• @HaraldHanche-Olsen It is certainly a best practice, and I will make an edit. – Steven B. Segletes Aug 16 at 14:14