Send As SMS

5/16/2006

place multiple images on one line in latex (or even create a matrix of images)

to tile images in a figure, use the following code:

\begin{figure}[h]
\begin{center}$
\begin{array}{cc}
\includegraphics[width=2.5in]{image1.jpg} &
\includegraphics[width=2.5in]{image2.jpg}
\end{array}$
\end{center}
\caption{my caption}
\end{figure}
to place more than 2 images on a line, add extra 'c's to the {array} specification and follow each \includegraphics[]{} with an ampersand (&). to create a matrix of images, insert newlines using two slashes: for instance, to make a 2X2 matrix of images:
\begin{figure}[h]
\begin{center}$
\begin{array}{cc}
\includegraphics[width=2.5in]{image1.jpg} &
\includegraphics[width=2.5in]{image2.jpg} \\ \includegraphics[width=2.5in]{image1.jpg} &
\includegraphics[width=2.5in]{image2.jpg}
\end{array}$
\end{center}
\caption{my caption}
\end{figure}


4 Comments:

Anonymous said...

Hey man, good website with very useful information on latex.

Good luck with your PhD in MIT.

Bidur Khanal
Research student
University if southampton, UK

7/10/2006 01:58:14 PM  
Anonymous said...

Hello Man,

Thanks for the nice code.

All the best.
Charles

7/29/2006 05:01:45 PM  
Anonymous said...

You mention it in the main text of your message, but it is not in the code - that you need two slashes (\\), code only has one

Works great then.

8/09/2006 09:33:20 AM  
Lawrence David said...

thanks for catching that - i've updated the code!

8/13/2006 09:12:01 PM  

Post a Comment

Links to this post:

Create a Link

<< Home

My blog has moved! Redirecting...

You should be automatically redirected. If not, visit http://stinkpot.afraid.org:8080/tricks/ and update your bookmarks.