LaTeX - 可伸缩箭头

% 图1
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}
\newcommand\xrightrightarrow[1]{\mathrel{\raisebox{0.4mm}{\!\!
            \begin{tikzpicture}[>=stealth]
            \node[inner sep=1ex] (a) {$\scriptstyle #1$};
            \path[draw,<-] ($(a.south east)+(0,0)$) --($(a.south west)+(0,0)$);
            \path[draw,<-] ($(a.south east)+(0,0.109)$) --($(a.south west)+(0,0.109)$);
            \end{tikzpicture}}}}
\begin{document}    
\[A\xrightrightarrow{\quad I\quad}g(x)\]
\end{document}

图1效果图

% 图2
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usepackage{mathtools}
\usetikzlibrary{arrows}
\usepackage{xparse}
\NewDocumentCommand{\xrightleftarrow}{ O{}O{} }{%
  \mathrel{%
    \vcenter{
      \hbox{%
        \begin{tikzpicture}
          \node[minimum width=0.75cm,align=center] (a){\text{\vphantom{hg}#1}\\[0.3ex]\vphantom{hg}#2};
          \draw[-stealth] ([yshift=0.4ex]a.west) -- ([yshift=0.4ex]a.east);
          \draw[stealth-] ([yshift=-0.4ex]a.west) -- ([yshift=-0.4ex]a.east);
        \end{tikzpicture}
      }
    }%
  }\!\!%
}
\begin{document}
$A\xrightleftarrow B$ \quad
$C\xrightleftarrow[some text here] D$ \quad
$E\xrightleftarrow[][some text again] F$ \quad
$G\xrightleftarrow[some ght][some text again] H$
\end{document}

图2效果图

symbols-a4.pdf 其它宏包的长箭头 AMS Extensible Arrow

mathtools Extensible Arrows

chemarr Extensible Arrows

chemarrow Extensible Arrows

extarrows Extensible Arrows

extpfeil Extensible Arrows

DotArrow Extensible Arrows

转载于:https://my.oschina.net/shaodongtang/blog/2248961

  • 5
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值