0

Consider the following MWE:

\documentclass[png,border=2pt]{standalone}
\usepackage[no-math]{fontspec}
\usepackage{sfmath}
\begin{document}
    $\bar 1$ $\vec 1$ 
\end{document}

This produces wrong \bar accent with fontspec and sfmath in contrast to enter image description here which is the desired output.

The latter result occurs if the fontspec package is removed.

Is there any way to get the math accent right, even if fontspec is used (for example to load the Computer Modern Unicode Sans Serif fonts for the main text to complement the sans serif math)?

6
  • 2
    Load fontspec after sfmath.
    – Bernard
    Mar 5, 2014 at 13:04
  • Well, it works. It there a general rule for this when working with fontspec?
    – porst17
    Mar 5, 2014 at 14:27
  • None that I know. Just tried to see what happened. Maybe it should be considered a bug, since fontspec is loaded with the nomath option?
    – Bernard
    Mar 5, 2014 at 15:27
  • I reported the issue: github.com/wspr/fontspec/issues/168. We will see if the fontspec author can tell us more about the problem.
    – porst17
    Mar 5, 2014 at 17:12
  • Perfect! I was unsure on how to do it myself.
    – Bernard
    Mar 5, 2014 at 17:20

1 Answer 1

2

You should load fontspec after sfmath. Incidentally, \vect is not extensible and should be replaced, in my opinion, with the \vv command from the esvect package. In addition, you have eight styles for arrow tips.

\documentclass[png,border=2pt]{standalone}
\usepackage[no-math]{fontspec}
\usepackage{sfmath}

\begin{document}

    $\bar 1$ $\vec 1  \vec W \vv{ W} $ 

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .