如何定义新的钩箭?

如何定义新的钩箭?

我想使用以下钩箭头而不是通常的箭头:

在此处输入图片描述

它的尾部是数学命令subset。但进一步放大到这个(图片来自 Lee 光滑流形,第 563 页)它表明它已经以一种尴尬的方式组装起来(见下文): 在此处输入图片描述

我怎样才能在tikz-cd数学公式中或里面有这样的箭头?

答案1

类似这样的功能?tikz-cd允许您使用字形作为箭头尖。(我必须定义一个稍宽的版本,以避免符号被剪裁。)

\documentclass{article}  
\usepackage{tikz-cd}
\makeatletter
\pgfdeclarearrow{
  name=xGlyph,
  cache=false,
  bending mode=none,
  parameters={\tikzcd@glyph@len,\tikzcd@glyph@shorten},
  setup code={%
    \pgfarrowssettipend{\tikzcd@glyph@len\advance\pgf@x by\tikzcd@glyph@shorten}},
  defaults={
    glyph axis=axis_height,
    glyph length=+1.55ex,
    glyph shorten=+-0.1ex},
  drawing code={%
    \pgfpathrectangle{\pgfpoint{+0pt}{+-1.5ex}}{\pgfpoint{+\tikzcd@glyph@len}{+3ex}}%
    \pgfusepathqclip%
    \pgftransformxshift{+\tikzcd@glyph@len}%
    \pgftransformyshift{+-\tikzcd@glyph@axis}%
    \pgftext[right,base]{\tikzcd@glyph}}}
\makeatother    
\tikzset{
supset/.tip={xGlyph[glyph math command=supset,
    glyph axis=5.2pt]},
}
\begin{document}
\[\begin{tikzcd} 
 A \arrow[supset-latex,d]\\
 B \\
\end{tikzcd}\]
\end{document}

在此处输入图片描述

Mac 上预览时的最大缩放比例:

在此处输入图片描述

或者,您可以使用\pgfdeclarearrow来声明箭头。

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta}
\pgfdeclarearrow{
  name = shook,
  parameters = {\the\pgfarrowlength,\the\pgfarrowwidth},
  setup code = {
    % The different end values:
    \pgfarrowssettipend{\pgfarrowlength}
    \pgfarrowssetlineend{.01\pgfarrowlength}
    \pgfarrowssetvisualbackend{-.1\pgfarrowlength}
    \pgfarrowssetbackend{-.25\pgfarrowlength}
% The hull
    \pgfarrowshullpoint{\pgfarrowlength}{0pt} 
    \pgfarrowshullpoint{0pt}{-\pgfarrowwidth} 
    \pgfarrowssavethe\pgfarrowlength
  },
  drawing code = {
    \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
    \pgfpatharc{90}{-90}{\pgfarrowlength and \pgfarrowwidth/2}
    \pgfpathlineto{\pgfpoint{-\pgfarrowlength}{-\pgfarrowwidth}}
    \pgfusepathqstroke
},
  defaults = { length = 4pt,width=8pt}
}
\begin{document}
\begin{tikzpicture}
    \draw [shook-latex] (0,0) -- (0,-2);
    \draw [{shook[length=3pt]}-latex] (1,0) -- (1,-2);
    \draw [thick,{shook[length=3pt,width=7pt]}-latex] (2,0) -- (2,-2);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容