Graphics, Figures & TablesHow to put 2 images in the same line?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
turbomac
Posts: 34
Joined: Sat Oct 10, 2009 9:38 pm

How to put 2 images in the same line?

Post by turbomac »

Hi, this is my second post here.

I want to improve my paper's title page and I need to add 2 different images on it. One on the left side and the other, in the right side of the sheet.
This is because there're two logos that I need to include in the title page but I don't how to put them in the same line.

I've tried using \begin{flushleft} and \begin{flushright} but I haven't got good results. I have also searched in google and even in this same forum, but I haven't found anything related.

Any idea??
Thanks in advance.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to put 2 images in the same line?

Post by localghost »

Use the \hfill command.


Best regards
Thorsten
turbomac
Posts: 34
Joined: Sat Oct 10, 2009 9:38 pm

How to put 2 images in the same line?

Post by turbomac »

localghost wrote:Use the \hfill command.


Best regards
Thorsten
It works! Thanks. But, how can I add text between the images??
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to put 2 images in the same line?

Post by localghost »

Use a second \hfill command.

Code: Select all

\includegraphics{leftlogo}\hfill Text\hfill\includegraphics{rightlogo}
turbomac
Posts: 34
Joined: Sat Oct 10, 2009 9:38 pm

Re: How to put 2 images in the same line?

Post by turbomac »

It works, but what I need to do is showed in the file uploaded.
Thanks anyway!

Note: The right logo doesn't mean "Die", is just an acronym and means another thing.
Attachments
chip1.png
chip1.png (15.84 KiB) Viewed 25513 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to put 2 images in the same line?

Post by localghost »

Use a \parbox or a minipage environment.
turbomac
Posts: 34
Joined: Sat Oct 10, 2009 9:38 pm

How to put 2 images in the same line?

Post by turbomac »

The text is added but I can't align the text with the images (center).
Any idea??

This is what I've got in the .tex file:

Code: Select all

\includegraphics[scale=0.25]{../../Desktop/UsachLogo.png} \hfill \begin{minipage}[H]{170pt}
  \begin{center}
Line1\\
Line2 \\
Line3\\
    \end{center}
 \end{minipage} \hfill \includegraphics[scale=0.5]{../../Desktop/Dielogo.png}
This is my first try of placing 2 images and some text in between.
Attachments
chip1.png
chip1.png (27.06 KiB) Viewed 25509 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to put 2 images in the same line?

Post by localghost »

Use the parameters for the minipage environment in the right way.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\begin{document}
  \rule{5\baselineskip}{5\baselineskip}\hfill
  \begin{minipage}[b][5\baselineskip][t]{10em}
    \centering
    Line 1\\
    Line 2\\
    Line 3\\
    Line 4\\
    Line 5
  \end{minipage}
  \hfill\rule{5\baselineskip}{5\baselineskip}
\end{document}
Please follow the link above to learn more.
turbomac
Posts: 34
Joined: Sat Oct 10, 2009 9:38 pm

Re: How to put 2 images in the same line?

Post by turbomac »

THanks! It's solved.
Post Reply