[Tex/LaTex] circle in a tabular

tables

How can I circle some numbers in the following tabular,
keeping the dimensions of lines/columns/cells constant, and avoiding crossing between circles and lines of the tabular ?

Thanks !
Bruno

\documentclass[a4paper, 11pt]{standalone}
\begin{document}
\begin{tabular}
 {|c|c|c|c|c|c|c|c|c|c|}
 \hline 
 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \hline11 & 12 & 13 & 14 
 & 15 & 16 & 17 & 18 & 19 & 20\\ \hline
  21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30\\ \hline 31 & 32 & 33 & 34 
 & 35 & 36 & 37 & 38 & 39 & 40\\ \hline
   41 & 42 & 43 & 44 & 45 & 46 & 47 & 48 & 49 & 50\\ \hline 51 & 52 & 53 & 54 
 & 55 & 56 & 57 & 58 & 59 & 60\\ \hline
   61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70\\ \hline 71 & 72 & 73 & 74 
 & 75 & 76 & 77 & 78 & 79 & 80\\ \hline
   81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 & 90\\ \hline 91 & 92 & 93 & 94 
 & 95 & 96 & 97 & 98 & 99 & 100\\ \hline
   101 & 102 & 103 & 104 & 105 & 106 & 107 & 108 & 109 & 110\\ \hline 111 & 112 & 113 & 114 
 & 115 & 116 & 117 & 118 & 119 & 120\\ \hline
\end{tabular}
\end{document}

Best Answer

Here, I introduce \Circle{} and use it to stack a red oval over the cell. The size of the scale is tailored to your particular table.

\documentclass[a4paper, 11pt]{standalone}
\usepackage{graphicx,stackengine,xcolor}
\newcommand\Circle[1]{%
  \def\useanchorwidth{T}%
  \def\stacktype{L}%
  \stackon[0pt]{#1}{\scalebox{2.8}[1.15]{\textcolor{red}{$\bigcirc$}}}%
}
\begin{document}
\begin{tabular}
 {|c|c|c|c|c|c|c|c|c|c|}
 \hline 
 1 & 2 & \Circle{3} & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \hline11 & 12 & 13 & 14 
 & 15 & 16 & 17 & 18 & 19 & 20\\ \hline
  21 & 22 & 23 & 24 & \Circle{25} & 26 & 27 & 28 & 29 & 30\\ \hline 31 & 32 & 33 & 34 
 & 35 & 36 & 37 & 38 & 39 & 40\\ \hline
   41 & 42 & 43 & 44 & 45 & 46 & 47 & 48 & 49 & 50\\ \hline 51 & 52 & 53 & 54 
 & 55 & 56 & 57 & 58 & 59 & 60\\ \hline
   61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70\\ \hline 71 & 72 & 73 & 74 
 & 75 & 76 & 77 & 78 & 79 & 80\\ \hline
   81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 & 90\\ \hline 91 & 92 & 93 & 94 
 & 95 & 96 & 97 & 98 & 99 & 100\\ \hline
   101 & 102 & \Circle{103} & 104 & 105 & 106 & 107 & 108 & 109 & 110\\ \hline 111 & 112 & 113 & 114 
 & 115 & 116 & 117 & 118 & 119 & 120\\ \hline
\end{tabular}
\end{document}

enter image description here

Note that the macro could be written more compactly (if a bit more obtuse) as

\newcommand\Circle[1]{%
  \stackengine{0pt}{#1}{\scalebox{2.8}[1.15]{\textcolor{red}{$\bigcirc$}}}{O}{c}{F}{T}{L}%
}
Related Question