[Tex/LaTex] mathtt with iwona font

fontsmath-mode

I'm trying to use typewriter font in math mode using iwona fonts, but the result ends up being typeset in the iwona text font. Here's an example:

\documentclass{article}
\usepackage[math]{iwona}
\usepackage[T1]{fontenc}
\begin{document}
\noindent
Math: $x^2+y^2=z^2$.\\
Texttt: \texttt{abcdefghijklmnopqrstuvwyz} \\
Mathtt: $\mathtt{abcdefghijklmnopqrstuvwyz}$
\end{document}

I would like the Mathtt line to look just like the Texttt line. Any ideas how to achieve this?

Best Answer

It seems like a bug in the iwona package.

\documentclass{article}
\usepackage[math]{iwona}
\SetMathAlphabet{\mathtt}{iwona}{OT1}{\ttdefault}{m}{n}
\usepackage[T1]{fontenc}
\begin{document}
\noindent
Math: $x^2+y^2=z^2$.\\
Texttt: \texttt{abcdefghijklmnopqrstuvwyz} \\
Mathtt: $\mathtt{abcdefghijklmnopqrstuvwyz}$
\end{document}

The package has \rmdefault instead of \ttdefault, which explains the unexpected behavior.

enter image description here