2

Assume you have 777 pictures. You want to present them on 3x4 A4s. Doing \begin{figure}...\end{figure} takes much time and space.

Is there any other way to present these figures in a folder in such a way? Like make this presentation from all these figures in the this folder.

egreg
  • 1,121,712
  • If you want a caption for each sub-picture, you should use package subfigure. Otherwise, if pictures are sorted by name you can make a tikz script but is not so easy. – marchetto Feb 23 '14 at 08:38
  • @marchetto subfigure is deprecated; the newer subfig or preferably the newer-still subcaption should be used instead. – Paul Gessler Feb 23 '14 at 08:44
  • How your figure files are named? Is there a symantec naming scheme adopted? –  Feb 23 '14 at 08:48
  • @PaulGessler: you're right, I was wrong to write the name. Correct name is subfig – marchetto Feb 23 '14 at 08:50
  • The names are in this form: "Screen Shot 2014-02-20 at 09.16.33". – Léo Léopold Hertz 준영 Feb 23 '14 at 08:53
  • The time of screenshot is enough for the order. So I have them in order already. Only presentation is needed. Probably later, I can add captions. So would be ok if that possibility later too. – Léo Léopold Hertz 준영 Feb 23 '14 at 08:55
  • I think that Make a script with a so variable name is not convenient. – marchetto Feb 23 '14 at 09:43
  • What's “3x4 A4s”? Anyway, http://tex.stackexchange.com/questions/53458/inserting-figures-using-loops might help – egreg Feb 23 '14 at 09:53
  • why should it be necessary to use the figure environment? putting\includegraphicscommands directly into atabularenvironment, or even just in rows of three, spaced out evenly across the page, should be possible. (you'll have to make sure that they are all the same size, or create aminipage` wrapper that enforces this, which can be done with a macro.) only the last page might need some additional attention, since 777 isn't a multiple of 12. – barbara beeton Feb 23 '14 at 13:25

2 Answers2

2

I assume that your pictures are in a pdflatex compatible format.

Make a liste called liste.dat with the name of your files sorted in the right order. For example :ls *jpg | sort > liste.dat

Then compile this file called fichier.tex with pdflatex :

\documentclass[a4apaper]{article}
\usepackage[top=0cm, bottom=0cm, left=0cm, right=0cm]{geometry}
\usepackage{pgfplotstable,tikz,filecontents}

\pgfplotsset{compat=1.9}

\renewcommand{\floatpagefraction}{1}
\begin{document}

\pgfplotstableread{liste.dat}{\Liste}
\pgfplotstablegetrowsof{liste.dat}
\pgfmathsetmacro{\rows}{\pgfplotsretval-1}

\foreach \i in {1,2,...,\rows} {%
    \pgfplotstablegetelem{\i}{[index] 0}\of{\Liste} 
    \let\Name\pgfplotsretval
    % If there is a second column with caption for each file
    %\pgfplotstablegetelem{\i}{[index] 1}\of{\Liste} 
    %\let\Caption\pgfplotsretval 

    \begin{figure}[!p]
    \centering
    \includegraphics{\Name}
    % if there is a caption column
    %\caption{\Caption}
    \end{figure}    
    \clearpage
}
\end{document}

then compile this other file called picture.tex with pdflatex :

\documentclass[a4paper]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[page=-,nup=3x4]{fichier.pdf}
\end{document}

And you should have a file with 12 (3*4) images per page.

If the file.dat contains a second column with the captions for each file or empty, you can have them at the same time.

Tarass
  • 16,912
1

I suggest you to use

\usepackage{subfig}
...


\begin{figure}
    \centering
    \subfloat[][\emph{Figure 1x1}.\label{fig:001}]
        {\includegraphics[width=.2\textwidth]{file001}} \quad
    \subfloat[][\emph{Figure 1x2}.\label{fig:002}]
        {\includegraphics[width=.2\textwidth]{file002}} \quad
    \subfloat[][\emph{Figure 1x3}.]
        {\includegraphics[width=.2\textwidth]{file003}} \quad
    \subfloat[][\emph{Figure 1x4}.]
        {\includegraphics[width=.2\textwidth]{file004}} \\
    \subfloat[][\emph{Figure 2x1}.]
        {\includegraphics[width=.2\textwidth]{file005}} \quad
    \subfloat[][\emph{Figure 2x2}.]
        {\includegraphics[width=.2\textwidth]{file006}} \quad
    \subfloat[][\emph{Figure 2x3}.]
        {\includegraphics[width=.2\textwidth]{file007}} \quad
    \subfloat[][\emph{Figure 2x4}.]
        {\includegraphics[width=.2\textwidth]{file008}} \\
    \subfloat[][\emph{Figure 3x1}.]
        {\includegraphics[width=.2\textwidth]{file009}} \quad
    \subfloat[][\emph{Figure 3x2}.]
        {\includegraphics[width=.2\textwidth]{file010}} \quad
    \subfloat[][\emph{Figure 3x3}.]
        {\includegraphics[width=.2\textwidth]{file011}} \quad
    \subfloat[][\emph{Figure 3x4}.]
        {\includegraphics[width=.2\textwidth]{file012}} \\
    \caption{This is the caption.}
    \label{fig:subfig}
\end{figure}
marchetto
  • 991