How to write a hat(^) symbol in LaTeX?

The hat symbol is a fundamental notation in mathematics and science, commonly used to denote vectors, unit vectors, or specific variables. It is also known as the circumflex in various languages.

LaTeX provides multiple ways to use this symbol, both in math mode and text mode, allowing for precise and professional formatting.

Using \hat{} for Mathematical Notation

The \hat{} command in LaTeX places a small hat (^) above a single character, making it ideal for marking vectors or distinguishing variables in equations.

\documentclass{article}
\usepackage{amsmath}
\begin{document}  
  \[ \hat{\mathbf{r}} = \cos(\varphi)\hat{\mathbf{i}} + \sin(\varphi)\hat{\mathbf{j}}\]
\end{document}

\[ \hat{\mathbf{r}} = \cos(\varphi)\hat{\mathbf{i}} + \sin(\varphi)\hat{\mathbf{j}}\]

This example demonstrates how this command works within math mode. To properly format equations, always enclose them within \[...\] or use inline math mode with $...$.

Using \vu{} for Unit Vectors

For an easier way to write unit vectors, use the physics package. It provides the \vu{} command for adding symbols to vectors.

The * option offers different styles, such as Greek or Italic.

\documentclass{article}
\usepackage{physics}
\begin{document} 
   \[ \vu{a} \]
   \[ \vu*{a} \]
\end{document}

Output :

Unit vector symbol
Unit vector symbol

The \vu*{arg} command changes the unit vector’s appearance, making it useful for scientific papers.

Expanding the Hat Symbol

While \hat{} works well for single characters, it does not scale effectively for multiple letters. When marking entire words or longer expressions, use \widehat{} instead.

\documentclass{article}
\begin{document}
   \[ \hat{abc} \]
   \[ \widehat{abc} \]
\end{document}

Output :

For multiple characters

Adding Circumflex Accents in Text Mode

This symbol isn’t limited to mathematical expressions. It is also commonly used in linguistics and phonetics, particularly in languages like French, where it appears in words like ô, â, ê.

\documentclass{article}
\begin{document}
   Circumflex-\^{o},\^{a}
\end{document}

Output :

Circumflex-ô,â

The \^ command allows you to place circumflex accents over letters in normal text, making it useful for writing in French, Romanian, and Vietnamese.

Conclusion

Understanding \hat{} and \widehat{} is essential for both math and text modes. In physics, the \vu command from the physics package simplifies unit vector notation.

Share tutorial

Leave a Comment

Your email address will not be published. Required fields are marked *