As a Teaching Assistant for a class, I am trying to draw a seating chart for the professor. The seating chart will have a photo of each student, the student's name, and where the student is sitting in the lecture room. I need to produce two seating charts:
- A blank seating chart where a rectangle represents each chair, for students to fill in their names where they are seated.
- A seating chart with students' names and photos.
Before attempting to draw a seating chart for the 80+ seats in the lecture hall, I am working on a smaller example with 11 seats. Currently, the code I use to draw the blank seating chart and the output looks like the following:
\documentclass[10pt]{article}
\usepackage[margin=0in,paperwidth=17in, paperheight=11in]{geometry}
\usepackage{tikz}
% Usage: \student{x coord}{y coord}{name}{picture file}
%\newcommand{\student}[4]{%
% \node[anchor=base,inner sep=0,
% label={[text width=20mm,align=center]below:#3}] at (#1,#2)
% {\includegraphics[width=17mm]{#4}};%
%}
% Draw an empty box for each chair
\newcommand{\student}[4]{
\node[anchor=base,shape=rectangle,draw,
minimum width=17mm,minimum height=22mm]
at (#1,#2) {};
}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw[white] (0,0) -- (43.1,0) -- (43.1,27.9) -- (0,27.9) -- (0,0);
\draw (5,5) -- (10,15);
\draw (12,18) -- (31,18);
\draw (38,5) -- (33,15);
\student{4}{7}{George Washington}{empty-face.png};
\student{5.5}{10}{John Adams}{empty-face.png};
\student{7}{13}{Thomas Jefferson}{empty-face.png};
\student{12.5}{20}{James Madison}{empty-face.png};
\student{17}{20}{James Monroe}{empty-face.png};
\student{21.5}{20}{John Quincy Adams}{empty-face.png};
\student{26}{20}{Andrew Jackson}{empty-face.png};
\student{30.5}{20}{Martin Van Buren}{empty-face.png};
\student{36}{13}{William Henry Harrison}{empty-face.png};
\student{37.5}{10}{John Tyler}{empty-face.png};
\student{39}{7}{James K Polk}{empty-face.png};
\end{tikzpicture}
\end{center}
\end{document}

And the code for the seating chart with people's names and photos is very similar:
\documentclass[10pt]{article}
\usepackage[margin=0in,paperwidth=17in, paperheight=11in]{geometry}
\usepackage{tikz}
% Usage: \student{x coord}{y coord}{name}{picture file}
\newcommand{\student}[4]{%
\node[anchor=base,inner sep=0,
label={[text width=20mm,align=center]below:#3}] at (#1,#2)
{\includegraphics[width=17mm]{#4}};%
}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw[white] (0,0) -- (43.1,0) -- (43.1,27.9) -- (0,27.9) -- (0,0);
\draw[line width=5mm] (5,5) -- (10,15);
\draw[line width=5mm] (12,18) -- (31,18);
\draw[line width=5mm] (38,5) -- (33,15);
\student{4}{7}{George Washington}{empty-face.png};
\student{5.5}{10}{John Adams}{empty-face.png};
\student{7}{13}{Thomas Jefferson}{empty-face.png};
\student{12.5}{20}{James Madison}{empty-face.png};
\student{17}{20}{James Monroe}{empty-face.png};
\student{21.5}{20}{John Quincy Adams}{empty-face.png};
\student{26}{20}{Andrew Jackson}{empty-face.png};
\student{30.5}{20}{Martin Van Buren}{empty-face.png};
\student{36}{13}{William Henry Harrison}{empty-face.png};
\student{37.5}{10}{John Tyler}{empty-face.png};
\student{39}{7}{James K Polk}{empty-face.png};
\end{tikzpicture}
\end{center}
\end{document}

In my prior post: Aligning image and text in new command in TikZ, Peter Grill recommended using a \foreach loop to plot multiple students. This is a great idea! Unfortunately, the seating in the lecture room is not regular. In fact, there are ~80 seats behind the desks which are shown in the image below:
My question is the following.
What I would like to do is to define a list of locations:
\newcommand{\ListOfSeats}{
(4,7) (5.5,10) (7,13) (12.5,20) (17,20)
(21.5,20) (26,20) (30.5,20) (36,13) (37.5,10) (39,7)
}
and a list of students' names and photos
\newcommand{\ListOfStudents}{
(George Washington, george-washington.jpg)
(John Adams, john-adams.jpg)
(Thomas Jefferson, thomas-jefferson.jpg)
...
}
Is there a way to then use a single \foreach loop to draw all the 80 seats, and all the 80 students with their names and photos?
Thanks for reading to the end, this was a long question but I hope you found it interesting!



{}instead of(),/instead of,)? It would also be easier to use one list with entries like:George Washington/george-washington.jpg/4/7– Qrrbrbirlbel Feb 17 '13 at 03:03George Washington, george-washington.jpgcommon to all the students and their images? If yes, then we don't need the 2 comma-separated elements: 1 will suffice. – Ahmed Musa Feb 17 '13 at 06:55