答案1
这是一个 Ti钾Z 解决方案具有内置的可扩展性和可选参数。您可以通过更改single arrow head extend
和调整箭头的大小和角度来调整箭头的大小和角度single arrow tip angle
\documentclass{article}
\usepackage{tikz, amsmath}
\usetikzlibrary {shapes.arrows}
\newcommand{\myarrow}[1][]{\mathrel{\tikz{
\node[fill, minimum width=.5ex, minimum height=.9em, inner sep=0pt, single arrow, single arrow head extend=2pt, single arrow tip angle=60]
(A){\raisebox{3.5pt}[0pt][0pt]{$\,\scriptstyle #1\ $}}; \path([xshift=-.4pt]A.west)--(A.east);}}}
\newcommand{\myarrowleft}[1][]{\mathrel{\tikz{
\node[fill, minimum width=.5ex, minimum height=.9em, inner sep=0pt, single arrow, single arrow head extend=2pt, single arrow tip angle=60, shape border rotate=180]
(A){\raisebox{3.5pt}[0pt][0pt]{$\ \scriptstyle #1\,$}}; \path(A.west)--([xshift=.4pt]A.east);}}}
\begin{document}
$A\to B\qquad A\xrightarrow{f\circ g}B$
$A\myarrow B\qquad A\myarrow[f\circ g] B$
$A\myarrowleft B\qquad A\myarrowleft[f\circ g] B$
\end{document}