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?

6

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.