# Latex - How to type these symbols over chars in matrix

I want to to ask how I can type this matrix, especially that ^ over alphabetic characters.

I have something like this:

\begin{eqnarray}
\begin{pmatrix}
a+b & \overset{}{\epsilon + \omega} &  \overset{}{\pi} \\
\vec{a} & \overleftrightarrow{AC} & \beta
\end{pmatrix}
\end{eqnarray}

• Are you looking for \hat{a}? – Au101 Mar 12 '18 at 21:45
• Don't use eqnarray -- it's badly deprecated. For the equation in your example, just use an equation environment. – Mico Mar 12 '18 at 21:47
• For hat symbols over lowercase letters, use \hat. For hat symbols over uppercase Latin and Greek letters, use \widehat. For really wide hat symbols, see the posting Really wide hat symbol. – Mico Mar 12 '18 at 21:53
• Yes, its \widehat and \hat. Thank you so much guys. – Oggy Mar 12 '18 at 21:56

FWIW, in ConTeXt with \widehat always expands to the width of it's argument. So, simply using \widehat{ξ + ω} works.

\definemathmatrix[pmatrix][matrix:parentheses][simplecommand=pmatrix]
\starttext
\startformula
\pmatrix{ a + b, \widehat{ξ + ω}, \hat π;
\vec a, \overleftrightarrow{AC}, β}
\stopformula
\stoptext


which gives

One way to produce the really-wide hat symbol is to employ the mtpro2 package. Note that the full mtpro2 package is not free of charge. However, its lite subset -- which is all that's needed to produce the screenshot of interest, is in fact free of charge.

\documentclass{article}
\usepackage{amsmath} % for 'pmatrix' env.
\usepackage{times}        % Times Roman text font
\usepackage[lite]{mtpro2} % Times Roman math font
\begin{document}
$$\begin{pmatrix} a+b & \widehat{\xi + \omega} & \hat{\pi} \\ \vec{a} & \overleftrightarrow{AC} & \beta \end{pmatrix}$$
\end{document}


With the default fonts, you have two possibilities for the widehat: either the extensible character \widehat from yhmath or the character of the same name in mathabx. I don't load here mathabx, but define the latter character as \varwidehat. I also suggest the old-arrows package so that \overleftrightarrow doesn't touch capital letters:

\documentclass[12pt, a4paper]{article}
\usepackage{amsmath}%
\usepackage{yhmath}
\usepackage{old-arrows}

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<5> <6> <7> <8> <9> <10>
<10.95> <12> <14.4> <17.28> <20.74> <24.88>
mathx10
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\varwidebar}{0}{mathx}{"73}
\DeclareMathAccent{\varwidehat}{0}{mathx}{"70}

\begin{document}

$\begin{pmatrix} a+b & \widehat{\xi + \omega} & \overset{}{\pi} \\ \vec{a} & \overleftrightarrow{AC} & \beta \end{pmatrix}\qquad \begin{pmatrix} a+b & \varwidehat{\xi + \omega} & \overset{}{\pi} \\ \vec{a} & \overleftrightarrow{AC} & \beta \end{pmatrix}$%

\end{document}