Sans-Serif – How to Use \mathsf or \symsf in Kpfonts with LaTeX

sans-serifsansmathfonts

enter image description here

We know that kpfonts has a sans-serif math font, but the \mathsf and \symsf seem to use the CM fonts.

\documentclass{article}

\usepackage[bold-style=ISO,sans-style=italic]{unicode-math}
\usepackage{kpfonts-otf}

\begin{document}
    Hello world ball, 2022.
    \begin{equation}
        \mathsf{ABC}\symsf{ABC}
    \end{equation}
\end{document}

Best Answer

The fonts are different, though it can be hard to tell with sans fonts. Compare:

enter image description here

\documentclass{article}

\PassOptionsToPackage{sans-style=italic}{unicode-math}
\usepackage{kpfonts-otf}
\setmathfont{Latin Modern Math}[version=LM]

\begin{document}

Kpfonts:

$\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$

$\symsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$

Latin modern (default:

\mathversion{LM}
$\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$

$\symsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$

\end{document}