双线蕴涵、并存和一些近亲

双线蕴涵、并存和一些近亲

在我在这里找到的一些代码的帮助下,我成功地生成了我需要的箭头,即:

\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}

产生输出

箭

我现在无法生产双线这些相同箭头的版本。有人能帮忙吗?

答案1

在此处输入图片描述

\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}

相关内容