Typesetting “hollow slash” be agico fo toh32ostm.jrchfcaate ne thman2.0d H
4
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.

symbols
|
show 2 more comments
2 Answers
active
oldest
votes
9
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 11 hours ago
-
Interesting, but I don't understand why your
\\dimexprworks. Isn't a\\relaxat the end a required part of the syntax? – Harald Hanche-Olsen 9 hours ago -
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\\dimexprunexpectedly. I knew that\\stackengine, which actually follows the dimensional calculation, would not be confused for a dimensional operation. – Steven B. Segletes 8 hours ago -
2OK. I just looked it up, and it says
\\dimexpr⟨dimen expr⟩⟨optional spaces and\\relax⟩, which makes it clear that the\\relaxis also optional. I have clearly been too hasty reading the docs. – Harald Hanche-Olsen 8 hours ago -
1@HaraldHanche-Olsen It is certainly a best practice, and I will make an edit. – Steven B. Segletes 8 hours ago
add a comment |
7
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}

-
2+1 The spacing can be helped with
\\newcommand{\\myfatslash}{\\mathbin{\\mkern-6mu\\fatslash}}– Andrew Swann 8 hours ago
add a comment |
stmaryrdhas\\fatslashand\\fatbslash, but I can never remember how it interacts withamssymb. – campa 11 hours agolatex double slash symbol. – albert 11 hours ago\\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 10 hours agostmaryrdplays well withamssymb. Agreed, the bounding box is very strange. – Andrew Swann 8 hours ago