First, I draw three nodes each of which has three parts. Everything is OK. The code and the image are as follows.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[]{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}[]
\foreach \placement in {(0,0),(3.5,0),(1.75,2.5)}
\node [rectangle split, rectangle split parts = 3, rounded corners,
draw, inner ysep = 0.2cm, inner xsep = 1.5pt,
rectangle split part fill = {blue!40, lightgray!80, red!40},
rectangle split every empty part={},
rectangle split empty part height = 0pt]
at \placement
{\texttt{Client} \nodepart{two} \nodepart{three} \texttt{Server}};
\end{tikzpicture}
\end{document}
client_server_onenode http://i1.tietuku.com/cf947fb25d21a591.png
Then I want to assign names to the nodes by adding another parameter
\namein the\foreachstatement.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[]{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}[]
\foreach \name/\placement in {box0/(0,0),box1/(3.5,0), box2/(1.75,2.5)}
\node [rectangle split, rectangle split parts = 3, rounded corners, draw,
inner ysep = 0.2cm, inner xsep = 1.5pt,
rectangle split part fill = {blue!40, lightgray!80, red!40},
rectangle split every empty part={},
rectangle split empty part height = 0pt]
(\name)
at \placement
{\texttt{Client} \nodepart{two} \nodepart{three} \texttt{Server}};
\end{tikzpicture}
\end{document}
This time I get the following errors:
Argument of \XC@definec@lor has an extra }; I've run across a "}" that doesn't seem to match anything.
I am confused about the debug information because I have not added any extra `}'s to the code. Any suggestion to handle with this problem?
NOTE: You can find the read-only source code and debug information at ShareLaTex: Foreach with two arguments.
The related post : How do I debug the message “Argument of \XC@definec@lor has an extra }” has been closed without an MWE.
box0/{(0,0)},.... – Claudio Fiandrino May 28 '14 at 08:57