# caret (circumflex/hat/^) turns into superscript

I'm using ShareLaTeX on my Chromebook.

I'd like to write

in LaTeX (m^2), but the hat does not come out in the source code, instead it just turns everything into a superscript directly. How can I stop that?

• Welcome. Please note that we speak english here. You can use package siunitx-> \si{\meter\squared} – Johannes_B Oct 10 '18 at 9:13
• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – albert Oct 10 '18 at 9:13
• You probably have to go into math mode or see the comment from Johannes_B. Please also see how to create a MWE. – albert Oct 10 '18 at 9:34
• Ik heb jou vraag naar het Engels vertaald omdat Engels de voertaal op deze website is. (Ik ben niet helemaal zeker of ik dat goed heb gedaan, dus zou het zeker helpen als je je vraag zelf in het Engels gaat stellen.) – moewe Oct 10 '18 at 9:38
• At the moment I'm not even sure if this is a TeX problem, a feature of your OS (Chromebook) or a feature of the editor. Can you include a screenshot of what exactly you are seeing? – moewe Oct 10 '18 at 9:42

Chance from "rich text" to "source" view:

Initial question was unclear in respect what was required. it looked like a hat symbol was required, but turns out that a superscript is needed (from the translation by moewe).

A possible starting point with a number (not exhaustive) of possibilities (based on assumed 'hat' requirement):

\documentclass{article}

\begin{document}
$\hat{m^2}$
$\hat{m}^2$
$\widehat{m^2}$
$\widehat{m}^2$
\end{document}


required superscript (non exhaustive):

\documentclass{article}

\begin{document}
$m^2$
m\textsuperscript{2}
\end{document}

• I think the question is about the behaviour of typing ^ key in the sharelatex online editor, not actually about tex syntax (but it isn't clear, I may be wrong:-) – David Carlisle Oct 10 '18 at 9:41