12

What's the best way to get a "parallel reduction arrow" (as in the one used to show confluence of the $\lambda$-calculus, if that means anything)

Concretely I want an arrow with a // crossing the middle of it. Using || could also be acceptable.

Right now I have:

\newcommand{\rpbeta}{\mkern-7mu\centernot{\mkern7mu\centernot\rbeta}}

where \rbeta is $\longrightarrow_\beta$.

Giving something kind of OK, but spacing seems to vary each time I use it.

  • What is \rbeta, please? – yo' Feb 5 '17 at 19:45
  • Ah, sorry, $\longrightarrow_\beta$. – Guido Feb 5 '17 at 19:56
15

I would use my favourite \mathcenterto{#1}{#2} construct which allows you to center #1 over #2. One additional \mathclap makes the right-side slash centered and the left-side one adjacent to it.

enter image description here

\documentclass{article}

\pagestyle{empty}

\usepackage{mathtools}

\newcommand*\mathcenterto[2]{\mathclap{\phantom{#2}\mathclap{#1}}{#2}}
\newcommand*\rpbeta{\mathrel{\mathcenterto{\mathclap{/}/}{\longrightarrow}}_\beta}

\begin{document}

\[
A \rpbeta B
_{A \rpbeta B
_{A \rpbeta B
_{A \rpbeta B
}}}\]

\end{document}
3

You can emulate the working of \centernot:

\documentclass{article}

\makeatletter
\newcommand{\rpgeneric}[1]{\mathpalette\rp@generic{#1}}
\newcommand{\rp@generic}[2]{%
  \mathrel{%
    \rlap{%
      \settowidth\dimen@{$\m@th#1{\longrightarrow}$}%
      \kern.55\dimen@
      \settowidth\dimen@{$\m@th#1=$}%
      \kern-.53\dimen@
      $\m@th#1\not$%
      \kern-.3\dimen@
      $\m@th#1\not$%
    }%
    {\longrightarrow_{#2}}%
  }%
}
\makeatother
\newcommand{\rpbeta}{\rpgeneric{\beta}}

\begin{document}

$\rpbeta_{\rpbeta}$

\end{document}

enter image description here

2

In addition to the mathtools package, I would use amsmath.txfonts with the following code (however the fonts could create some other problems elesewhere in the text...)

\documentclass{article}
\usepackage{amsmath,txfonts}
\usepackage{mathtools}
\begin{document}
$\mathrlap{\longrightarrow}\varparallel$
\end{document}

enter image description here

  • Have you tried to actually use it? Like in $A\mathrlap{\longrightarrow}\varparallel B$? – yo' Feb 5 '17 at 23:09
  • Yeah, spacing looks a bit bad on this one. – Guido Feb 5 '17 at 23:28
  • I really don't understand how can someone upvote this answer. It's plain wrong as the spacing is completely off. This is unusable. – yo' Feb 6 '17 at 11:53
  • Note also that mathtools loads amsmath, so in your case having amsmath is redundant. – Torbjørn T. Feb 6 '17 at 12:05
  • 1
    Besides breaking the spacing, loading txfonts will change the appearance of the whole document. You wouldn't rebuild a house just for getting a new window, would you? – egreg Feb 6 '17 at 13:00

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.