7

I have been told that the standard notation for a triangle in Spain is enter image description here

Does any one know how to produce the ABC with the wide triangle over it on LateX?

  • 1
    Welcome. Think this may be a related post that will help? https://tex.stackexchange.com/questions/317498/making-triangular-hat – Tina Nov 14 '17 at 17:16
  • 1
    Whatever you end up doing, start by defining \newcommand*\triangulo[1]{\operatorname{triangulo}(#1)} or whatever definition, and use that throughout the document. Your code should be \triangulo{ABC}. That way the definition of the command can be changed when you get answers in this site, while your code will be left untouched and you will only need to alter the definition. – Manuel Nov 14 '17 at 17:20

3 Answers3

13

You can import the symbol from yhmath:

\documentclass{article}
\usepackage{amsmath}

\DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n}

\DeclareMathAccent{\widetriangle}{\mathord}{yhlargesymbols}{"E6}

\begin{document}

$\widetriangle{ABC}$

\end{document}

enter image description here

egreg
  • 1,121,712
10
\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}

enter image description here

If you need it across math styles (and with the overset gap slightly reduced):

\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}

enter image description here

2

I tried to make a new command to use it directly. Here is the results

\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}

Here is the output: enter image description here Using the command, you could adjust the specs of the triangle symbol itself.