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 am very very new to TeX/LaTeX, I am writing my first document. So far, I love the way it shows everything. The learning curve is steep though.

I have images that needs to be compared, so they must be close to each other. How can I achieve that?

In the image below, you can see an example of what I want (I know it is ugly, that is why I am using LaTeX ;) ). I used subfig package, but it's main purpose looks like to caption subfigures. I do not want to caption them separately, it would lead to information duplication. It does not need to be exactly like in the image, I am open to suggestions.

alt text

share|improve this question
    
You will get better result if the images are vertically centered. –  xport Dec 29 '10 at 16:44

2 Answers 2

up vote 9 down vote accepted

If you simply want to reproduce a similar formatting, you can use the tabular environment to put the pictures in a table. This would look something like:

\begin{tabular}{l|c|c|c}
  & clown & goldhill256 & lighthouse \\ \hline
  Sobel & \includegraphics{image1} & \includegraphics{image2} & \includegraphics{image3} \\ \hline
  Sobel w/thresholding & ... & ... & ... \\ \hline
  Sobel w/thresholding \& thinning & ... & ... & ...
\end{tabular}

It appears as if this table is going to span the width of the page, however, so you may be better off using the tabularx package:

\begin{tabularx}{\hsize}{p{1.5cm}|X|X|X}
  & clown & goldhill256 & lighthouse \\ \hline
  Sobel & \includegraphics[width=\hsize]{image1} & \includegraphics[width=\hsize]{image2} & \includegraphics[width=\hsize]{image3} \\ \hline
  Sobel w/thresholding & ... & ... & ... \\ \hline
  Sobel w/thresholding \& thinning & ... & ... & ...
\end{tabularx}

That should...

  1. cause the table to span the entire width of the page;
  2. typeset the leftmost column in a 1.5cm wide parbox (which will allow for line breaks); and
  3. auto-size the picture columns such that they are all the same width and take up the extra room in the page.
share|improve this answer
    
I get a "Missing number, treated as zero." error at the first line. Sorry I still don't know how to evaluate error messages properly. I think it needs another argument before p. –  nimcap Dec 1 '10 at 15:37
    
Sorry about that; I added the missing text to the tabularx code. (I wrote it from memory and I just forgot the "{\hsize}" part.) –  ESultanik Dec 1 '10 at 15:47

You could also use subfigures. See the tutorial below for an example:

http://www.andy-roberts.net/misc/latex/latextutorial6.html

share|improve this answer

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.