Symbol for cube

I've searched the Internet, but got nothing. In LaTeX, we can use \square for square, but how can we get a cube, I want to use it in an equation. Here is the picture:

-
You can add a link to the image, then someone with enough rep can add the ! in front of it to make it an image. I think it would help to see an example. –  Roelof Spijker Jan 9 '12 at 15:28
See if the answer to this question can be adapted to your liking: tex.stackexchange.com/questions/38757/looking-for-symbol-shield –  Psirus Jan 9 '12 at 15:31
In case of confusion, check The conprehensive LaTeX Symbol List –  percusse Jan 9 '12 at 15:33
TikZ'ing it: \tikz\draw (0,0,0) rectangle (1,1,0) (0,1,0) -- (0,1,-1) -- (1,1,-1) --(1,1,0) (1,0,0) -- (1,0,-1) -- (1,1,-1); –  Roelof Spijker Jan 9 '12 at 15:36

The manfnt package offers \mancube and \manimpossiblecube:

\documentclass{article}
\usepackage{manfnt}

\begin{document}

\mancube

\manimpossiblecube

\end{document}


Those commands won't directly work in math mode, but you can use a \mbox; something like this:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{euler}
\usepackage{manfnt}

\begin{document}

$\mbox{\mancube}_{n} +(n+1)^{3}$

\end{document}


Of course, you could define a command if you are going to use the cube several times:

\newcommand*\cube{\mbox{\mancube}}

-
This doesn't work in math mode though, as the OP wanted. –  Torbjørn T. Jan 9 '12 at 15:38
@TorbjørnT. you're right. Boxing the cube (as in \mbox{\mancube}) you can use it in math mode. –  Gonzalo Medina Jan 9 '12 at 15:40
Perhaps you could add that to your answer as well. –  Torbjørn T. Jan 9 '12 at 15:43
@TorbjørnT. right again ;-) Done! –  Gonzalo Medina Jan 9 '12 at 15:46
@Tobi A safer way might be using \text of amsmath; \mathord is not needed anyway: a box in math mode is always an ordinary symbol. –  egreg Jan 9 '12 at 16:03