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:
1 Answer
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}}
-
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 -
-
-
@GonzaloMedina: You may want to add something like
\newcommand{\cube}{\mathord{\mbox{\mancube}}}
to your example.– TobiJan 9, 2012 at 15:58 -
5@Tobi A safer way might be using
\text
ofamsmath
;\mathord
is not needed anyway: a box in math mode is always an ordinary symbol.– egregJan 9, 2012 at 16:03
!
in front of it to make it an image. I think it would help to see an example.\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);