mathtt with iwona font

This will give you typewriter text in \mathtt, while leaving the remainder of math mode unchanged (I believe).

EDITED to place fontenc first in line of the packages, which was suggested in a nice comment by jfbu, so as to make sure mathastext got applied to the OT1 math exclusions.

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

$x^{y\mathtt{y}}$
\end{document}

enter image description here


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