20.11.15

Good way to make \textcircled numbers?

Here's a TikZ solution:
\documentclass{article}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
Numbers aligned with the text:  \circled{1} \circled{2} \circled{3} end.
\end{document}
alt text
It's just a node. TikZ options are used to align the base line, to adjust the size and to get the circle shape. You're free to choose further options regarding size or circle thickness (option thick). There's more: for example you could even name the nodes by another argument to connect them by arrows later.
If one like to use it for an enumerated list, for example, it's easy but has to be protected:
\usepackage{enumitem}
...
\begin{enumerate}[label=\protect\circled{\arabic*}]
\item First item
\item Second item
\item Third item
\item Fourth item
\end{enumerate}
alt text

No hay comentarios:

Publicar un comentario