# Package arev and sansmath

I would like to use the package sansmath and be able at the time to define a new symbol \varheart. To define the latter, following this answer, I use the code

\DeclareSymbolFont{extraup}{U}{zavm}{m}{n}
\DeclareMathSymbol{\varheart}{\mathalpha}{extraup}{86}


Unfortunately, as seen in the following minimal example, it does not work.

\documentclass{article}

\usepackage{sansmath}

\DeclareSymbolFont{extraup}{U}{zavm}{m}{n}
\DeclareMathSymbol{\varheart}{\mathalpha}{extraup}{86}

\begin{document}

\sansmath{Is the following a filled heart? $\varheart$}

\end{document}


Is there a way to solve this issue?

You have to declare the symbol as \mathord rather than \mathalpha.

\documentclass{article}

\usepackage{sansmath}

\DeclareSymbolFont{extraup}{U}{zavm}{m}{n}
\DeclareMathSymbol{\varheart}{\mathord}{extraup}{86}

\begin{document}

\sansmath{Is the following a filled heart? $\varheart a+b$}

\end{document}