GeneralImages side to side

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pedrovg2
Posts: 4
Joined: Thu Mar 27, 2008 4:03 am

Images side to side

Post by pedrovg2 »

I want to put two imagem side to side. How can I do this?


Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Images side to side

Post by gmedina »

If they are independent figures, you can use minipage environments. If they are subfigures, use the subfig package.

A little example of the former situation:

Code: Select all

\documentclass{article}
\usepackage{caption}

\begin{document}

\noindent\begin{minipage}{.45\textwidth}
  \centering
  \rule{.7\linewidth}{1cm}
  \captionof{figure}{Test figure 1}
  \label{fig:testfig1}            
\end{minipage}
\begin{minipage}{.45\textwidth}
  \centering
  \rule{.7\linewidth}{1cm}
  \captionof{figure}{Test figure 2}
  \label{fig:testfig2}            
\end{minipage}

\end{document}
I used \rule commands only to simulate actual figures.
Last edited by gmedina on Thu May 08, 2008 5:23 pm, edited 1 time in total.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Images side to side

Post by Stefan Kottwitz »

Hi pedrovg2,

perhaps see de-tex-faq 6.1.6 for an example. It's in german, but the tex code should be understanable.

Stefan
LaTeX.org admin
pedrovg2
Posts: 4
Joined: Thu Mar 27, 2008 4:03 am

Re: Images side to side

Post by pedrovg2 »

I don't solve this yet. I don't know where I have to give the arquive of the imagem, where i have to put pegend etc.

Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Images side to side

Post by Stefan Kottwitz »

Hi,

gmedina has given a complete example above.
Just replace \rule (simulating the image) by \includegraphics{imagename}.

Don't forget \usepackage{graphicx} in your preamble. You may have a look at the graphics guide page 9.

Stefan
LaTeX.org admin
Post Reply