Hello everybody,
can please help me out here, didn't find any info on my specific problem.
On the last page of a document I want to place a picture (right-aligned) with some text next to it. I do not want to wrap the text around the picture. Rather, I want the picture to be right-aligned with the (justified) text appearing left to it. The height of the pic should be the same as the text, so I also want to scale the picture to e.g. be the same height as 10 lines of text. How can I do that easily?
Many thanks!
Graphics, Figures & Tables ⇒ Placing Figures and Text Side-by-Side
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Placing Figures and Text Side-by-Side
Hi schorsche,
you could use \parbox (or a minipage environment) for both the text and the picture. \parbox (minipage too) understands options for vertical alignment.
For the picture, you could specify the height, such as
Between the text box and the picture use \hfill to achieve right alignment.
Stefan
you could use \parbox (or a minipage environment) for both the text and the picture. \parbox (minipage too) understands options for vertical alignment.
For the picture, you could specify the height, such as
Code: Select all
\includegraphics[height=10\baselineskip]{filename}
Stefan
LaTeX.org admin
Re: Placing Figures and Text Side-by-Side
Hi!
Thanks for your tip, but it didn't work the way I expected it to. If I use the following command, the picture will be beneath the text, although there would be enough space on the right of the text! If I use 0.5\linewidth in both minipages it works properly, however, then there is a huge wide space between either sides of the picture! So I get the impression that the horizontal alignment is not working properly. Are there any alternative commands?
Thanks a lot, here's the code I am using:
\begin{minipage}{0.65\linewidth}
some text
\end{minipage}
\hfill
\begin{minipage}{0.35\linewidth}
\includegraphics[height=8\baselineskip]{grafics}
\end{minipage}
Thanks for your tip, but it didn't work the way I expected it to. If I use the following command, the picture will be beneath the text, although there would be enough space on the right of the text! If I use 0.5\linewidth in both minipages it works properly, however, then there is a huge wide space between either sides of the picture! So I get the impression that the horizontal alignment is not working properly. Are there any alternative commands?
Thanks a lot, here's the code I am using:
\begin{minipage}{0.65\linewidth}
some text
\end{minipage}
\hfill
\begin{minipage}{0.35\linewidth}
\includegraphics[height=8\baselineskip]{grafics}
\end{minipage}
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Placing Figures and Text Side-by-Side
This way the minipages use the complete linewidth, but there's space between them, which causes the line break such that the second one is placed below.
The line breaks are whitespace, and \hfill is stretchable white space. Either comment them out, such as
or make one minipage a bit smaller.
Stefan
The line breaks are whitespace, and \hfill is stretchable white space. Either comment them out, such as
Code: Select all
...
\end{minipage}%
\begin{minipage}[b]{0.35\linewidth}
...
Stefan
LaTeX.org admin
Re: Placing Figures and Text Side-by-Side
Ok all problems resolved, I had to place \centering into the second minipage!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Placing Figures and Text Side-by-Side
Now that the problem is obviously solved, please be so kind and mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.
Thorsten
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10