# How to typeset a small black square as a binary operator?

This is my first post on this SE so I apologize if my formatting is bad.

Essentially I am trying to reproduce the small black symbol from the following definition in Allen Hatcher's Algebraic Topology: (This book can also be accessed from his website for free, and this particular image is from page 26.)

I am trying to figure out how to typeset the small black square between the f and the g(s). I tried the following in my preamble

\renewcommand{\bullet}{\tiny$\blacksquare$}


but the square bullet produced looks jarring and does not look like a binary operator, i.e. it is not centered and does not have equal spacing between f and g(s).

Would any of you have any suggestions on how to make this particular symbol?

• This is actually not a square but just the shape of \cdot from the Lucida family used in the picture (code, screenshot). Lucida is a commercial font, you can purchase it from TUG. – Henri Menke Feb 21 '19 at 20:26
• Ah, ok! Thank you @HenriMenke! That is very helpful information. For now I think I will just have to settle for the "normal" \cdot to represent this operation. – Thy Art is Math Feb 21 '19 at 20:32

## 6 Answers

This is actually not a square but just the shape of \cdot from the Lucida family used in the picture.

\documentclass{article}
\usepackage{lucidabr}
\begin{document}
$f \cdot g$
\end{document} Lucida is a commercial font, you can purchase it from TUG.

You could also go ahead and fake the symbol using a \rule.

\documentclass{article}
\renewcommand\bullet{%
\mathbin{\mskip1mu
\mathchoice
{\squarebullet{.25ex}{.25ex}}%
{\squarebullet{.25ex}{.25ex}}%
{\squarebullet{.18ex}{.18ex}}%
{\squarebullet{.15ex}{.15ex}}
\mskip1mu}
}
\newcommand\squarebullet{\vcenter{\hbox{\rule{#1}{#2}}}}
\begin{document}
$f \cdot g_{f \cdot g_{f \cdot g}}$

$f \bullet g_{f \bullet g_{f \bullet g}}$
\end{document} This symbol exists in the mathabx font package. Here is a way to use this symbol without having to load the package:

\documentclass{article}
\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}
\DeclareMathSymbol{\sqbullet}{\mathbin}{mathb}{"0D}

\begin{document}

$f \sqbullet g$%

\end{document} Decide for the size of the black dot, here it is twice the size of (the bounding box of) a period, with a small sidebearing.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\pp}{}% check it's not defined
\DeclareRobustCommand{\pp}{\mathbin{\mathpalette\pp@\relax}}
\newcommand\pp@{%
\mspace{0.5mu}%
\vcenter{\hbox{\sbox\z@{$#1.$}\rule{2\ht\z@}{2\ht\z@}}}%
\mspace{0.5mu}%
}
\makeatother

\begin{document}

$f\pp g$

$f\pp g$

\end{document} I don't know the exact size of the black square as in the picture of the OP. I have made this with a new command \bsq: \documentclass[12pt]{article}
\usepackage{amssymb,amsmath}
\usepackage{scalerel}
\newcommand{\bsq}{{\mkern 5mu}\blacksquare{\mkern 9mu}}

\begin{document}
$f\raisebox{1pt}{\scaleto{\bsq}{2pt}} g(s)= \begin{cases} f(2s) &\\ g(2s-1)& \end{cases}$

\end{document}


This glyph is available in several packages as \smblksquare, including unicode-math (which I recommend), stix and stix2. Its Unicode codepoint is ▪ (U+25AA). Just define an operator with spacing \mathbin.

\documentclass[varwidth]{standalone}
\usepackage{unicode-math}

\newcommand\csquare{\mathbin{\smblksquare}}

\begin{document}
$$f \csquare g$$
\end{document} There are several similar symbols, such as \vysmblksquare for a smaller version (⬝) or \mdlblksquare for a larger one (◼). For example:

\documentclass[varwidth]{standalone}
\usepackage{unicode-math}

\defaultfontfeatures{ Scale = MatchLowercase, Ligatures = TeX }
\setmainfont{STIX Two Text}[Scale = 1.0]
\setmathfont[StylisticSet = 2]{STIX Two Math}

\newcommand\csquare{\mathbin{\vysmblksquare}}

\begin{document}
$$f \csquare g$$
\end{document} If you want to use a math font that doesn’t have this symbol, or has an ugly one, you can substitute the square from any other font of your choice with, e.g. \setmathfont[range=\smblksquare]{Latin Modern Math}.

If this is actually the \cdot symbol from Lucida, you could instead define \csquare by wrapping a \mbox inside \mathbin, or with \DeclareMathSymbol.

To create a small blacksquare, I used the \atop command. This is used to show two terms vertically both of which are on top of the line eg. ${x \atop y}$. The idea is to ignore the lower term and then apply a subscript as in $_{x \atop}$ and this 'brings down' the upper term to the line level in a smaller size. Applying this to a blacksquare we get a small blacksquare:

$a(x-x_1)(x-x_2) = ax^2+bx+c \; {}_{\blacksquare \atop}$

ps. \; creates a space in math environment.

• Welcome to TeX.SE! – Mensch Sep 1 '20 at 22:11
• Sometimes I'm really astonished by the types of “solutions” people come up with in LaTeX. – Henri Menke Sep 2 '20 at 2:39