20

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?

Brian Lee
  • 433

4 Answers4

18

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}

output of code

Alan Munn
  • 218,180
15

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

enter image description here

\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}
Sebastiano
  • 54,118
6

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}

lck and white

\end{document}
Fran
  • 80,769
4

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}

enter image description here

Ignasi
  • 136,588