One of my coauthors wants to typeset a letter that is inside a solid filled circle. I went through various symbol lists of packages, yet without luck. I am not sure if my memory is doing a trick on me, but I am sure I have seen it in publications.
Asked
Active
Viewed 1,157 times
3 Answers
4
A possible solution with TiKz.
\documentclass[]{article}
\usepackage{tikz}
\tikzset{%
pics/mycirc/.style args={#1}{
code = {
\node [draw, circle,fill] {\color{white}#1};
}}}
\begin{document}
This is \tikz [anchor=base,baseline] \pic {mycirc=B}; as mycircle.
\end{document}
-
Hi, just this is a duplicate of the comment of @campa. :-) My greetings. – Sebastiano Dec 08 '20 at 12:26
4
There is a package for just that: circledsteps.
\documentclass{article}
\usepackage{xcolor}
\usepackage{circledsteps}
\newcommand\myCircled[2][]{\ifmmode
\Circled[fill color=black,inner color=white,#1]{\mathsf{#2}}
\else
\Circled[fill color=black,inner color=white,#1]{\sffamily#2}
\fi
}
\begin{document}
\scriptsize A \myCircled{B} C
\footnotesize A \myCircled{B} C
\normalsize A \myCircled{B} C
\large A \myCircled{B} C
\Large A \myCircled{B} C
${\scriptstyle A \myCircled{B} C}$
$A \myCircled{B} C$
$A \myCircled{B} C_{{A \myCircled{B} C}_{A \myCircled{B} C}}$
\end{document}
-
This looks really good, thanks a lot. Could you give me a hint on how to move the letter to the right in the circle. The documentation was not too helpful. – Simon T. Dec 08 '20 at 13:35
-
@SimonT. You can add horizontal space in the circle, e.g.
\newcommand\myCircled[2][]{\ifmmode \Circled[fill color=black,inner color=white,#1]{\mathsf{~\mathstrut#2}} \else \Circled[fill color=black,inner color=white,#1]{\sffamily~\strut#2} \fi }. – Dec 08 '20 at 13:39 -
Technically it works, yet it makes the circle bigger, which is an undesired side effect. Do you maybe have another idea? – Simon T. Dec 08 '20 at 19:13
-
@SimonT. Yes. You can reduce the
inner xsepandinner ysep, and then add some space along the lines of the above suggestion. Something like\newcommand\myCircled[2][]{\ifmmode \Circled[fill color=black,inner color=white,inner xsep=0.2ex,inner ysep=0.5ex,#1]{\mathsf{\:#2}} \else \Circled[fill color=black,inner color=white,inner xsep=0.2ex,inner ysep=0.5ex,#1]{\sffamily\:#2} \fi }– Dec 08 '20 at 19:37
3
With XeTeX and LuaTeX, you can directly input (Unicode U+1F151) as long as your font includes this symbol (Quivira is quite good IMHO):
\documentclass{standalone}
\usepackage{fontspec}
\newfontfamily\nicetest{Quivira}
\begin{document}
%\char"1F151\relax
{\nicetest }
\end{document}
-
Thanks for the response. Unfortunately, neither XeTeX nor LuaTeX are an option. I would also like to work Unicode free. – Simon T. Dec 08 '20 at 11:40
-
@SimonT. This may help, using letters instead of numbers: https://tex.stackexchange.com/questions/481168/customize-circled-numbers?noredirect=1&lq=1 – Dec 08 '20 at 11:44
-
@SimonT. then your options are probably only tikz based using circular nodes filled with white text. – daleif Dec 08 '20 at 11:44



