答案1
和trimclip
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
%\usepackage{old-arrows}
\usepackage{graphicx}
\usepackage{trimclip}
\makeatletter
\newcommand{\dmapsto}{\mapstochar\mathrel{\mathpalette\dmapsto@\relax}}
\newcommand{\dmapsto@}[2]{%
\begingroup
\settowidth{\dimen\z@}{$\m@th#1\rightarrow$}%
\settoheight{\dimen\tw@}{$\m@th#1\rightarrow$}%
\sbox\z@{%
\makebox[\dimen\z@][s]{%
\clipbox{0 0 {0.4\width} 0}{\resizebox{\dimen\z@}{\height}{$\m@th#1\dashrightarrow$}}%
\hss
\clipbox{{0.69\width} {-0.1\height} 0 {-\height}}{$\m@th#1\rightarrow$}%
}%
}%
\ht\z@=\dimen\tw@ \dp\z@=\z@
\box\z@
\endgroup
}
\newcommand{\mmapsto}{%
\mathrel{\mspace{2mu}}\mapstochar\mathrel{\mspace{-2mu}}\mapsto
}
\begin{document}
\fboxsep=0pt\fboxrule=0.1pt
\fbox{$\dasharrow$}
\fbox{$\dmapsto$}\fbox{$\mapsto$}
$x \dmapsto y$
$x \mapsto y$
$x \mmapsto y$
\end{document}
dasharrow
的宽度被amssymb
缩放到与 一样宽\rightarrow
,但箭头尖端被剪掉并替换为标准箭头尖端。注意获取相同的边界框。
对于\mmapsto
,我们利用 的\mapstochar
宽度为零,因此我们可以将 设置为向右移动一个,然后返回并排版\mapsto
。