TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a nice way to include multiple figures in the format of a table?

I want it to look something like the following mock-up (pardon my terrible MS Paint skills), and am willing to include any necessary packages. I would love it if there were a nice way to label the columns as rows as I did (a and b, and 1, 2, and 3).

enter image description here

share|improve this question
Will this be part of a bigger figure or table? And how do you want to be able to reference the figures? For example, \ref{figurea1} should return 1a1 if it's part of Figure 1? – Werner Apr 17 '12 at 2:01
@Werner This is not part of a bigger table--I want a table made up of these 6 figures. I want to include each of them as a separate figure, and be able to \ref them separately as well. – jamaicanworm Apr 17 '12 at 2:02
up vote 9 down vote accepted

The following works by defining a new \fixedlabel labelling scheme. \fixedlabel{<lab>}{<tag>} fixes the label <tag> associated with <lab> (similar to the \tag labelling mechanism of amsmath).

enter image description here

% http://tex.stackexchange.com/questions/52189/including-table-of-figures

    & a & b \\
    1 & \rule[-25pt]{100pt}{50pt}\fixedlabel{block1a}{1a} 
      & \rule[-25pt]{100pt}{50pt}\fixedlabel{block1b}{1b} \\ \\
    2 & \rule[-25pt]{100pt}{50pt}\fixedlabel{block2a}{2a} 
      & \rule[-25pt]{100pt}{50pt}\fixedlabel{block2b}{2b} \\ \\
    3 & \rule[-25pt]{100pt}{50pt}\fixedlabel{block3a}{3a} 
      & \rule[-25pt]{100pt}{50pt}\fixedlabel{block3b}{3b}
  \caption{This is a caption.}\label{figtab}

See, for example, \ref{block1a} and~\ref{block2b} in Table~\ref{figtab}.


A hyperref-compatible version of \fixedlabel is given by:

share|improve this answer
I have a slight problem. In my document the label for each row is not simply 1, 2, 3--rather, it is some longer text such as \text{$p = 0.1\%$ noise, $N = 100$ trials}. This text is too long, as it pushes both figures to its right into the margin. How can I make this labeling text separate into two lines? When I try \text{$p = 0.1\%$ noise,} \\ \text{$N = 100$ trials} the second line gets pushed all the way beneath the figure... – jamaicanworm Apr 17 '12 at 17:37
@jamaicanworm: You could insert a tabular for those entries: \begin{tabular}{@{}c@{}} $p = 0.1\%$ noise, \\ $N = 100$ trials \end{tabular} The zero-padding ensures that your original columnar spacing (isn't affected, but allows for you to add multiple rows within a single cell. – Werner Apr 17 '12 at 17:45
Thanks, but then the label gets pushed to the bottom of the row, instead of remaining vertically centered in the row. – jamaicanworm Apr 17 '12 at 18:37
@jamaicanworm: How about using an >{\centering\arraybackslash}m{5em} column type for the left column (not for the inner tabular, but the outer tabular). This would require the addition of the array package. My MWE uses \rule for a fake image, so I didn't have time to play around. Give some feedback if you're still stuck and I'll post an updated MWE. – Werner Apr 17 '12 at 19:14
@jamaicanworm: If all the figures except one is of an inappropriate size, you can store one of the OK ones in a box (to measure it's width) and then resize the non-OK one to that width. Something like \newsavebox{\myfig}\savebox{\myfig}{\includegraphics[..]{OK-fig}} and then use \includegraphics[width=\wd\myfig]{non-OK-fig}. If this is not clear, ask a follow-up question. – Werner Apr 17 '12 at 19:33

Here's one possible solution using the tabu package:



% \MyIm{<figure name>}{<label>}


  \multicolumn{1}{l}{\setcounter{figure}{0}} & a & b \\[-20pt]
  & \MyIm{name1}{a} & \MyIm{name2}{b}  \\[-30pt]
  & \MyIm{name3}{c} & \MyIm{name4}{d}  \\[-30pt]
  & \MyIm{name5}{e} & \MyIm{name6}{f} 

\ref{a} \ref{b} \ref{c} \ref{d} \ref{e} \ref{f}


enter image description here

Some remarks:

  1. A tmp counter was used to store the value of the counter figure before the table and then, at the end the value for figure was restored

  2. The subcaption package was used to provide an empty caption for each figure; this allows the easy assignment of a \label for cross-referencing.

  3. This solution cooperates with hyperref; the only thing to do is to load hyperref and hypcap:

share|improve this answer

Your Answer


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.