I want to type the notation same as the below picture.
Asked
Active
Viewed 526 times
5
Sigur
- 37,330
Cao Thành Thái
- 333
-
I take it \overarc won't do. The Comprehensive Symbol List had nothing better. You could create one with TikZ. – John Kormylo May 01 '18 at 03:14
1 Answers
5
Here is an overkill proposal, based on TikZ, which is somewhat inspired by this post.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand{\overarcarrow}[1]{\ifmmode%
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {$#1$};
\draw [line width = 0.4pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
\else
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {#1};
\draw [line width = 0.4pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
\fi
}
\begin{document}
$\overline{AB}$ $\overarcarrow{AB}$ \overarcarrow{AB}
\end{document}
ADDENDUM: A special version for @John Kormylo.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand{\overarcarrow}[1]{\ifmmode\mathchoice{%
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {$\displaystyle#1$};
\draw [line width = 0.4pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
}{%
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {$\textstyle#1$};
\draw [line width = 0.4pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
}{%
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {$\scriptstyle#1$};
\draw [line width = 0.3pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
}{%
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {$\scriptscriptstyle#1$};
\draw [line width = 0.213pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
}
\else
\tikz [baseline = (N.base)] {
\node [inner sep = 0pt] (N) {#1};
\draw [line width = 0.4pt,-{Stealth[scale=0.6]}]
([xshift=0.1ex,yshift=0.3ex]N.north west) to[out=15,in=165]
([yshift=0.3ex]N.north east);
}
\fi
}
\begin{document}
$\overline{AB}$ $\overarcarrow{AB}$ \overarcarrow{AB}
$X_{\overarcarrow{AB}}$ $X_{Y_{\overarcarrow{AB}}}$
\end{document}
-
1Reformulate it for all 4 math styles using \mathchoice and it will be perfect ;-) – John Kormylo May 01 '18 at 04:05
-
1@JohnKormylo Thanks but I believe you're too optimistic, please see this answer. It is nontrivial to make the TikZ adopt the settings of the ambient world. – May 01 '18 at 04:10
-


