I want to have circled numbers in my text and use the TikZ solution posted here. However, I want to make the circles and text a bit smaller so I tried this:
\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: \scriptsize{\circled{1}} end.
\end{document}
Unfortunatly, the \scriptsize seems to "leak" because all text after this command is small (in the text the "end" is also in scriptsize) although the curly parentesis are closed correctly.
How can I make this work without having the \scriptsize command "leak"?


inner sepoption. Just decrease it with for exampleinner sep=.5pt– AndréC Aug 19 '19 at 11:56\scriptsizedoes not take an argument. Try to enclose the text with changed font size in braces instead:{\scriptsize some text}. In this case, I would suggest\circled{\scriptsize 1}– crateane Aug 19 '19 at 11:57\newcommand*\circled[2][]{\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=2pt,#1] (char) {#2};}}and then do e.g.\circled[scale=0.6]{1}or\circled[font=\scriptsize]{1}. – Aug 19 '19 at 12:15inner sep) if desired. – crateane Aug 19 '19 at 12:17\scriptsizehas no argument, it doesn't change anything because you put the 8 in a group delimited by brackets. This group allows you to circle two-digit numbers such as 18 or 20... – AndréC Aug 19 '19 at 16:06it leaks. This is not really related to two-digit numbers or the circle size. – crateane Aug 19 '19 at 19:01