2

With the help of some code that I found here I have managed to produce the arrows I was in need of, namely:

\documentclass{article}

\usepackage{amsmath}

\usepackage{tikz}

% new arrow tip
\newdimen\arrowsize 
\pgfarrowsdeclare{arcs'}{arcs'}{...} 
{ 
  \arrowsize=0.5pt 
  \advance\arrowsize by .5\pgflinewidth 
  \pgfsetdash{}{0pt} % do not dash 
  \pgfsetroundjoin   % fix join 
  \pgfsetroundcap    % fix cap 
  \pgfpathmoveto{\pgfpoint{-4\arrowsize}{4\arrowsize}} 
  \pgfpatharc{180}{270}{4\arrowsize} 
  \pgfpatharc{90}{180}{4\arrowsize} 
  \pgfusepathqstroke 
}
% new arrows for IMPLICATION, COIMPLICATION, and some close relatives
\makeatletter
\newbox\xrat@below
\newbox\xrat@above
\newcommand{\imparrow}[2][]{%
  \setbox\xrat@below=\hbox{\ensuremath{\scriptstyle #1}}%
  \setbox\xrat@above=\hbox{\ensuremath{\scriptstyle #2}}%
  \pgfmathsetlengthmacro{\xrat@len}{max(\wd\xrat@below,\wd\xrat@above)+.6em}%
  \mathrel{\tikz [->,>=arcs',baseline=-.5ex,line width=.6pt]
                 \draw (0,0) -- node[below=-2pt] {\box\xrat@below}
                                node[above=-2pt] {\box\xrat@above}
                       (\xrat@len,0) ;}}
\makeatother
\newcommand{\impl}{\mathrel{\imparrow[\phantom{\text{--}}]{}}}
\newcommand{\invimpl}{\mathrel{\reflectbox{$\imparrow[\phantom{\text{--}}]{}$}}}
%
\makeatletter
\newbox\xrat@below
\newbox\xrat@above
\newcommand{\coimparrow}[2][]{%
  \setbox\xrat@below=\hbox{\ensuremath{\scriptstyle #1}}%
  \setbox\xrat@above=\hbox{\ensuremath{\scriptstyle #2}}%
  \pgfmathsetlengthmacro{\xrat@len}{max(\wd\xrat@below,\wd\xrat@above)+.65em}%
  \mathrel{\tikz [>-,>=arcs',baseline=-.5ex,line width=.6pt]
                 \draw (0,0) -- node[below=-2pt] {\box\xrat@below}
                                node[above=-2pt] {\box\xrat@above}
                       (\xrat@len,0) ;}}
\makeatother
\newcommand{\coimpl}{\mathrel{\;\coimparrow[\phantom{\text{}}]{}}}
\newcommand{\invcoimpl}{\mathrel{\reflectbox{$\;\coimparrow[\phantom{\text{}}]{}$}}}
%
\makeatletter
\newbox\xrat@below
\newbox\xrat@above
\newcommand{\biimparrow}[2][]{%
  \setbox\xrat@below=\hbox{\ensuremath{\scriptstyle #1}}%
  \setbox\xrat@above=\hbox{\ensuremath{\scriptstyle #2}}%
  \pgfmathsetlengthmacro{\xrat@len}{max(\wd\xrat@below,\wd\xrat@above)+.3em}%
  \mathrel{\tikz [>-<,>=arcs',baseline=-.5ex,line width=.6pt]
                 \draw (0,0) -- node[below=-2pt] {\box\xrat@below}
                                node[above=-2pt] {\box\xrat@above}
                       (\xrat@len,0) ;}}
\makeatother
\newcommand{\biimpl}{\mathrel{\,\biimparrow[\phantom{\text{}}]{}\,}}
%
\makeatletter
\newbox\xrat@below
\newbox\xrat@above
\newcommand{\cobiimparrow}[2][]{%
  \setbox\xrat@below=\hbox{\ensuremath{\scriptstyle #1}}%
  \setbox\xrat@above=\hbox{\ensuremath{\scriptstyle #2}}%
  \pgfmathsetlengthmacro{\xrat@len}{max(\wd\xrat@below,\wd\xrat@above)+.72em}%
  \mathrel{\tikz [<->,>=arcs',baseline=-.5ex,line width=.6pt]
                 \draw (0,0) -- node[below=-2pt] {\box\xrat@below}
                                node[above=-2pt] {\box\xrat@above}
                       (\xrat@len,0) ;}}
\makeatother
\newcommand{\cobiimpl}{\mathrel{\cobiimparrow[\phantom{\text{-}}]{}}}


\begin{document}

\LARGE 

$\alpha\to\beta$ / $\alpha\Leftrightarrow\beta$\bigskip

% Implication
$\alpha \impl \beta$

% Converse implication
$\alpha \invimpl \beta$

% Coimplication
$\alpha \coimpl \beta$

% Converse coimplication
$\alpha \invcoimpl \beta$

$\alpha \biimpl \beta$

$\alpha \cobiimpl \beta$

\end{document}

producing the output

arrows

I am now having trouble to produce double-line versions of these same arrows. Could anyone help?

  • 2
    Welcome to TeX.se Instead of posting code fragments, could you please wrap your fragments into a complete compilable document. Also, it would be nice add a link to the original question too. – Alan Munn Mar 26 '18 at 15:07
3

enter image description here

\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz,xparse,xstring}
\usetikzlibrary{calc}


\newcommand{\MyArc}[1][1]{%
    \begin{scope}[#1]
        \fill[white]
            (0,0) arc (270:180:4*\ArW) -- (0,4*\ArW) -- cycle ;
        \draw   (0,0) arc (270:180:4*\ArW) ;
        \fill[white]
            (0,0) arc (90:180:4*\ArW) -- (0,-4*\ArW) -- cycle ;
        \draw (0,0) arc (90:180:4*\ArW) ;
    \end{scope}
}

\newcommand{\MyArcRv}[1][1]{%
    \begin{scope}[#1]
        \fill[white] (0,4*\ArW) arc (0:-90:4*\ArW)
            arc (90:0:4*\ArW) -- cycle ;
        \draw (0,4*\ArW) arc (0:-90:4*\ArW)
            arc (90:0:4*\ArW) ;
    \end{scope}
}


\tikzset{%
    Arrow width/.store in=\ArW,
    Arrow width=.5pt,
    pics/.cd,
    arc east/.style={code = {\MyArc[xshift=.5*\pgflinewidth]}},
    arc west/.style={code = {\MyArc[rotate=180,xshift=.5*\pgflinewidth]}},
    arc rv east/.style={code = {\MyArcRv[xshift=.5*\pgflinewidth]}},
    arc rv west/.style={code = {\MyArcRv[rotate=180,xshift=.5*\pgflinewidth]}}
}


\NewDocumentCommand{\imparrow}{
    D<>{} % above
    O{1.4em} %length
    m % pattern
    D<>{} % below
    }{%
    \def\Law{}
    \def\Raw{}
    \def\Style{}
    \IfBeginWith{#3}{<}{\def\Law{pic{arc west}}}{}
    \IfBeginWith{#3}{>}{\def\Law{pic{arc rv west}}}{}
    \IfEndWith{#3}{>}{\def\Raw{pic{arc east}}}{}
    \IfEndWith{#3}{<}{\def\Raw{pic{arc rv east}}}{}
    \IfSubStr[1]{#3}{=}{\def\Style{double}}{}
    \tikz [baseline=-.5ex,line width=.4pt]
        \draw[\Style] (-3pt,0) (0,0) \Law
            -- node[below=-2pt] {#1} node[above=-2pt] {#4}
            (#2,0) \Raw
            ++(3pt,0);}

\begin{document}




\LARGE 

$\alpha\to\beta$ / $\alpha\Leftrightarrow\beta$\bigskip

$\alpha \imparrow{->} \beta$

$\alpha \imparrow{<->} \beta$

$\alpha \imparrow{<-} \beta$

$\alpha \imparrow{>-} \beta$

$\alpha \imparrow{-<} \beta$

$\alpha \imparrow{>-<} \beta$

$\alpha \imparrow{=>} \beta$

$\alpha \imparrow{<=>} \beta$

$\alpha \imparrow{<=} \beta$

$\alpha \imparrow{>=} \beta$

$\alpha \imparrow{=<} \beta$

$\alpha \imparrow{>=<} \beta$


\end{document}
| improve this answer | |
  • This looks great. Do you happen to know how to make these scalable so that it could be used as subscript or superscript by having it size automatically reduced? – J Marcos Mar 29 '18 at 12:24

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.