\Rightarrow 或 \implies 的双头版本

\Rightarrow 或 \implies 的双头版本

我正在寻找\Rightarrow带有两个箭头的变体,例如\右箭头,称其为。也\RightArrow需要一个类似的符号。提前致谢。\LeftArrow

我的第一次尝试是:

\def\RightArrow{\Rightarrow\makebox{\hspace*{-13pt}$\Rightarrow$}}

编辑:

在最好的情况下,我希望新符号\RightArrow和 一样漂亮且比例匀称\Rightarrow。如果这不可行,那么我将寻求比我第一次尝试更好的解决方案。谢谢。

答案1

这是一个基于 Ti 的解决方案Z,并受到启发Heiko Oberdiek 的解决方案。我已定义\Implies\Impliedby以方便使用,并具有正确的间距。此解决方案适用于上标/下标中使用的较小字体。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs}
\usetikzlibrary{arrows.meta}
\usepackage{amsmath}
\begin{document}

\makeatletter

\newcommand*{\RightArrow}{\mathrel{\mathpalette{\@RightArrow}{}}}
\newcommand*{\LeftArrow}{\mathrel{\mathpalette{\@LeftArrow}{}}}

\newcommand*{\@RightArrow}[1]{%
    % Get the line width for this math style
    \edef\@LineWidth{%
        \the\fontdimen8
        \ifx#1\displaystyle\textfont
        \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont
        \fi\fi\fi
        3}
    \edef\@ScaleWidth{%
        \ifx#1\displaystyle0.39
        \else\ifx#1\textstyle0.39
        \else\ifx#1\scriptstyle0.35
        \else0.31
        \fi\fi\fi}
    \text{$\tikz
    \draw[double equal sign distance, line width=\@LineWidth,
    -{Implies[sep=-0.5ex] . Computer Modern Rightarrow[scale width=\@ScaleWidth, scale length=0.8]}]
    (0,0) -- (1.5em,0);$}}

\newcommand*{\@LeftArrow}[1]{%
    % Get the line width for this math style
    \edef\@LineWidth{%
        \the\fontdimen8
        \ifx#1\displaystyle\textfont
        \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont
        \fi\fi\fi
        3}
    \edef\@ScaleWidth{%
        \ifx#1\displaystyle0.39
        \else\ifx#1\textstyle0.39
        \else\ifx#1\scriptstyle0.35
        \else0.31
        \fi\fi\fi}
    \text{$\tikz
    \draw[double equal sign distance, line width=\@LineWidth,
    -{Implies[sep=-0.5ex] . Computer Modern Rightarrow[scale width=\@ScaleWidth, scale length=0.8]}]
    (1.5em,0) -- (0,0);$}}

\makeatother

\newcommand*{\Implies}{\DOTSB\;\RightArrow\;}
\newcommand*{\Impliedby}{\DOTSB\;\LeftArrow\;}
\[
    a \implies b \qquad a \Implies b \qquad a \Impliedby b
\]
\[
    x^{a \implies b} \qquad x^{a \Implies b} \qquad x^{a \Impliedby b}
\]
\[
    x^{x^{a \implies b}} \qquad x^{x^{a \Implies b}} \qquad x^{x^{a \Impliedby b}}
\]
\end{document}

结果

应该可以简化此代码,避免冗余代码,但我对 TeX 编程的熟练程度还不够。


替代解决方案

该解决方案使用相等的箭头,正如原始海报所要求的那样。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs}
\usetikzlibrary{arrows.meta}
\usepackage{amsmath}
\begin{document}

\makeatletter

\newcommand*{\RightArrow}{\mathrel{\mathpalette{\@RightArrow}{}}}
\newcommand*{\LeftArrow}{\mathrel{\mathpalette{\@LeftArrow}{}}}

\newcommand*{\@RightArrow}[1]{%
    % Get the line width for this math style
    \edef\@LineWidth{%
        \the\fontdimen8
        \ifx#1\displaystyle\textfont
        \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont
        \fi\fi\fi
        3}
    \text{$\tikz
    \draw[double equal sign distance, line width=\@LineWidth,
    -{Implies[sep=-0.35ex] . Implies}]
    (0,0) -- (1.5em,0);$}}

\newcommand*{\@LeftArrow}[1]{%
    % Get the line width for this math style
    \edef\@LineWidth{%
        \the\fontdimen8
        \ifx#1\displaystyle\textfont
        \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont
        \fi\fi\fi
        3}
    \text{$\tikz
    \draw[double equal sign distance, line width=\@LineWidth,
    -{Implies[sep=-0.35ex] . Implies}]
    (1.5em,0) -- (0,0);$}}

\makeatother

\newcommand*{\Implies}{\DOTSB\;\RightArrow\;}
\newcommand*{\Impliedby}{\DOTSB\;\LeftArrow\;}
\[
    a \implies b \qquad a \Implies b \qquad a \Impliedby b
\]
\[
    x^{a \implies b} \qquad x^{a \Implies b} \qquad x^{a \Impliedby b}
\]
\[
    x^{x^{a \implies b}} \qquad x^{x^{a \Implies b}} \qquad x^{x^{a \Impliedby b}}
\]

\end{document}

替代解决方案的结果

答案2

这里有两种解决方案,部分或全部基于 中的字形mathabx

\documentclass{article}
 \usepackage{amssymb, mathtools}
\usepackage{graphicx} 
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{ <-6> matha5 <6-7> matha6 <7-8>
matha7 <8-9> matha8 <9-10> matha9 <10-12> matha10 <12-> matha12 }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}

\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{ <-6> matha5 <6-7> matha6 <7-8>
mathb7 <8-9> mathb8 <9-10> mathb9 <10-12> mathb10 <12-> mathba12 }{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
%
\DeclareMathSymbol{\ggcurly}{\mathrel}{mathb}{"CF}
\DeclareMathSymbol{\gcurly}{\mathrel}{mathb}{"A1}
\DeclareMathSymbol{\varRightarrow}{\mathrel}{matha}{"F1}
\DeclareMathSymbol{\varRelbar}{\mathrel}{matha}{"F9}

\newcommand\RightArrow{\mathrel{\Relbar\mkern-10.5mu\raisebox{0.05ex}{\scalebox{0.9}{$ \ggcurly $}}}}
\newcommand\varRightArrow{\mathrel{\varRightarrow\mkern-11mu\raisebox{0.06ex}{\scalebox{0.8}[0.89]{$ \gcurly $}}}}

\newcommand\LongRightArrow{\mathrel{\Relbar\mkern-2.8mu\Relbar\mkern-10.5mu\raisebox{0.05ex}{\scalebox{0.9}{$ \ggcurly $}}}}
\newcommand\varLongRightArrow{\mathrel{\varRelbar\mkern-2.8mu\varRightarrow\mkern-11mu\raisebox{0.06ex}{\scalebox{0.8}[0.89]{$ \gcurly $}}}}


\begin{document}

\begin{alignat*}{2}%
A & \RightArrow B &\qquad A & \LongRightArrow B\\
 A & ⇒ B & A & \Longrightarrow B\\%
A & \varRightArrow B & A & \varLongRightArrow B\\
 \end{alignat*}

 \end{document} 

在此处输入图片描述

答案3

重叠箭头:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\joinarrows}{\mathrel{\mspace{-14mu}}}

\newcommand{\Tworightarrow}{\Rightarrow\joinarrows\Rightarrow}
\newcommand{\Twoleftarrow}{\Leftarrow\joinarrows\Leftarrow}
\newcommand{\Twoleftrightarrow}{%
  \Leftarrow\joinarrows\Leftarrow
  \joinarrows
  \Rightarrow\joinarrows\Rightarrow
}
\newcommand{\Twolongrightarrow}{\Longrightarrow\joinarrows\Rightarrow}
\newcommand{\Twolongleftarrow}{\Leftarrow\joinarrows\Longleftarrow}
\newcommand{\Twolongleftrightarrow}{%
  \Leftarrow\joinarrows\Longleftarrow
  \joinarrows
  \Rightarrow\joinarrows\Rightarrow
}

\begin{document}

\begin{gather*}
\Tworightarrow \quad \Twoleftarrow \quad \Twoleftrightarrow \\
\Twolongrightarrow \quad \Twolongleftarrow \quad \Twolongleftrightarrow
\end{gather*}

\end{document}

在此处输入图片描述

答案4

这样做可以吗:

\documentclass{article}

\usepackage{amsmath}
\newcommand{\LeftArrow}{\ensuremath{\ll\!\!\!=\!\!=}}
\newcommand{\RightArrow}{\ensuremath{=\!\!=\!\!\!\gg }}
\begin{document}

\[ A\RightArrow B\]
\[ C\LeftArrow D\]

\end{document}

输出:

在此处输入图片描述

相关内容