Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I create many images with TikZ and I would like to make an image gallery. It should look like this:

enter image description here

The gallery should

  • put the image in front of a (gray) background
  • resize the image to a maximum width / height (and leave the aspect ratio intact)

It would be nice if I could put the images in seperate files and use something like

\begin{gallery}
    \input{tikz/myImage1.tex}[Some title]
    \input{tikz/myImage2.tex}[another title]
    \input{tikz/mathImage.tex}[This is a visualization of $f(x, y) = x^2 y^2$]
\end{gallery}

This is what I've got so far (code also at GitHub):

\documentclass[a4paper,12pt]{article}
\usepackage{amssymb,amsmath} % needed for math
\usepackage{standalone} % needed for includestandalone
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf

\usepackage{adjustbox}
\usepackage{xcolor}
\definecolor{myLightGray}{HTML}{F9F9F9}
\definecolor{borderColor}{HTML}{CCCCCC}

\usepackage{tikz} % needed for includestandalone
\usetikzlibrary{arrows,positioning, calc}

\tikzset{
    pil/.style={->,thick}
}

\newenvironment{gallery}{}{}

\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
erat, 
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea 
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem 
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et 
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, 
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum 
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum 
dolor sit amet.   

\noindent
\begin{gallery}
    \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-1}}
    \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-2}}
    \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-3-1}}
    \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-6}}
    \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{equilateral-triangle}}
    \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{equilateral-triangle-heights}}
\end{gallery}

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse 
molestie consequat, vel illum dolore eu feugiat nulla facilisis at 
vero eros et accumsan et iusto odio dignissim qui blandit praesent 
luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.   

\end{document}

Which produces:

gallery so far

I've used \includestandalone, but with this I had to add the style defined in \tikzset in dot-product-1.tex to the main document. Thats not good.

share|improve this question
    
Some hints: standalone allows you to include TikZ images or any other TeX file using \includestandalone[<options>}{<filename>} where you can use the same (standard) options like for \includegraphics. Also adjustbox is able to turn its content into a float and add a caption. The three-in-a-row format needs extra effort, however. –  Martin Scharrer Sep 27 '12 at 15:51
    
Hi Martin, I've used \includestandalone as you suggested. Do you know how I could define a gallery-environment, that adds the \includestandalone + adjustbox automatically? (I've provided the code on github, the link is in my question). By the way, it doesn't have to be 3-in-a-row. It should only fit to the page width. –  moose Sep 28 '12 at 10:27
    
There is nothing impossible in TeX. See the most similar question here. –  Please don't touch Sep 28 '12 at 10:27
    
@MartinScharrer I have now also used adjustbox. The result is now much nicers, but I don't know how to fix the size :-( –  moose Sep 28 '12 at 12:14
    
@moose: Use width and height instead of max width and max height to get a fixed size. You need to add keepaspectratio so that the ratio isn't changed. One side might then be smaller than requested. –  Martin Scharrer Sep 28 '12 at 17:57

2 Answers 2

up vote 9 down vote accepted

To horizontally align the content in the gray rectangle use center=4cm, which will force an official width of 4cm and horizontally center the content in it without doing any further scaling. The vertical alignment can be done using valign=M followed by a set vsize={2cm}{2cm}. Alternatively you can also use raise={.5\depth-.5\height}{2cm}{2cm}. Note that both will align the middle of the boxes at the baseline, which is fine here, but you might want to raise=2cm it in other cases.

\documentclass[a4paper,12pt]{article}
\usepackage{amssymb,amsmath} % needed for math
\usepackage{standalone} % needed for includestandalone
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf

\usepackage{adjustbox}
\usepackage{xcolor}
\definecolor{myLightGray}{HTML}{F9F9F9}
\definecolor{borderColor}{HTML}{CCCCCC}

\usepackage{tikz} % needed for includestandalone
\usetikzlibrary{arrows,positioning, calc}

\tikzset{
    pil/.style={->,thick}
}

\newenvironment{gallery}{%
    \center
}{%
    \par\endcenter
}

\def\galleryimage#1{%
    \adjustbox{width=4cm,height=4cm,keepaspectratio, center=4cm,
    valign=M, set vsize={2cm}{2cm},
    %or: raise={.5\depth-.5\height}{2cm}{2cm},
    bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}
    {\includestandalone{#1}}%
    \space\ignorespaces
}%

\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
erat, 
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea 
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem 
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et 
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, 
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum 
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum 
dolor sit amet.   

\begin{gallery}
    \galleryimage{dot-product-1}
    \galleryimage{dot-product-2}
    \galleryimage{dot-product-3-1}

    \galleryimage{dot-product-1}
    \galleryimage{dot-product-2}
    \galleryimage{dot-product-3-1}

    \galleryimage{dot-product-6}
    \galleryimage{equilateral-triangle}
    \galleryimage{equilateral-triangle-heights}
\end{gallery}


Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse 
molestie consequat, vel illum dolore eu feugiat nulla facilisis at 
vero eros et accumsan et iusto odio dignissim qui blandit praesent 
luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.   

\end{document}

It looks like this:

example

share|improve this answer
    
Thanks for your answer (+1 and accept). Is it possible to add captions below the single images? –  moose Sep 28 '12 at 20:02

Here's a work in progress:

Code

\documentclass{scrartcl}
\usepackage[margin=25.4mm]{geometry}
\usepackage{tikz}
\usepackage{filecontents}
\usepackage{xifthen}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\newcommand{\getsizes}%
{   \path (current bounding box.south west);
    \pgfgetlastxy{\xsw}{\ysw}
    \path (current bounding box.north east);
    \pgfgetlastxy{\xne}{\yne}
    \pgfmathsetlengthmacro{\picwidth}{\xne-\xsw}
    \pgfmathsetlengthmacro{\picheight}{\yne-\ysw}
    \pgfmathsetmacro{\picscale}{\picwidth>\picheight ? (0.3*\textwidth)/\picwidth : (0.3*\textwidth)/\picheight}
    \pgfmathsetlengthmacro{\biggervalue}{\picwidth>\picheight ? \picwidth : \picheight}
    \xdef\scalefactor{\picscale}
    \xdef\picdimension{\biggervalue}
}

\newcommand{\grayback}%
{   \begin{pgfonlayer}{background}
        \fill[gray!50] (current bounding box.center) ++(-\picdimension/2,-\picdimension/2) rectangle ++(\picdimension,\picdimension);
    \end{pgfonlayer}
}

\newcommand{\adjustedtikzsize}[2]% draw commands, caption
{ \stepcounter{galleryitem}
    \smash{\vphantom{
    \begin{tikzpicture}
        #1
        \getsizes
    \end{tikzpicture}
    }}
    \begin{tikzpicture}[scale=\scalefactor]
        #1
        \grayback
        \node[below right] at (current bounding box.south west) {#2};
    \end{tikzpicture}
    \pgfmathtruncatemacro{\breaktest}{mod(\thegalleryitem,3)}
    \ifthenelse{\breaktest=0}{\par}{\hspace{0.02\textwidth}}
}

\newcounter{galleryitem}
\setcounter{galleryitem}{0}
\newenvironment{tikzgallery}[1]% gallery title
{{\Huge\textbf{#1}}\par}%
{\par}

\begin{filecontents}{picone.tex}
\draw[rotate=30,left color=red,right color=blue] (0,0) rectangle (5,2);
\end{filecontents}

\begin{filecontents}{pictwo.tex}
\draw[rotate=20,left color=green,right color=red] (0,0) rectangle (5,2);
\end{filecontents}

\begin{filecontents}{picthree.tex}
\draw[rotate=40,left color=orange,right color=blue] (0,0) rectangle (5,2);
\end{filecontents}

\begin{document}

\parindent0mm
\parskip0mm

\begin{tikzgallery}{Geometrie}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
\end{tikzgallery}

\end{document}

Result

enter image description here


Edit 1: Now with:

  • choosable amount of pictures per row (breaks partially for n ≥ 10)
  • improved alignment
  • dynamic spaces between pictures
  • environment breaking across pages ;)

Code

\documentclass{scrartcl}
\usepackage[margin=10mm]{geometry}
\usepackage{tikz}
\usepackage{filecontents}
\usepackage{xifthen}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\newcommand{\getsizes}%
{   \path (current bounding box.south west);
    \pgfgetlastxy{\xsw}{\ysw}
    \path (current bounding box.north east);
    \pgfgetlastxy{\xne}{\yne}
    \pgfmathsetlengthmacro{\picwidth}{\xne-\xsw}
    \pgfmathsetlengthmacro{\picheight}{\yne-\ysw}
    %\pgfmathsetmacro{\picscale}{\picwidth>\picheight ? (0.3*\textwidth)/\picwidth : (0.3*\textwidth)/\picheight}
    \pgfmathsetmacro{\picscale}{\picwidth>\picheight ? (1.05-\picturesperrow*0.05)/\picturesperrow*\textwidth/\picwidth : (1.05-\picturesperrow*0.05)/\picturesperrow*\textwidth/\picheight}
    \pgfmathsetlengthmacro{\biggervalue}{\picwidth>\picheight ? \picwidth : \picheight}
    \xdef\scalefactor{\picscale}
    \xdef\picdimension{\biggervalue}
}

\newcommand{\grayback}%
{   \begin{pgfonlayer}{background}
        \fill[gray!50] (current bounding box.center) ++(-\picdimension/2,-\picdimension/2) rectangle ++(\picdimension,\picdimension);
    \end{pgfonlayer}
}

\newcommand{\adjustedtikzsize}[2]% draw commands, caption
{ \stepcounter{galleryitem}
    \smash{\vphantom{
    \begin{tikzpicture}
        #1
        \getsizes
    \end{tikzpicture}
    }}
    \begin{tikzpicture}[scale=\scalefactor,baseline=(captionnode.north)]
        #1
        \grayback
        \node[below right] (captionnode) at (current bounding box.south west) {#2};
    \end{tikzpicture}
    \pgfmathtruncatemacro{\breaktest}{mod(\thegalleryitem,\picturesperrow)}
    \ifthenelse{\breaktest=0}{\par}{\hfill}%{\hspace{0.02\textwidth}}
}

\newcounter{galleryitem}
\setcounter{galleryitem}{0}

\newenvironment{tikzgallery}[2]% gallery title, pics per row
{{\Huge\textbf{#1}}\par\xdef\picturesperrow{#2}}%
{\par\vspace{1cm}}

\begin{filecontents}{picone.tex}
\draw[rotate=30,left color=red,right color=blue] (0,0) rectangle (5,2);
\end{filecontents}

\begin{filecontents}{pictwo.tex}
\draw[rotate=20,left color=green,right color=red] (0,0) rectangle (5,2);
\end{filecontents}

\begin{filecontents}{picthree.tex}
\draw[rotate=40,left color=orange,right color=blue] (0,0) rectangle (5,2);
\end{filecontents}

\begin{filecontents}{picfour.tex}
\draw[left color=black!10,right color=black!90] (-1,-7) rectangle (1,7);
\draw[left color=yellow,right color=violet] (0,0) circle (5);
\end{filecontents}

\begin{document}

\parindent0mm
\parskip0mm

\begin{tikzgallery}{Geometrie}{6}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}    
\end{tikzgallery}
\begin{tikzgallery}{Ti\textit{k}Z-Spielerei}{4}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}    
\end{tikzgallery}
\clearpage
\begin{tikzgallery}{Riesige Bilder}{2}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
\end{tikzgallery}

\end{document}

Result

enter image description here


Edit 2: Some explanations, fixed galleryitem counter:

Commented Code

\documentclass{scrartcl}
% should work with all formats and margins, but probably not very well in small spapes
\usepackage[margin=10mm]{geometry}
\usepackage{tikz}
% for creating the dummy .tex files
\usepackage{filecontents}
\usepackage{xifthen}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\newcommand{\getsizes}%
{   
% get coordinates of bottom left and top right corner of the bounding box   
    \path (current bounding box.south west);
    \pgfgetlastxy{\xsw}{\ysw}
    \path (current bounding box.north east);
    \pgfgetlastxy{\xne}{\yne}
% use these to compute height and width of the picture
    \pgfmathsetlengthmacro{\picwidth}{\xne-\xsw}
    \pgfmathsetlengthmacro{\picheight}{\yne-\ysw}
% as the pictures are going to be set on a gray square, we need the bigger dimension; then the scaleing factor is computed: 5% \textwidth spacing subtracted to make \hfill work correctly, then basically \texttwidth/\picdim
    \pgfmathsetmacro{\picscale}{\picwidth>\picheight ? (1.05-\picturesperrow*0.05)/\picturesperrow*\textwidth/\picwidth : (1.05-\picturesperrow*0.05)/\picturesperrow*\textwidth/\picheight}
% find out if height or width is bigger, and save this info and the scale factor in a global macro
    \pgfmathsetlengthmacro{\biggervalue}{\picwidth>\picheight ? \picwidth : \picheight}
    \xdef\scalefactor{\picscale}
    \xdef\picdimension{\biggervalue}
}

\newcommand{\grayback}%
{   \begin{pgfonlayer}{background}
        %  putting the gray background; \picdimension was set by "\getsizes"
        \fill[gray!50] (current bounding box.center) ++(-\picdimension/2,-\picdimension/2) rectangle ++(\picdimension,\picdimension);
    \end{pgfonlayer}
}

\newcommand{\adjustedtikzsize}[2]% draw commands, caption
{ \stepcounter{galleryitem}
% make height and width of the box of the tikzpicture 0, also don't print anything; so the picture is "drawn" twice, the first time invisible to get the dimensions for computation of the scaling factor
    \smash{\vphantom{
    \begin{tikzpicture}
% insert the draw commands
        #1
% determine the scaling factor and the bigger of picheight and picwidth; save both to global macros     
        \getsizes
    \end{tikzpicture}
    }}
% the same picture again, but this time really drawn, with previousely set scaling factor and baseline option for aligning the pictures
    \begin{tikzpicture}[scale=\scalefactor,baseline=(captionnode.north)]
% insert the draw commands
        #1
% gray background       
        \grayback
% caption node
        \node[below right] (captionnode) at (current bounding box.south west) {#2};
    \end{tikzpicture}
% compute "pic mod picsperrow"; if zero, we need to break the line
    \pgfmathtruncatemacro{\breaktest}{mod(\thegalleryitem,\picturesperrow)}
    \ifthenelse{\breaktest=0}{\par}{\hfill}
}

%counter to keep track of the gallery items
\newcounter{galleryitem}
\setcounter{galleryitem}{0}

\newenvironment{tikzgallery}[2]% gallery title, pics per row
% ser the title in huge, globally set picsperrow, reset galleryitem counter
{{\Huge\textbf{#1}}\par\xdef\picturesperrow{#2}\setcounter{galleryitem}{0}}%
{\par\vspace{1cm}}

% some dummy .tex files which contain just plain tikz commands, no preamble, no tikzpicture environment
\begin{filecontents}{picone.tex}
\draw[rotate=30,left color=red,right color=blue] (0,0) rectangle (5,5);
\end{filecontents}

\begin{filecontents}{pictwo.tex}
\draw[rotate=20,left color=green,right color=red] (0,0) rectangle (1,9);
\end{filecontents}

\begin{filecontents}{picthree.tex}
\draw[rotate=40,left color=orange,right color=blue] (0,0) rectangle (5,2);
\end{filecontents}

\begin{filecontents}{picfour.tex}
\draw[left color=black!10,right color=black!90] (-1,-7) rectangle (1,7);
\draw[left color=yellow,right color=violet] (0,0) circle (5);
\end{filecontents}

\begin{document}

\parindent0mm
\parskip0mm

\begin{tikzgallery}{Geometrie}{6}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}    
\end{tikzgallery}
\begin{tikzgallery}{Ti\textit{k}Z-Spielerei}{3}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}    
\end{tikzgallery}
\clearpage
\begin{tikzgallery}{Riesige Bilder}{2}
    \adjustedtikzsize{\input{picone}}{one}
    \adjustedtikzsize{\input{pictwo}}{two}
    \adjustedtikzsize{\input{picthree}}{three}
    \adjustedtikzsize{\input{picfour}}{four}
    \adjustedtikzsize{\input{picfour}}{zero}    
    \adjustedtikzsize{\input{pictwo}}{un}
    \adjustedtikzsize{\input{picthree}}{deux}
    \adjustedtikzsize{\input{picone}}{trois}
\end{tikzgallery}

\end{document}

Result

enter image description here

share|improve this answer
    
Can it be broken across pages? –  Please don't touch Sep 28 '12 at 11:59
2  
@ガベージコレクタ: Cool, it does, without requirering me to do anything :) –  Tom Bombadil Sep 28 '12 at 15:57
    
+1 for this cool feature. –  Please don't touch Sep 28 '12 at 16:30
    
Thanks for your answer! I've added it (with a view changes) to my repository: github.com/MartinThoma/LaTeX-examples/tree/master/documents/… But I have to admit that I don't understand it. How can I reduce the margin between the images? –  moose Sep 28 '12 at 19:33
    
I just noticed the update. Thanks for providing the commented code! –  Kevin P. Kilburn Oct 12 '13 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.