Why don't pifonts work in align environment?

Minimal example:

\documentclass{article}
\usepackage{amsmath}
\usepackage{pifont}

\begin{document}
\begin{align}
\ding{172}
\ding{182}
\end{align}
\ding{172}
\ding{182}
\end{document}

-

1 Answer

It's not just in the align environment: \ding internally switches to the ZapfDingbats pzd fonts in U encoding which don't work in math mode (I guess they were designed only for text mode), as the following example demonstrates:

\documentclass{article}
\usepackage{pifont}

\begin{document}

\fontfamily{pzd}\fontencoding{U}%
\fontseries{m}\fontshape{n}\selectfont

$\char123$\char123

\end{document}


In math mode you can use \text from amsmath:

\documentclass[12pt,notitlepage]{article}%
\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}%
\usepackage{bm}%
\usepackage{pifont}%

\begin{document}
\begin{align}
\text{\ding{172}}
\text{\ding{182}}
\end{align}
\ding{172}
\ding{182}
\end{document}


If amsmath is not being loaded, for some reason, one can use \mbox:

\begin{align}
\mbox{\ding{172}}
\mbox{\ding{182}}
\end{align}

-