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.

Is there a way to create a box with a check mark in the center of it and the check mark coming out of the box?

For example: $\boxdot$ or $\boxtimes$, but instead have a check mark placed at the center extending outside the box.

P.S. How can I get things to work in math mode on this site. For example, the above sample code does not display the pictures.

share|improve this question
6  
There is no math mode functionality on this site. We need to display math-code as code much more often then displaying the graphical representation of it. You will need to add it them as images by yourself if you really want them. –  Martin Scharrer Apr 17 '11 at 12:14
    
@Martin: given the frequency that this comes up, may be a line in the FAQ or the How To Ask section about MathJax not supported here would be nice. –  Willie Wong Apr 17 '11 at 13:06
    
@Willie: Good idea. meta.tex.stackexchange.com/q/1272/86 –  Loop Space Apr 17 '11 at 18:11

4 Answers 4

up vote 12 down vote accepted

One can choose between the following two solutions; the first one centers the two symbols with respect to one another, the second one draws the square and then displaces the check mark.

\documentclass{article}
\usepackage{amssymb}
\begin{document}

\mbox{\ooalign{$\checkmark$\cr\hidewidth$\square$\hidewidth\cr}}

\makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.1em}$\checkmark$}

\end{document}

By acting on the two dimensions, one can find by trial and error the best relative positioning of the check mark with respect to the box.

This gives (with magnification x16 and displayed horizontally):

enter image description here

share|improve this answer
    
Nice. Would you mind putting the other headers it needs to properly display as an output, such as Martin did above. Thanks –  night owl Apr 17 '11 at 12:52
    
Both attempts were very close, but how could I use what you gave and tweak around with the positioning of the check mark to make it precisely in the middle of the check box with it touching the side or base of the box. Only the extending arm of the check mark is going through the upper right corner of the box and no other part of the check mark is touching the box. –  night owl Apr 17 '11 at 13:05

You can also try bbding package. It has a set of checks and crosses (for example \XSolidBrush and \Checkmark).

share|improve this answer

If you just want to get the checkmark in a box and don't specifically need to create it yourself, there are two symbols listed in The Comprehensive LaTeX Symbol List that you could use:

\documentclass{article}

\usepackage{wasysym}
\usepackage{marvosym}

\begin{document}
\CheckedBox% from wasysym
\Checkedbox% from marvosym
\end{document}

checkbox pics


EDIT: Also, there's the Unicode character 9745 "Ballot Box With Check" ☑ that you can insert directly using XeLaTeX. If you choose the right font, the checkmark will be inside the box entirely. I just used two fonts that I found on my Win7 machine.

%to be compiled with XeLaTeX!
\documentclass{article}

\usepackage{fontspec}

\begin{document}
\setmainfont{Arial Unicode MS}Arial Unicode MS: ☑

\setmainfont{DejaVu Sans}DejaVu Sans: ☑
\end{document}

XeLaTeX checkbox pic

share|improve this answer
    
@donherry: Thanks for this insight. I used the marosym package before but did not no it contained this command. This is much simpler than creating a \newcommand. :) P.S. Is there a command or way to position the check-mark in the center of the box? –  night owl Jun 23 '11 at 11:28
    
@night owl: I don't think there is an (easy) way to modify the packages' characters. I added a solution using XeLaTeX. If you want to put the checkbox within a document using a different font, you could again create a \newcommand with the \setmainfont and the checkbox in it. –  doncherry Jun 23 '11 at 11:55

You could overlay two symbols using \rlap as shown below. The use of \text should ensure that the checkmark is scaled in subscripts, which might not be really necessary for such a symbol. See also Overlay symbol with another to learn how to center one symbol on another one.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

$\text{\rlap{$\checkmark$}}\square$

\end{document}

Result

If this is not what you want you still could draw the symbol by yourself e.g. using tikz. See the answers of Square with a diamond in it for this.

share|improve this answer
    
Awesome +1.., this is primarily what I was looking for. But just slightly wanted the checkmark to be in the center of the box. I can check out the link on 'tikz' on doing this. –  night owl Apr 17 '11 at 12:37
1  
\rlap is good, but sometimes it may surprise LaTeX users; \makebox[0pt][l]{$\checkmark$}$\square$ perhaps uses more resources, but it's safe in all contexts. In your code \text is superfluous, actually. A robust solution should take into account \mathsurround, too: \mbox{\mathsurround=0pt \makebox[0pt][l]{$\checkmark$}$\square$}. –  egreg Apr 17 '11 at 12:39
    
@egrep: Yes, in the shown example the \text is not necessary, but -- as mentioned -- would scale the checkmark if used in a subscript. It all depends on the exact usage. Ok, a symbol like this is hardly used inside an equation. –  Martin Scharrer Apr 17 '11 at 12:49
2  
Based on your typo of egreg, I s'pose you are a *nix user? :-D –  Willie Wong Apr 17 '11 at 13:08
    
@Willie: Indeed! :-D –  Martin Scharrer Apr 17 '11 at 13:13

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.