I'm looking for a way to strike out an arrow in the same style (or idiscernible) as predefined struck arrows, with short, slightly-oblique segments, like for instance \nrightarrow
. Using \not
or \cancel
unfortunately yields awful results.
[Tex/LaTex] Strike out an arrow with a small oblique segment like with \nrightarrow
amsmathmath-modestrikeoutsymbols
Related Question
- Math Mode Color – How to Strike Through or Cancel Using Different Colors in the Same Line
- [Tex/LaTex] Strike out over graphics
- Symbols – How to Create Big Fat Green Arrow Like in Excel
- [Tex/LaTex] Special vector over text (half head of the arrow, vertically compact)
- Math Mode – Achieving a Proper Double-Struck One Using Amsmath
Best Answer
New answer (better)
I've come up with a better way to do this. Because the slash created by
\not
is too long I'm using rotated versions of shorter horizontal lines instead. I'm doing this rather than scaling the slash created by\not
to match the thickness of the original line (without spoiling the round caps).I'm defining four macros below that cross out a relational symbol:
\Neg[<shift>]{<symbol>}
just uses\not
;\sNeg[<shift>]{<symbol>}
uses a rotated-
;\ssNeg[<shift>]{<symbol>}
uses two rotated\dabar@
s;\sssNeg[<shift>]{<symbol>}
uses one rotated\dabar@
;\Neg
matches the slash produced by\not
,\sNeg
matches that in\nRightarrow
,\ssNeg
matches that in\nrightarrow
and\sssNeg
just creates a really short slash. If an optional argument is provided the slash will be shifted to the right by this amount. Note however that<shift>
is a length inmu
, so it has to be of the form<number>mu
(N.B.18mu
is equal to1em
, except it scales in\scriptstyle
and\scriptscriptstyle
).(The character produced by
\dabar@
is a short horizontal rule (with rounded ends) that is (I think) only used in the definition of\dashrightarrow
. I wanted to use\shortmid
, but this character isn't vertically centred (which means I would have to manually adjust its vertical position).)This code produces an (incomplete) list of negated arrows:
A few notes
\Neg
because\neg
already exists (it produces a "¬").\mathpalette
to ensure that the symbol scales properly in sub-/superscripts etc.\ooalign
(cf. this answer) to superimpose\not\mathrel{\phantom{=}}
and these arrows.\rotatebox
fromgraphicx
to rotate horizontal lines by 60º. You can change this number if you want.\phantom{=}
in\negslash
is necessary because while\not
itself has no width, it is (I believe) designed to match the width of the=
character.(Digression: It's kind of odd that
\nrightarrow
has a significantly smaller arrowhead than\rightarrow
, and the same is true for a couple of the otheramssymb
arrows. I've personally never really liked the rather wide arrowheads of the Computer Modern maths font, so it would've been nice if they had also included a version of\rightarrow
with a smaller head.)Old answer (obsolete)
In my old answer I superimposed a
\scriptstyle
or\scriptscriptstyle
slash on top of the arrow. The result didn't look as good and didn't work in e.g. sub-/superscripts. It worked the same otherwise.