# How to enter 🅱 in latex

I need to enter the 🅱 sign in LaTeX for a paper I'm writing. I tried compiling my paper using XeLaTeX, but it just ignores 🅱. Is there perhaps a way to enter the 🅱's Unicode code point itself into LaTeX that I'm missing?

• Does your font have this character? If not, you'll need to either create one yourself (with Tikz?) or find a font that has it. Mar 18 '18 at 20:56
• That font does not contain all of unicode, so you'll have to start by finding a font that provides this character Mar 18 '18 at 21:08
• Just for the record, this is U+1F171: NEGATIVE SQUARED LATIN CAPITAL LETTER B. Mar 18 '18 at 22:40
• 🅱est of luck to you!
– qwr
Mar 19 '18 at 2:26
• Does your paper happen to be about 🅱oneless 🅱izza? Mar 19 '18 at 3:10

The Apple Color Emoji font that contains this particular character doesn't encode its glyphs as regular characters and can't be used. See Emoji Characters. There seem to be very few fonts which contain these glyphs (the Enclosed Alphanumeric Supplement in Unicode).

On my machine (a Mac), only one font contains them: the Hiragino fonts. Here's an example that works for me (compile with LuaLaTeX, not XeLaTeX, which didn't work for me.)

\documentclass{article}
\usepackage{fontspec}
\usepackage{xcolor}
\newfontfamily\Hiragino{Hiragino Sans}[Color=red]
\begin{document}

{\Huge\Hiragino 🅱}
\end{document}


• Yeah, I think it just amounts to finding a font on your computer that has 🅱. On my computer (running Ubuntu), the font "Symbola" worked for me. Mar 18 '18 at 21:23
• @BrianLee I'm glad you got it working. Mar 18 '18 at 21:24
• @AlanMunn Kind and excellent user but the color of B symbol change always? Before It war brown, after red and now magenta. Mar 19 '18 at 9:59

This 🅱 sign in LaTeX it can work also without XeLaTeX. It is an alternative.

\documentclass{scrartcl}
\usepackage{xcolor}
\usepackage{tikz}
\newcommand{\Boo}[1]{
\begin{tikzpicture}[#1]
\node [fill=magenta, draw=magenta, rounded corners,minimum height = 12pt, minimum width = 12pt, inner sep = 1] at (10pt,10pt) {\textcolor{white}{\textbf B}};
\end{tikzpicture}
}
\begin{document}
We have \Boo{} a new symbol.

\end{document}


Maybe too classic, but ...

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{xcolor}
\usepackage{newunicodechar}
\newunicodechar{🅱}%
{{\fboxsep1pt\colorbox{black}{\color{white}\sffamily\bfseries B}}}
\newunicodechar{🅰}%
{{\fboxsep1pt\colorbox{black}{\color{white}\sffamily\bfseries A}}}

\begin{document}

🅱l🅰ck and white

\end{document}


Another option with tcbox

\documentclass[11pt,a4paper]{article}

\usepackage{tcolorbox}
\usepackage{lmodern}

\newtcbox{\mychar}[1][]{nobeforeafter, tcbox raise base, colback=red, colframe=black, sharp corners, colupper=white, size=fbox, #1}

\begin{document}

How to write \mychar{B} or any other char (\mychar{A}, \mychar[colback=blue!70!black]{Z}, \mychar{!}, \mychar{\dots}) in \LaTeX

\end{document}