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?
Asked
Active
Viewed 4,394 times
20
4 Answers
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}
Alan Munn
- 218,180
-
1Yeah, 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. – Brian Lee Mar 18 '18 at 21:23
-
-
@AlanMunn Kind and excellent user but the color of B symbol change always? Before It war brown, after red and now magenta. – Sebastiano Mar 19 '18 at 09:59
15
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}
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}
Ignasi
- 136,588



\char{"1F171}ought to work. – Davislor Mar 19 '18 at 01:14