2

I am getting an error using accents package with unicode-math in xelatex. The error is 'Missing number, treated as zero.'

\documentclass{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
\usepackage{accents}
\begin{document}
$\hat{a}$   
\end{document}
3

Load accents before unicode-math:

\documentclass{article}
\usepackage{amsmath}
\usepackage{accents}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
\begin{document}

$\hat{a}\accentset{g}{a}$

\end{document}

enter image description here

1
  • Thanks. The accents package document asks for loading it after amsmath, so I loaded it after all math packages. The document may need an update.
    – Aydin
    May 18 '17 at 11:35

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.