# Equal size \Box and \blacksquare

I have a paper where I have to use both \Box and \blacksquare. The two symbols do not have the same height. I could use \square from amssymb but I do not like the size of \square and \blacksquare and I would prefer to scale down \blacksquare to the same size as \Box. Both will be used in normal math text and as subscript size.

-

If you want to create your own filled square you could use, for example, \rule[1pt]{5pt}{5pt}, adjust the size and position relative to the baseline to suit your preference and define a name for it using \newcommand if you want to use it more than once in a document.

For example (illustrative only and including the MnSymbol items for comparison),

\documentclass{article}
\usepackage{amsmath}
\usepackage{MnSymbol}
\newcommand\subHalmos{\rule[0.2pt]{2.4pt}{2.4pt}}
\newcommand\Halmos{\rule[0.4pt]{4pt}{4pt}}
\begin{document}
$\Box \filledmedsquare \medsquare$ use MnSymbol.

$\rule[0.4pt]{4pt}{4pt}x_{y\rule[0.2pt]{2.4pt}{2.4pt}}$ and
$\Halmos x_{y\subHalmos}$ both produce the same result but
the second is easier to type and to maintain in a large document.
\end{document}


The main disadvantage of the approach is that the symbol does not change size if the text around it changes size (as is evident from defining two versions). You could work round that by defining the size of the symbol in terms of a variable, perhaps ex height or, better (as Barbara Beeton suggests), the actual size of \Box.

## Footnote

With \usepackage{MnSymbol}, \medsquare is a synonym for \Box and MnSymbol includes \blacksquare as a synonym for \filledmedsquare which should then be the same size as \Box but filled in (see footnote for more).

The definitions of medium square and medium filled square in mnsymbol/Sym-Geometric.mf are the same size:

beginoperator(med_op_size#/sqrt(2), 1); "medium square";
pickup rule_pen;
draw square(centre, w/2 - side_bearing, 0);
endchar;

beginoperator(med_op_size#/sqrt(2), 1); "medium filled square";
pickup rule_pen;
draw square(centre, w/2 - side_bearing, 0);
fill square(centre, w/2 - side_bearing, 0);
endchar;


but an empty square and a filled one will tend to look different sizes by eye.

-
following up on the idea of defining a black box in terms of a variable, how about the height + depth of \Box? if it's done for each use, it would slow things down a bit, but the user wouldn't have to think about the current context. and if the depth of \Box` is zero (which could be tested up front), that would simplify things in the "main" definition. –  barbara beeton Sep 6 '11 at 12:23