I would like to use a dice symbol such as those defined in Andrew Swann's answer, given to Dice symbols for digits up to 9, inside a math equation.
For instance, to model the set of results after a throw, I would like to write :
$$ \Omega = \{1, 2, 3, 4, 5, 6\} $$
Where each number is replaced by the corresponding dice symbol.
Best Answer
(29 June 2021: Updated the answer to mention that two more packages --
ifsym
andutfsym
-- provide macros that let users draw dice.)According to the current (May 2021) edition of the "Comprehensive LaTeX Symbol List", the
epsdice
,hhcount
,stix
,ifsym
, andutfsym
packages all contain macros for drawing dice.For instance, here's an example that makes use of the
epsdice
package.Addendum to address the OP's follow-up query: To center the die symbols vertically, i.e., to align them on the math axis, you could encase them in
\vcenter{\hbox{...}}
"wrappers".2nd addendum: If you're free to use LuaLaTeX, you could use a Lua
for
loop to generate all six die symbols programmatically. This functionality may not seem like a big deal if just six symbols need to be generated. Naturally, it's a lot more relevant for use cases that involve a dozen or more calls to the same macro.