1
    \documentclass{article}    
    \usepackage{unicode-math}
    \setmainfont{TeX Gyre Termes}
    \setmathfont{TeX Gyre Termes Math}

    \begin{document}
    Linear equation \(\sqrt{x+y}=2\) 
    \end{document}

When i run this code it with xelatex it gives the follwing error

"(Font) OMX/cmex/m/n --> EU1/TeXGyreTermesMath(2)/bx/n on input

line 4.

! Undefined control sequence.

\um_set_mathcode:nnn #1#2#3->\Umathcode

\int_eval:n {#1}=\mathchar@type #2\c...

l.4 \setmathfont{TeX Gyre Termes Math}

The control sequence at the end of the top line

of your error message was never \def'ed. If you have

misspelled it (e.g., `\hobx'), type `I' and the correct

spelling (e.g., `I\hbox'). Otherwise just continue,

and I'll forget about whatever was undefined.

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation."

...
l.4 \setmathfont{TeX Gyre Termes Math}

You're in trouble here. Try typing <return> to proceed.

If that doesn't work, type X <return> to quit.

Missing character: There is no ^^@ in font TeX Gyre Termes/ICU:script=latn;lang

uage=DFLT;!

! Undefined control sequence.

\um_set_mathcode:nnn #1#2#3->\Umathcode

\int_eval:n {#1}=\mathchar@type #2\c...

l.4 \setmathfont{TeX Gyre Termes Math}

The control sequence at the end of the top line

of your error message was never \def'ed. If you have

misspelled it (e.g., `\hobx'), type `I' and the correct

spelling (e.g., `I\hbox'). Otherwise just continue,

and I'll forget about whatever was undefined.


Missing character: There is no ^^@ in font TeX Gyre Termes/ICU:script=latn;lang

uage=DFLT;!

closed as off-topic by egreg, Alan Munn, Kurt, Stefan Pinnow, Zarko Aug 6 '16 at 23:03

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    Old versions of xetex called this command xetexmathcode (I think) recent versions use the Umathcode name, matching luatex. So it seems you have a new unicode-math package and an old xetex? – David Carlisle Feb 13 '15 at 9:53
  • 3
    No error here on my Texlive 2014 system. Perhaps you have something missing from your installation. – Thruston Feb 13 '15 at 9:53
  • i have installed miktex 2.94407 and i am running this program in tex maker. Package manager shows this date 2013-02-19 for xetex package and this date 2014-07-12 for unicode-math. Now what should i do to run the program (get new xetex package or use some other commands?) – Shaheryar Feb 14 '15 at 3:44
  • 4
    I'm voting to close this question as off-topic because the issue is due to non up-to-date software – egreg Aug 6 '16 at 22:14
  • The issue is due to using an updated version of unicode-math over an older TeX distribution. – egreg Aug 6 '16 at 22:16

Browse other questions tagged or ask your own question.