4

I basically want this symbol, but I want it to resize properly: While

X/\mkern-6mu/H

looks good, when I try to resize using \biggl, then the horizontal space between the two slashes becomes very large:

\biggl.X\biggl/\mkern-6mu\biggl/H\biggr.

Is there any solution to this? None of the suggestions in the original question resize properly.

Thanks a lot in advance!

4
  • By using biggl/ you are making / big. Corresponding spacing also will increase. Adjust \mkern value accordingly. But why should you use biggl/, I don't understand.
    – user11232
    Feb 23, 2014 at 14:03
  • You should use \big, not \bigl. Also \biggl. and \biggr. are completely useless.
    – egreg
    Feb 23, 2014 at 14:22
  • Picture a situation where X and H are replaced by something much larger. I do not see why biggl and biggr are completely useless. Can you elaborate? Feb 23, 2014 at 14:24
  • @JeskoHüttenhain What do you think \biggl. is doing?
    – egreg
    Feb 23, 2014 at 14:58

1 Answer 1

5

First of all, \biggl. and \biggr. do exactly nothing, except introduce unwanted opening and closing atoms (and, possibly, the relative spacing).

Second, \bigl/ makes the bigger / an opening atom, so you should use \big, instead.

Third, the bigger / has wider sidebearings than the normal size symbol. If you need it only at normal and \big size, here's a way:

\documentclass{article}
\usepackage{xparse}

\NewDocumentCommand{\dslash}{s}{%
  \IfBooleanTF{#1}
    {\big/\mkern-7mu\big/}
    {/\mkern-6mu/}%
}

\begin{document}
$X\dslash H$

$X\dslash* H$
\end{document}

enter image description here

If you want other sizes, then something more complex should be devised. Here's an example:

\documentclass{article}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\dslash}{O{}}
 {
  \str_case:nn { #1 }
   {
    {}{/\mkern-6mu/}
    {\big}{\big/\mkern-7mu\big/}
    {\Big}{\Big/\mkern-10mu\Big/}
    {\bigg}{\bigg/\mkern-14mu\bigg/}
    {\Bigg}{\Bigg/\mkern-18mu\Bigg/}
   }
 }
\ExplSyntaxOff

\begin{document}
$X\dslash H$

$X\dslash[\big] H$

$X\dslash[\Big] H$

$X\dslash[\bigg] H$

$X\dslash[\Bigg] H$
\end{document}

enter image description here

2
  • First of all, thanks. This is very help- and insightful. I have one more question, though: Is there any way to make this work with \left. and \right., in the sense that the \dslash is resized automatically? Feb 23, 2014 at 16:04
  • Actually, I think that this is a whole different question, so I made it one. Feb 23, 2014 at 16:21

You must log in to answer this question.

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