答案1
\circ
这是一种可能性,即从和\bullet
一起创建箭头\rightarrow
以及进行一些剪辑和调整大小。
创建了两个宏:\ovec{}
和\cvec{}
用于“开放”和“封闭”向量。请注意,目前这对下标不起作用。其他字体可能需要调整。
代码如下:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{calc} % for subtracting lengths
\usepackage{adjustbox} % \adjustbox, \clipbox, \scalebox
\newcommand{\oarrow}{\scalebox{.4}{$\circ\hspace{-.42em}\rightarrow$}}
\newcommand{\ovec}[1]{\settoheight{\myheight}{\ensuremath{#1}}%
\adjustbox{raise=.5pt+\myheight,rlap}{%
\clipbox*{0 0 {.3em} {1.1\height}}{$\oarrow$}%
\resizebox{\widthof{\ensuremath{#1}}-.5em}{\height}
{\clipbox*{{.3em} 0 {\width-.2em} {1.5\height}}{$\oarrow$}}%
\clipbox*{{\width-.2em} {-.5ex} {\width} {1.5\height}}{$\oarrow$}%
}#1}
\newcommand{\carrow}{\scalebox{.4}{$\bullet\hspace{-.42em}\rightarrow$}}
\newcommand{\cvec}[1]{\settoheight{\myheight}{\ensuremath{#1}}%
\adjustbox{raise=.5pt+\myheight,rlap}{%
\clipbox*{0 0 {.3em} {1.1\height}}{$\carrow$}%
\resizebox{\widthof{\ensuremath{#1}}-.5em}{\height}
{\clipbox*{{.3em} 0 {\width-.2em} {1.5\height}}{$\carrow$}}%
\clipbox*{{\width-.2em} {-.5ex} {\width} {1.5\height}}{$\carrow$}%
}#1}
\newlength{\myheight}
\begin{document}
$\ovec{x}\quad\ovec{xy}$
$\cvec{x}\quad\cvec{xy}$
\end{document}
另一种使用方式TikZ
更加简单,并且能够提供更大的灵活性:
您可以更改Stealth
为不同的箭头形状,调整大小、高度、粗细、颜色等。您可以使用它Computer Modern Rightarrow[slant=.25, angle=80:1.5pt]
来获得与默认箭头很好的近似值\vec
。
\vec
以下是使用模仿和稍大的空心圆 ( )的图像open,length=1.7pt
:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\tikzset{myarrow/.tip={Stealth[length=2pt]}}
%\tikzset{myarrow/.tip={Computer Modern Rightarrow[slant=.25, angle=80:1.5pt]}} % similar to \vec
\newcommand{\cvec}[1]{\tikz[baseline, anchor=base]{
\node[inner sep=0pt, outer sep=1pt](A){$#1$};
\draw[{Circle[length=1.5pt]}-myarrow]
([shift={(1.1pt,1pt)}]A.north west)--([shift={(-1.1pt,1pt)}]A.north east);}}
\newcommand{\ovec}[1]{\tikz[baseline, anchor=base]{
\node[inner sep=0pt, outer sep=1pt](A){$#1$};
\draw[{Circle[open,length=1.5pt]}-myarrow]
([shift={(1.1pt,1pt)}]A.north west)--([shift={(-1.1pt,1pt)}]A.north east);}}
\begin{document}
Vector \cvec{x}. Vector \cvec{xy}.
Vector \ovec{x}. Vector \ovec{xy}.
\end{document}