4

The symbol is like this

enter image description here

I checked the "The Great, Big List of LATEX Symbols" document, but didn't find any similar symbols.

8

Same size as \square. Works across math styles. The .5 scale of the inner box can be adjusted to suit.

\documentclass{article}
\usepackage{amssymb,stackengine,graphicx,scalerel}
\newcommand\dsquare{\ThisStyle{\ensurestackMath{%
  \stackinset{c}{}{c}{}{\scalebox{.5}{$\SavedStyle\blacksquare$}}
  {\SavedStyle\square}}}}
\begin{document}
$\square\blacksquare \dsquare$

$\scriptstyle\square\blacksquare \dsquare$

$\scriptscriptstyle\square\blacksquare \dsquare$
\end{document}

enter image description here

| improve this answer | |
7

This is ▣ (U+25A3} in Unicode, and you can use it in fontspec.

Examples

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{STIX Two Math}

\begin{document}
\( \blackinwhitesquare \)
\end{document}

The XITS Math and STIX Two Math fonts have this symbol. You can import only this symbol while using another math font.

\setmathfont{Latin Modern Math} % Or your font of choice.
\setmathfont{STIX Two Math}[range=\blackinwhitesquare,
                            Scale=MatchUppercase}

You can also get this symbol in text mode with fontspec:

\usepackage{fontspec}
\usepackage{newunicodechar}

\newfontface\symbolfont{STIX Two Math}[Scale=MatchUppercase]
\newcommand\blackinwhitesquare{%
  \textnormal{\symbolfont\symbol{"25A3}}
}

\newunicodechar{^^^^25A3}{\blackinwhitesquare} % ▣
| improve this answer | |
  • 5
    Can you add an example of usage? – AndréC Jul 16 at 19:53
  • @And Copy and paste the character from here, use a font that has a glyph for it. – Caleb Jul 17 at 18:09
  • 1
    @AndréC Added some examples. Untested; caveat emptor. – Davislor Jul 17 at 18:36
6

It is included in the STIX font. It can be imported without importing the whole font as in the following example.

\documentclass{article}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareSymbolFont{symbols}{LS1}{stixscr}{m}{n}
\DeclareMathSymbol{\blackinwhitesquare}{\mathord}{symbols}{"BA}
\begin{document}
\( \blackinwhitesquare \)
\end{document}

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.