I need to have a sequence of lines, in which some symbols are circled. Right now I am using a table, the output is shown in the picture:
However as you can see the circles are overlapping with the border of the table, moreover the circles on SN are bigger than the one for S[0-9]. I would like to have an equal distance from the border and an equal circle size for every symbol. These should also include having the same dimension for each row. The code I am using is for the circle the following:
\usepackage{mathtools}% superior to amsmath
\usepackage{tikz}
\makeatletter
\newcommand\mathcircled[1]{%
\mathpalette\@mathcircled{#1}%
}
\newcommand\@mathcircled[2]{%
\tikz[baseline=(math.base)] \node[draw,circle,inner sep=1pt] (math) {$\m@th#1#2$};%
}
\makeatother
The code for the table:
\begin{center}
\begin{table}[]
\centering
\label{my-label}
\begin{tabular}{ccccc}
\hline
S1 & S1 & $\mathcircled{S1}$ & ... & S1 \\ \hline
$\mathcircled{S2}$ & $\mathcircled{S2}$ & S2 & ... & S2 \\ \hline
... & ... & ... & ... & ... \\ \hline
SN & $\mathcircled{SN}$ & $\mathcircled{SN}$ & ... & SN \\ \hline
\end{tabular}
\end{table}
\end{center}
I have taken the code from a previous question: How do I draw a circle around a term in an align* equation?
Thank you.
MWE:
\documentclass[12pt]{article}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{mathtools}% superior to amsmath
\usepackage{tikz}
\makeatletter
\newcommand\mathcircled[1]{%
\mathpalette\@mathcircled{#1}%
}
\newcommand\@mathcircled[2]{%
\tikz[baseline=(math.base)] \node[draw,circle,inner sep=1pt] (math) {$\m@th#1#2$};%
}
\makeatother
\usepackage{tikz-cd}
\newtheorem{definition}{Definition}[section] %% this does it
\newcommand{\cmmnt}[1]{\ignorespaces}
\begin{document}
\newpage
\begin{center}
\begin{table}[]
\centering
\label{my-label}
\begin{tabular}{ccccc}
\hline
S1 & S1 & $\mathcircled{S1}$ & ... & S1 \\ \hline
$\mathcircled{S2}$ & $\mathcircled{S2}$ & S2 & ... & S2 \\ \hline
... & ... & ... & ... & ... \\ \hline
SN & $\mathcircled{SN}$ & $\mathcircled{SN}$ & ... & SN \\ \hline
\end{tabular}
\end{table}
\end{center}



