Adjusting icon size /tikz

resizesize;tikz-pgf

How can I make these icons have identical size?

enter image description here

https://www.overleaf.com/latex/templates/twenty-seconds-curriculum-vitae/kfgsngtymkfj

The code that adds the rounded backgrounds is below. Can I modify it somehow to get what I need?

\newcommand*\icon[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white] (char) {#1};}}

Then the list with icons is printed here:

\renewcommand{\arraystretch}{1.6}
\begin{tabular}{p{0.5cm} @{\hskip 0.5cm}p{5cm}}
\ifthenelse{\equal{\givencvdate}{}}{}{\textsc{\Large\icon{\Info}} & \givencvdate\\}
\ifthenelse{\equal{\givencvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \givencvaddress\\}
\ifthenelse{\equal{\givennumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \givennumberphone\\}
\ifthenelse{\equal{\givencvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \href{\givencvsite}{\textcolor{cerulean}\givencvsite}\\}
\ifthenelse{\equal{\givencvmail}{}}{}{\textsc{\large\icon{@}} & \href{mailto:\givencvmail}{\givencvmail}}
\end{tabular}

Best Answer

To fix this, you have to modify the cls file. I actually don't know whether it looks right in your context, since you do not provide a complete document showing your settings.

First, change the definition of \icon to

\newcommand*\icon[2][-1.3mm]{\tikz[baseline={(0,-1.5mm)}]{
            \node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white,minimum width=6.5mm] (char) {\makebox[0pt][c]{\raisebox{#1}[0pt][0pt]{#2}}};}}

Modify 6.5mm for the size of the blue discs and -1.5mm to shift the discs up and down relative to the line.

I have added an optional argument to \icon, for vertical adjustment of the icon within the disc. I used it twice, so you have to change the following lines as well.

\ifthenelse{\equal{\givencvdate}{}}{}{\textsc{\Large\icon[-2mm]{\Info}} & \givencvdate\\}
\ifthenelse{\equal{\givencvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \givencvaddress\\}
\ifthenelse{\equal{\givennumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \givennumberphone\\}
\ifthenelse{\equal{\givencvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \href{\givencvsite}{\textcolor{cerulean}\givencvsite}\\}
\ifthenelse{\equal{\givencvmail}{}}{}{\textsc{\large\icon[-1mm]{@}} & \href{mailto:\givencvmail}{\givencvmail}}

Finally, you should change the string that the style uses for identification (first line of the cls file):

\ProvidesClass{twentysecondcv}[2021/08/02 CV class patched]