# How do I properly define a small square math symbol? [duplicate]

I would like to create a math symbol using a command \smallsquare, which would look like this:





I know that there is \sqbullet from the mathabx package, or \filledsquare from the mnsymbol package, but I would like to avoid using those (e.g. because there are conflicts with other packages...).

Using the suggestions from this question, here is what I tried (and gave me the above result) :

\newcommand{\smallsquare}{
\vcenter{\hbox{\scalebox{0.45}{$\;\mathbin{ \blacksquare }\;$}}}
}


(using the graphicx package). But I feel like I am not defined things properly : typically, I added a space \; because I didn't know how to get correct spacing – despite trying to use \mathbin. I tried other ideas (e.g. \mbox{\tiny$\blacksquare$} or \text{\smaller[100]$\blacksquare$}) but did not get better results.

Henceforth, do you have any suggestions to improve my \smallsquare symbol? I would be happy to learn some new tricks, nice commands, interesting typographic features, etc.

• There’s \smblksquare (▪) in several packages, including unicode-math, stix and stix2. I’d recommend using unicode-math in LuaTeX when you can, and legacy packages in PDFTeX when you have to. – Davislor Jan 8 at 16:08
• \mathbin{\rule{1cm}{1cm}} using whatever lengths you want? – David Carlisle Jan 8 at 16:18
• @DavidCarlisle : thanks, it is an interesting idea. This only problem is that this is not centered vertically. So I came up with F \vcenter{ \hbox{ \rule{1mm}{1mm} } } H, which seems to be quite good to me (even without the mathbin...). – Watson Jan 8 at 16:54
• Possibly related: tex.stackexchange.com/questions/235118/…, which gives another way (my first attempt was not far from this) : \mathbin{\vcenter{\hbox{\scalebox{0.45}{$\blacksquare$}}}} – Watson Jan 8 at 16:55
• you can use vcenter or (more efficiently) use the optional depth argument of \rule you want \mathbin to get the spacing for f ▪ g not f▪g – David Carlisle Jan 8 at 16:58

You can use the non-conflicting glyphs from mathabx without loading the package. You just have to add this code to your preamble:

\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{%
<-6> mathb5
<6-7> mathb6
<7-8> mathb7
<8-9> mathb8
<9-10> mathb9
<10-12> mathb10
<12-> mathb12 }{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}5}
\DeclareMathSymbol{\sqbullet}{\mathbin}{mathb}{"0D}


• OK, thanks. Somehow this symbol is still too big, to my taste. So maybe this comment is more interesting for me. – Watson Jan 8 at 16:41
• @Watson: be aware the posted screenshot is zoomed by 300 %. – Bernard Jan 8 at 18:15