6

This question already has an answer here:

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

marked as duplicate by siracusa, Phelype Oleinik, user170109, Stefan Pinnow, Raaja Jun 7 at 5:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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. – user36296 Jun 14 '17 at 13:48
4

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}
  • @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? – CampanIgnis Jun 14 '17 at 13:55
  • @CampanIgnis That might have been better, yes. The problem is, I lack the reputation to create comments ... – P. Siehr Jun 14 '17 at 14:06
4

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.