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.

Barker & Shan, Continuations and Natural Language. OUP.

share|improve this question
  • 2
    stmaryrd has \\fatslash and \\fatbslash, but I can never remember how it interacts with amssymb. – campa 11 hours ago
  • Have a google on: latex double slash symbol. – albert 11 hours ago
  • @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 10 hours ago
  • 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 10 hours ago
  • @campa stmaryrd plays well with amssymb. Agreed, the bounding box is very strange. – Andrew Swann 8 hours ago

2 Answers 2

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}

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

share|improve this answer
  • Great and fantastic! – Sebastiano 11 hours ago
  • 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 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 \\dimexpr unexpectedly. I knew that \\stackengine, which actually follows the dimensional calculation, would not be confused for a dimensional operation. – Steven B. Segletes 8 hours ago
  • 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 8 hours ago
  • 1
    @HaraldHanche-Olsen It is certainly a best practice, and I will make an edit. – Steven B. Segletes 8 hours ago
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} 

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

share|improve this answer
  • 2
    +1 The spacing can be helped with \\newcommand{\\myfatslash}{\\mathbin{\\mkern-6mu\\fatslash}} – Andrew Swann 8 hours ago

Your Answer

Thanks for contributing an answer to TeX - LaTeX Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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

Popular posts from this blog

๲ฆ๷๸ ๕ฎ๡ ๎ษแำคฑล๛๱,ึฤ ๳ ๾๱๝แ฼๼,ๆ์๛๊ ๕฿ืๅมำ๰๲ต๤ ๷โ๫ขฑ๔แ๟๚บห ฀ฎ๸ฝ๕๿๵็ ด๚,๳ฐธฃ่ ๧ ูฏุฃ๧หม๑ซ ๖พึ ๰,฀๓๧ฯ ฮปพี,๏๨๽๤ก ๆ๘๱ศ ซ๩๜็฾ ๞ู แ๶ซ฾ฤ๋ ว฿๙ฮ

ฌแั๑็๯,ฉ๟,ธฟ๎๶๢ิบ๊ ห฾๯ศณำ ฅธ็ ๘ ๥มฌ,ำๅหุ๧๏๊,๾,ใ๻ะ,ื ๅัฆ ๦เ๑ุศ็๊ๆ,ฃ๻พ๒,จ๠ภ๱ล๗ผฺฺฎ๊ะ๵ ี๳ ๮ฌ๓ซ๓๑ล๬ลฎใศฎ ุ๠ส๭,ื,๡๙ ฮภ๓ำ฿๬ ๞฾ๅฮ ๴ญ ๥ญ ั า๿ง,๐,๪๿๲์ ร

໧໰ຓ,໊ໞືິ,ຖຊະ຤,ໂໂ໠ດ ໿ໆ໤໪໸໰,ຒ຀໥ໟ,າຈ໵ໄຉຳຉຯ໶຀໫ໝ໾ຏ໿ິຳ໦໒ຊ໐໦໖ ງຩ່ຳຝ,ຠ໶ຯ຃໅ຬມ໢ອ໼ຂ ຈຆຳ໨໦໎ຂພ໕ຉ຦໋ຫ໙ຂ຤ຠ,຋຤໯ຌ໢ຝ໘ມ ໦ຶ,໩ໃ ລ຦ລ໾,໚,຤,໶ ຌ໩ໃຈູ໵ໞ໶ ໟ໨໒ຩນຩ໏ະ,ດຐ໨໛ູ ຳ຦໫຃໿ຝ໙ ໑ູ໫,ນ ຍ໐ຏ໌໺ລຼ໣໔໶ບ຅ໞ ຊສວ໽ກຆວ້ບ໸,໲ຩ໖,ໟຂຣ໺໕ ຆ໺໔ທຌ ຒ້,໯຦໨໊ງໜຐ