5

I want two put two columns of several images. In order to facilitate the modification of the image number and the style, I have used the command \foreach. My problem that the picture would split into several pages but I could not reach this effect. Here is the code i have written.

\begin{tikzpicture}[font=\small\sffamily]
\node (row1) {\includegraphics[width=0.49\textwidth]{images/Original/1}};
\node[left=0mm of row1]  {\includegraphics[width=0.49\textwidth]{images/Segmented/1}};
\foreach \i [remember=\i as \lastx (initially 1)] in {2,...,50} {
\node[below=0mm of row\lastx] (row\i) {\includegraphics[width=0.49\textwidth {images/Original/\i}};
\node[left= 0mm of row\i] {\includegraphics[width=0.49\textwidth]{images/Segmented/\i}};
};
\end{tikzpicture}

2 Answers 2

7

a tikz-picture is a box, I don't think you can make it break but it looks as if you just want a sequence of images more like

\newcount\foo

\foo=1
\loop
\par
\includegraphics[width=0.49\textwidth]{images/Original/\the\foo}\hfill
\includegraphics[width=0.49\textwidth]{images/Segmented/\the\foo}%
\par
\ifnum\foo<50
\advance\foo 1
\repeat
3
  • Thanks very much. This could be a great solution. But I will prefer resolve it using only latex and tikz commands. But, while I do not find a better solution I will use your suggestion. Thanks a lot May 31, 2013 at 18:47
  • @user17888 ????? \loop is defined in the LaTeX format, in what sense do you mean it isn't a latex command? (You could use pgf's \foreach if you prefer, the loop syntax isn't the main point, taking the images out of the tikzpicture is. May 31, 2013 at 18:53
  • Ok. I was confused. Thanks very much.I'll try to use \foreach. May 31, 2013 at 19:07
2

Well you didn't end your tikzpicture in your example. If you are including graphics, why not use

\begin{figure}
\subfloat[]{}
...
\label{}
\end{figure}
5
  • That won't solve the fact that a tikzpicture is not breakable across pages.
    – cjorssen
    May 31, 2013 at 18:26
  • @cjorssen well my suggestion was to use a figure but the user didn't end his picture which would cause problems to begin with.
    – dustin
    May 31, 2013 at 18:27
  • I do not understand how this proposal solves my problem. I do not want to put caption. I just one two have two columns of 50 images, each row. So I'm trying to skip the process of doing 50 copy&paste. Have I explained well my problem? May 31, 2013 at 18:28
  • @user17888 than don't use a caption and it wont appear
    – dustin
    May 31, 2013 at 18:29
  • @user17888 you can try to execute the loop in the figure. I haven't ever done that before so I don't know if it will work but there is probably a way to get it to work if not. I just felt the figure environment may better suit your needs.
    – dustin
    May 31, 2013 at 18:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .