4

After updating from the 2016 version to the 2023 version, I've encountered an issue where \hbar and \dot no longer work when using the sfmath package. I'm using XeLaTeX.

\documentclass{article}
\usepackage{sfmath}     
\begin{document}
$\hbar \dot{a} \sin(x)$
\end{document}

It looks like this.

enter image description here

Can you help with this? Thanks.

1
  • 1
    checking on overleaf (which has texlive 2014 - 2023) 2016 is the last time it worked, it has been broken since 2017 Commented Jun 15 at 9:53

2 Answers 2

9

enter image description here

The package was not really designed for xelatex and it was broken in xelatex when Unicode support was incorporated into the core latex format, so texlive 2016 was the last texlive that works.

You can use the [cm] option to force it to take the original code path, assuming OT1 encoding for math fonts.

\documentclass{article}

\usepackage[cm]{sfmath}


\begin{document}

$\hbar \dot{a} \sin(x)$
\end{document}
0
1

It seems that sfmath hasn't been updated in long time. Also, its documentation only states compatibility with LaTeX and pdfLaTeX (which it still does). Try using the sansmath package instead. Works perfectly with XeLaTeX.

3
  • 3
    IMHO, showing a complete example would be very useful, because replacing sfmath by sansmath is usually not enough to get sans-serif math. So please show at least how to use this package. Maybe adding a screenshot of what you get would also be useful. (Nevertheless, down-voting this answer is IMHO a little bit hard.)
    – cabohah
    Commented Jun 15 at 10:10
  • Thank you, codeR. I have tried sansmath, \hbar and \dot work, but then all vectors where tildes ... seems to be a conflict with amsmath.
    – Michael
    Commented Jun 15 at 11:48
  • David's answer is indeed more robust.
    – codeR
    Commented Jun 15 at 12:23

You must log in to answer this question.

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