8

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.

enter image description here

1
  • 1
    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. Commented Jun 14, 2017 at 13:48

2 Answers 2

7

Created from this answer linked in the question above.

\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}
2
  • @P. Siehr: Wouldn't it be a better way to just post a comment on the link to the (already) existing answer instead of just copying it? Commented Jun 14, 2017 at 13:55
  • @CampanIgnis That might have been better, yes. The problem is, I lack the reputation to create comments ...
    – P. Siehr
    Commented Jun 14, 2017 at 14:06
6

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}

enter image description here


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

The package https://ctan.org/pkg/circledtext is an alternative.

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

Not the answer you're looking for? Browse other questions tagged .