TransWikia.com

Is there a intermediate checkedbox symbol in LaTeX?

TeX - LaTeX Asked on November 1, 2021

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.

3 Answers

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}

Answered by Vincent on November 1, 2021

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}

newfontfacesymbolfont{STIX Two Math}[Scale=MatchUppercase]
newcommandblackinwhitesquare{%
  textnormal{symbolfontsymbol{"25A3}}
}

newunicodechar{^^^^25A3}{blackinwhitesquare} % ▣

Answered by Davislor on November 1, 2021

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}
newcommanddsquare{ThisStyle{ensurestackMath{%
  stackinset{c}{}{c}{}{scalebox{.5}{$SavedStyleblacksquare$}}
  {SavedStylesquare}}}}
begin{document}
$squareblacksquare dsquare$

$scriptstylesquareblacksquare dsquare$

$scriptscriptstylesquareblacksquare dsquare$
end{document}

enter image description here

Answered by Steven B. Segletes on November 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP