7

How to generate a table of figures like this example below: enter image description here

rayallen
  • 313

2 Answers2

6

Assuming that all figures could be 6em wide, this can be done using booktabs in a normal tabular environment.

\documentclass{article} 
\usepackage{graphicx,booktabs,array}
\begin{document}

\newcommand{\addpic}{\includegraphics[width=6em]{example-image}}
\newcolumntype{C}{>{\centering\arraybackslash}m{6em}}
\begin{table}\sffamily
\begin{tabular}{l*4{C}@{}}
\toprule
Nr. & a & b & c & d \\ 
\midrule
1 & \addpic & \addpic & \addpic & \addpic \\ 
2 & \addpic & \addpic & \addpic & \addpic \\ 
3 & \addpic & \addpic & \addpic & \addpic \\ 
\bottomrule 
\end{tabular}
\caption{caption}
\end{table} 

\end{document}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
2

For a table of figures like this one you can use the package booktabs, like this:

\documentclass[a4paper,10pt]{article}

\usepackage{booktabs}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}

\newcommand{\dummyfigure}{\tikz \fill [NavyBlue] (0,0) rectangle node [black] {Figure} (2,2);}

\begin{document}
    \begin{table}
        \centering
        \begin{tabular}{ccccc}
           \toprule
            Nr. & a & b & c & d \\
            \midrule
            1 & \dummyfigure & \dummyfigure & \dummyfigure & \dummyfigure \\
            2 & \dummyfigure & \dummyfigure & \dummyfigure & \dummyfigure \\
            3 & \dummyfigure & \dummyfigure & \dummyfigure & \dummyfigure \\
            \bottomrule
        \end{tabular}
        \caption{Table of figures}
        \label{tbl:table_of_figures}
    \end{table}
\end{document}

But, as you can see in the figure below, the text in the first column will not be vertically aligned.

Table of figures

In order to do this, you need to use the array package and create a new column type:

    \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

Then, use this new column type for the columns containing the figures, like this:

\documentclass[a4paper,10pt]{article}

\usepackage{array}
\usepackage{booktabs}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}

\newcommand{\dummyfigure}{\tikz \fill [NavyBlue] (0,0) rectangle node [black] {Figure} (2,2);}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

\begin{document}
    \begin{table}
        \centering
        \begin{tabular}{cM{20mm}M{20mm}M{20mm}M{20mm}}
           \toprule
            Nr. & a & b & c & d \\
            \midrule
            1 & \dummyfigure & \dummyfigure & \dummyfigure & \dummyfigure \\
            2 & \dummyfigure & \dummyfigure & \dummyfigure & \dummyfigure \\
            3 & \dummyfigure & \dummyfigure & \dummyfigure & \dummyfigure \\
            \bottomrule
        \end{tabular}
        \caption{Table of figures}
        \label{tbl:table_of_figures}
    \end{table}
\end{document}

Table of figures

Ronny
  • 166
  • how to decrease the distance between the column Nr. and column a? – rayallen May 21 '16 at 19:57
  • @rayallen you can add what you want between columns with @{}, so you can increase/decrease the space between them with @{\hspace{1mm}}. In your case, you need to replace the column types, for example, with: \begin{tabular}{c@{\hspace{1mm}}M{20mm}M{20mm}M{20mm}M{20mm}} – Ronny May 21 '16 at 21:18