xdashmapsto で矢印を書くにはどうすればいいですか?

xdashmapsto で矢印を書くにはどうすればいいですか?

これはこの質問双有理幾何学に必要な矢印について、同じ基本的な前提でこの質問xdashrightarrowなどについて

のような矢印が必要ですxmapstoが、mapsto矢印は破線です。現在、

\def\dashmapsto{\mapstochar\dashrightarrow}

矢印が表示されますdashmapsto。 が付いていれば嬉しいですxdashmapsto

ご協力いただければ幸いです。

答え1

私は、あなたが引用した 2 つの回答を、Heiko のコードに適用した David のテクニックを使って組み合わせただけです。その功績は David に帰属します。以下は、Heiko のコードに私が追加した部分です。

\newcommand\xdashmapsto[2][]{\mathrel{\mapstochar\xdashrightarrow[#1]{#2}}}

唯一のひねりは、 が使用するのと同じ方法で引数を使用することを覚えておくことです\xdashrightarrow

\documentclass{article}
\usepackage{amsfonts}
\usepackage{amsmath}
\newcommand\xdashmapsto[2][]{\mathrel{\mapstochar\xdashrightarrow[#1]{#2}}}

\makeatletter
\newcommand*{\da@rightarrow}{\mathchar"0\hexnumber@\symAMSa 4B }
\newcommand*{\da@leftarrow}{\mathchar"0\hexnumber@\symAMSa 4C }
\newcommand*{\xdashrightarrow}[2][]{%
  \mathrel{%
    \mathpalette{\da@xarrow{#1}{#2}{}\da@rightarrow{\,}{}}{}%
  }%
}
\newcommand{\xdashleftarrow}[2][]{%
  \mathrel{%
    \mathpalette{\da@xarrow{#1}{#2}\da@leftarrow{}{}{\,}}{}%
  }%
}
\newcommand*{\da@xarrow}[7]{%
  % #1: below
  % #2: above
  % #3: arrow left
  % #4: arrow right
  % #5: space left 
  % #6: space right
  % #7: math style 
  \sbox0{$\ifx#7\scriptstyle\scriptscriptstyle\else\scriptstyle\fi#5#1#6\m@th$}%
  \sbox2{$\ifx#7\scriptstyle\scriptscriptstyle\else\scriptstyle\fi#5#2#6\m@th$}%
  \sbox4{$#7\dabar@\m@th$}%
  \dimen@=\wd0 %
  \ifdim\wd2 >\dimen@
    \dimen@=\wd2 %   
  \fi
  \count@=2 %
  \def\da@bars{\dabar@\dabar@}%
  \@whiledim\count@\wd4<\dimen@\do{%
    \advance\count@\@ne
    \expandafter\def\expandafter\da@bars\expandafter{%
      \da@bars
      \dabar@ 
    }%
  }%  
  \mathrel{#3}%
  \mathrel{%   
    \mathop{\da@bars}\limits
    \ifx\\#1\\%
    \else
      _{\copy0}%
    \fi
    \ifx\\#2\\%
    \else
      ^{\copy2}%
    \fi
  }%   
  \mathrel{#4}%
}
\makeatother

\begin{document}

\[ X \xdashmapsto{x} Y \xdashmapsto{\mathrm{longer}} Z 
\xdashmapsto[\mathrm{underset}]{\mathrm{longer}} W 
\]

\end{document}

ここに画像の説明を入力してください

矢印の後のスペースが大きすぎると感じた場合は、小さな負のスペースで再定義することができます。

\newcommand\xdashmapsto[2][]{\mathrel{\mapstochar\xdashrightarrow[#1]{#2}\!}}

関連情報