Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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
1  
In case of confusion, check The conprehensive LaTeX Symbol List –  percusse Jan 9 '12 at 15:33
2  
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

1 Answer 1

up vote 29 down vote accepted

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}}
share|improve this answer
    
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
4  
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.