27

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:

example of equation with cube

6

1 Answer 1

36

The manfnt package offers \mancube and \manimpossiblecube:

\documentclass{article}
\usepackage{manfnt}

\begin{document}

\mancube

\manimpossiblecube

\end{document}

enter image description here

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}

enter image description here

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

\newcommand*\cube{\mbox{\mancube}}
7
  • 1
    @TorbjørnT. you're right. Boxing the cube (as in \mbox{\mancube}) you can use it in math mode. Jan 9, 2012 at 15:40
  • Perhaps you could add that to your answer as well. Jan 9, 2012 at 15:43
  • @TorbjørnT. right again ;-) Done! Jan 9, 2012 at 15:46
  • @GonzaloMedina: You may want to add something like \newcommand{\cube}{\mathord{\mbox{\mancube}}} to your example.
    – Tobi
    Jan 9, 2012 at 15:58
  • 5
    @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, 2012 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .