1

I am facing few errors when I try to write accented letters in equations. Below is an MWE of my code. I am sure I am making a very basic mistake but the problem is that I have written a lot of equations using same commands and I can't edit them now. So I will request both a 'quick fix' solution for my document and a 'proper solution' to avoid it in the future. I am totally a novice both on this forum as well as latex so I apologize for any inconvenience in advance. Thanks

\documentclass{article}
\begin{document}
    \begin{equation}
    \vec{r}_1=r_1\^{r}_1=-r_1\^{e}_r
    \end{equation}
\end{document}

When I run this code, I get the following errors shown in figure below.

Error Window

Whereas I want the output as shown in figure below.

Required Output

1

You can use \hat in a math environment:

\documentclass[]{article}
\begin{document}
    \begin{equation}
      \vec{r}_1=r_1\hat{r}_1=-r_1\hat{e}_r
    \end{equation}
\end{document}

enter image description here

  • Excellent that qualifies to be my long term solution. However, I have written few hundred equations using '\^'. Any quick fix for that also will be highly appreciated. Otherwise, I will have to be content with editing all my equations and close this as answer. Thank you very much! – Mist Aug 25 '15 at 11:57
  • 1
    Hmm. Not sure I can help with a quick fix. How about using a find & replace option in an editor? That might work reasonably quickly, even with a few hundred equations. If you are using, e.g., TexMaker, you could try Edit -> Replace and use "Replace all". – RHertel Aug 25 '15 at 12:00
  • @Mist There is a reason why \^ is not used in math mode. It means now not the circumflex accent, but for example Fourier transform. – Przemysław Scherwentke Aug 25 '15 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.