11

Similar to this question, but with the \xRightarrow instead. I tried changing the 3rd version to use \Rightarrow like so:

\documentclass{standalone}

\usepackage{amsmath}
\usepackage{amssymb} % for \diagup
\usepackage{mathtools}
\usepackage{tikz} % for tikz solution

\makeatletter
\def\slashedarrowfill@#1#2#3#4#5{%
  $\m@th\thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
   \relax#5#1\mkern-7mu%
   \cleaders\hbox{$#5\mkern-2mu#2\mkern-2mu$}\hfill
   \mathclap{#3}\mathclap{#2}%
   \cleaders\hbox{$#5\mkern-2mu#2\mkern-2mu$}\hfill
   \mkern-7mu#4$%
}

\def\rightslashedarrowfillc@{%
  \slashedarrowfill@\relbar\relbar{\raisebox{.12em}{\tiny/}}\Rightarrow}
\newcommand\xslashedrightarrowc[2][]{%
  \ext@arrow 0055{\rightslashedarrowfillc@}{#1}{#2}}
\makeatother

\begin{document}
    A \xslashedrightarrowc{abcdefg} C\\[12pt]
\end{document}

But I end up with this instead:

slashed arrows again

I'm assuming something's wrong with the def of \slashedarrowfill but I don't know enough to fix it. Could someone point me in the right direction please?

8

Heiko Oberdiek's centernot package comes in handy for that:

enter image description here

\documentclass{standalone}

\usepackage{centernot}
\usepackage{mathtools}

\begin{document}
$\centernot{\xRightarrow{sdfkjhsdf}}$
\end{document}
5

The following test file adds new macros \x(n)(Left|Right|Leftright)arrow similar to the definitions of package amsmath. The negated arrows use help macro \narrowfill@ with the symbol \neq in the middle of the stretchable area of the arrow.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand*{\xRightarrow}[2][]{%
  \ext@arrow 0359\Rightarrowfill@{#1}{#2}%
}
\newcommand*{\xLeftarrow}[2][]{%
  \ext@arrow 3095\Leftarrowfill@{#1}{#2}%
}
\newcommand*{\xLeftrightarrow}[2][]{%
  \ext@arrow 3399\Leftrightarrowfill@{#1}{#2}%
}

\newcommand*{\xnRightarrow}[2][]{%
  \ext@arrow 0359\nRightarrowfill@{#1}{#2}%
}
\newcommand*{\xnLeftarrow}[2][]{%
  \ext@arrow 3095\nLeftarrowfill@{#1}{#2}%
}
\newcommand*{\xnLeftrightarrow}[2][]{%
  \ext@arrow 3399\nLeftrightarrowfill@{#1}{#2}%
}

\newcommand*{\nRightarrowfill@}{%
  \narrowfill@\Relbar\Relbar\Rightarrow\neq
}
\newcommand*{\nLeftarrowfill@}{%
  \narrowfill@\Leftarrow\Relbar\Relbar\neq
}
\newcommand*{\nLeftrightarrowfill@}{%
  \narrowfill@\Leftarrow\Relbar\Rightarrow\neq
}

\newcommand*{\narrowfill@}[5]{%
  $\m@th\thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
  \relax#5#1\mkern-7mu%
  \cleaders\hbox{$#5\mkern-2mu#2\mkern-2mu$}\hfill
  \mkern-5mu %
  #4%
  \mkern-5mu %
  \cleaders\hbox{$#5\mkern-2mu#2\mkern-2mu$}\hfill
  \mkern-7mu#3$%
}
\makeatother

\begin{document}
\begin{align*}
  A &\xRightarrow[below]{above} B      & C &\xRightarrow{} D \\
  A &\xnRightarrow[below]{above} B     & C &\xnRightarrow{} D \\
  A &\xLeftarrow[below]{above} B       & C &\xLeftarrow{} D \\
  A &\xnLeftarrow[below]{above} B      & C &\xnLeftarrow{} D \\
  A &\xLeftrightarrow[below]{above} B  & C &\xLeftrightarrow{} D \\
  A &\xnLeftrightarrow[below]{above} B & C &\xnLeftrightarrow{} D
\end{align*}
\end{document}

Result

Remarks:

  • The height and depth of \neq is automatically taken into account and the superscript and subscript are moved to avoid clashes with the slash.
  • If package mathtools is needed, load it afterwards. It also defines \xLeftarrow, \xRightarrow, and \xLeftrightarrow, but IMHO the spacing of the versions of mathtools is too tight with possible visual clashes of the annotations with the arrow head.
3

The previous is solution somewhat buggy because you have to manually set the \kern length.
I would prefer to define a simple macro \NOT as in the following code:

\documentclass{standalone}
\usepackage{amsmath,amssymb}
\usepackage{mathtools}

\newlength{\NOTskip} 
\def\NOT#1{\settowidth{\NOTskip}{\ensuremath{#1}}%
            \hspace{0.5\NOTskip}\mathclap{\not}\hspace{-0.5\NOTskip}#1}

\begin{document}
\begin{equation*}
 A \NOT{\xRightarrow{bla}} C \NOT{\xleftarrow[\text{et caetera}]{}} Z
\end{equation*}
\end{document}

producing enter image description here

0

Edited: I'ld try something like this:

\kern.8em\not\kern -.8em \xRightarrow[ablalba]{}

Here in an example:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[ \kern.8em\not\kern -.8em \xRightarrow[Text goes here]{and here} \]
\end{document}

enter image description here

  • 1
    Hi oerpli: to make your answer more useful to future visitors, you could (1) mention that you need the mathtools package (or better yet: turn your code snippet into a complete, small .tex file), and (2) include an image showing the output. – John Wickerson Jul 15 '13 at 15:52
  • 1
    i've added a .tex file - image is not possible from my end at the moment. – oerpli Jul 15 '13 at 15:57
  • Your code as it is now, won't compile. Besides, it has unnecessary packages. You can reduce your code to \documentclass{article} \usepackage{mathtools} \begin{document} \[ \kern.8em\not\kern -.8em \xRightarrow[ablalba]{} \] \end{document}. – Gonzalo Medina Jul 15 '13 at 16:12

Your Answer

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 or ask your own question.