[Tex/LaTex] Undefined control sequence – Math mode, \hat

errorslyx

I received a LyX file from my friend and when I tried to compile it, LyX showed me this these errors.
Undefined control sequence

I have no idea what is going on. Hope you can help me out, thanks a lot.

Update: Here is the minimal example and I'm using LyX 2.1.3, thanks for your help.
https://goo.gl/JTKzXV

Best Answer

This seems to be a bug in LyX. LyX is supposed to automatically load the right packages (unless you use ERT, then you're on your own). For some reason, when the document is set to Vietnamese, the package is not loaded automatically. To work around this bug, go to Document > Settings > LaTeX Preamble and put the following:

\usepackage{textcomp}