4

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}

enter image description here

Is there a way to solve this issue?

1 Answer 1

7

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}

enter image description here

You must log in to answer this question.

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