# A white number inside a black circle. [duplicate]

How to make a white number inside a black circle (the picture below)? I want to change numbers inside the black circle, of course. I use Share LaTeX. I have read some articles here but anyone are not what I would like to get. I would like to get this an article (the picture below) - the sixth answer.

Thanks for help.

• Stating the number of an answer is completely useless, there are at least 3 different orders they can be displayed in - sorted by age, activity or number of votes. Jun 14 '17 at 13:48

\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,fill,inner sep=2pt] (char) {\textcolor{white}{#1}};}}

\begin{document}
\circled{1}
\end{document}

• @CampanIgnis That might have been better, yes. The problem is, I lack the reputation to create comments ... Jun 14 '17 at 14:06

In what context do you want to use the numbers?

This does work in many situations. Observe that the color of the number and the circle are chosen automatically.

\documentclass{memoir}
\usepackage{tikz}
\newcommand{\ballnumber}[1]{\tikz[baseline=(myanchor.base)] \node[circle,fill=.,inner sep=1pt] (myanchor) {\color{-.}\bfseries\footnotesize #1};}

\begin{document}
Earum excepturi inventore necessitatibus aliquid reiciendis enim.  \ballnumber{37} Earum excepturi inventore necessitatibus aliquid reiciendis enim.
\end{document}


Edit:The question Good way to make \textcircled numbers? is related.

• I want to use it as a symbol next to a text in the line. Jun 14 '17 at 13:37
• @ĽubomírMasarovič You mean as a symbol inline or like on the margin? Jun 14 '17 at 13:43
• Can you change size a bit, please. It is still too much large. Thanks. Jun 14 '17 at 13:43
• @ĽubomírMasarovič You can change the size yourself with font=\tiny or font=\footnotesize in the node options. Jun 14 '17 at 13:43
• @ĽubomírMasarovič: You are very welcome. Jun 14 '17 at 13:46