I want gray inside $\Box$. How can we do that? I will use this as a caption of my figure like

\caption{ $\Box$ denotes ...}
  • 1
    Probably better to use something like \fcolorbox{black}{gray}{\ } or similar.
    – daleif
    May 31, 2021 at 8:27
  • Not working. Do I need any usepackage?
    – Sanu
    May 31, 2021 at 8:41
  • 2
    xcolor, though {\fboxsep=0pt\fbox{\color{gray}\rule{3mm}{3mm}}} might be better, more squareish. Please note you should never provide sniplets like this, always use minimal examples including document class and relevant preamble. Then we know what you are working with.
    – daleif
    May 31, 2021 at 8:49
  • It is working! Thanks a lot for your help.
    – Sanu
    May 31, 2021 at 8:54

2 Answers 2


The easiest method is probably something like




\fbox has some padding, which we locally remove by setting \fboxsep to zero.


You possibly want squares with different colors. The following \csq command will change size according to the context.


  % colored square
  % #1 = color model (optional)
  % #2 = color spec


\csq{gray} denotes something

\csq[rgb]{0.1,0.3,0.9} denotes something else

\csq{red!40!blue} something completely different

{\Large\csq{gray} Large}


enter image description here

If you're running LaTeX before the 2020-10-01 release, you also need


You must log in to answer this question.

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