I'm trying to create a new symbol that simply combines a number with a triangle, by placing the number inside the triangle. It should work in math-mode (text mode would be nice, but not required).
I've tried the following:
\documentclass{article}
\usepackage{graphicx}
\newcommand{\trinum}[1]{%
\triangle\hspace{-.57em}\raisebox{0.1em}{\scalebox{.5}{#1}}
}
\begin{document}
Works fine in default environment
\[
\trinum{1} \qquad \trinum{2} \qquad \trinum{3}
\]
Slightly shifted when used in Huge environment:
{\Huge
\[
\trinum{1} \qquad \trinum{2} \qquad \trinum{3}
\]
}
Slightly shifted when used in tiny environment:
{\tiny % I know, it's too small to read, but just used as a check
\[
\trinum{1} \qquad \trinum{2} \qquad \trinum{3}
\]
}
Messed up when used as subscript or super script
\[
\trinum{1} \qquad x_\trinum{1} \qquad x^\trinum{1}
\]
\end{document}
As you can see, it doesn't work nicely for scaled text and very badly for superscript and subscript. I was wondering if there is a better way of doing this.