4

This question already has an answer here:

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.

Barker & Shan, Continuations and Natural Language. OUP.

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    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
8

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} 

enter image description here

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} 

enter image description here

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

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}

enter image description here

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}

enter image description here

  • 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
  • 1
    @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
  • 2
    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
  • 1
    @HaraldHanche-Olsen It is certainly a best practice, and I will make an edit. – Steven B. Segletes Aug 16 at 14:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.