If I compile the following code :
\documentclass[12pt]{article}
\usepackage[french]{babel}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\foreach \i in {(0,0),(0,2.1),(2.1,2.1),(2.1,0)} {
\fill[lightgray] \i rectangle ($(\i+(0.7,0.7)$); }
\draw (0,0) grid[step=0.7] (2.8,2.8);
\end{tikzpicture}
\end{document}
I have no problem and this give me that I want. But the expression between "$" is ill-parenthesized.
If I replace $(\i+(0.7,0.7)$ by $\i+(0.7,0.7)$ I have the following error message :
Runaway argument?
\i +(0.7,0.7)$); \pgffor@endhook \ifx \pgffor@assign@after@code \pgfutil@empty
\ETC.
! Paragraph ended before \tikz@cc@parse@factor was complete.
<to be read again>
\par
l.15
And If I replace $(\i+(0.7,0.7)$ by $(\i+(0.7,0.7))$ or $(\i)+(0.7,0.7)$ I have the following error message :
! Package tikz Error: + or - expected.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
...
l.12 ...htgray] \i rectangle ($(\i)+(0.7,0.7)$); }
It is a bug or I do something wrong ? (or it is just a correct strange syntax ?)


\foreach \i in {{0,0},{0,2.1},{2.1,2.1},{2.1,0}}and then\fill[red] (\i) rectangle ($(\i)+(0.7,0.7)$);. No ? – Kpym Dec 16 '14 at 22:25calcexpression unless it sees an explicit((even if you have two consecutive((right now). That's the catch I wanted to demonstrate. Fixing the code is easy anyhow so I didn't bother to offer an alternative. – percusse Dec 16 '14 at 22:40