答案1
答案2
\documentclass{article}
\usepackage{stackengine,scalerel,graphicx}
\stackMath
\newcommand\that[1]{%
\setbox0=\hbox{$#1$}%
\ensurestackMath{%
\stackon[2pt]{\copy0}{\,\rotatebox{90}{\stretchto{\triangleright}{\dimexpr\wd0-3pt}}}%
}%
}
\begin{document}
$\that{ABC}\quad\that{mnopq}$
\end{document}
如果您需要跨数学风格(并且重叠差距略微减少):
\documentclass{article}
\usepackage{stackengine,scalerel,graphicx}
\stackMath
\newcommand\that[1]{\ThisStyle{%
\setbox0=\hbox{$\SavedStyle#1$}%
\ensurestackMath{%
\stackon[1.5\LMpt]{\copy0}{\,\rotatebox{90}{%
$\SavedStyle\stretchto{\triangleright}{\dimexpr\wd0-4pt}$}}%
}%
}}
\begin{document}
$\that{ABC}\quad\that{mnopq}$
$\scriptstyle\that{ABC}\quad\that{mnopq}$
$\scriptscriptstyle\that{ABC}\quad\that{mnopq}$
\end{document}
答案3
我尝试创建一个新命令来直接使用它。结果如下
\documentclass[border=0pt]{standalone}
\usepackage{stix, tikz}
\newcommand \overTrian[1]{\tikz{
\node[baseline= a.base, inner sep=0pt](a) {$#1$}; \coordinate[yshift=3pt] (top) at (a.north);
\draw([yshift=1pt]a.north east) -- ([yshift=1pt]a.north west)-- (top)--cycle ;}
}
\begin{document}
The triangle $\overTrian{ABC}$ is a right triangle.
\end{document}