I'm trying to lean TikZ.
I've written the following small document
\documentclass[tikz,border=12pt]{standalone}
\usepackage{ifthen}
\usepackage{pgf, tikz}
\usetikzlibrary{graphs,calc}
\makeatletter
\newcommand*\circled[1]{\smash{\tikz[baseline=(char.base)]{
\node[anchor=text, shape=circle,fill,draw,inner sep=0pt,text=white,minimum size=1.4em] (char) {#1\strut};}}}
\makeatother
\begin{document}
\begin{tikzpicture}
% \draw(4,-1) rectangle(8,4);
\foreach \y in {1, ..., 4}
\foreach \x in {1, ..., 8} {
\ifthenelse{\equal{\x}{5} \AND \equal{\y}{3}}{\draw(\x,\y)rectangle(0.4cm,0.4cm)}{
\ifthenelse{\equal{\x}{4} \AND \equal{\y}{2}}{
\draw[thick] (\x,\y) rectangle (0.4cm,0.4cm);
\draw(\x,\y)rectangle(0.4cm,0.4cm)}{\draw(\x,\y)circle(0.4cm)}};
}
\end{tikzpicture}
\end{document}
They output should be a set of 4x8 circles, but the 4th circle of the second row and then 5th circle of the third row should be replaced by rettangles.
I don't understand why they are as in the picture.
Finally, how can define a command which writes numbers in the circles according to the parameters passed by another document. I taught that I could use the newcommand \circled, but I don't understand how.
Please help me!
rectangle ++(0.4cm, 0.4cm)
(or even better, shift it 0.2cm to the left and bottom beforehand). Which kind of number parameter do you want to use?