Graphics, Figures & TablesProblem with figure next to table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Shizzle
Posts: 1
Joined: Fri Dec 18, 2009 5:07 pm

Problem with figure next to table

Post by Shizzle »

Hi,

I'm trying to put a figure next to a table and used the minipage command. Still the figure shows up under the table. What did i do wrong? (i dont know how to show the code in a nice window, sorry...)

Thx,
Matthijs

\begin{table}[h!]
\begin{minipage}{0.6\linewidth}
\centering
\begin{tabular}{||c|c|c||}
\hline
Druk (mbar) & Energie (keV) & Afstand (cm)
\\
\hline\hline
...
...
\hline
\end{tabular}
\end{minipage}
\end{table}
\hspace{0.5cm}
\begin{figure}[h]
\begin{minipage}{0.4\linewidth}
\begin{center}
\includegraphics[width=0.6\textwidth]{EnergieAfstand}
\end{center}
\caption{...}
\label{fig:EnergieAfstand}
\end{minipage}
\end{figure}

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

Problem with figure next to table

Post by localghost »

Shizzle wrote:[…] (i dont know how to show the code in a nice window, sorry...) […]
It's just a button in the list right above the input window. For more information see the Forum Guide. Please post full examples and not useless code snippets.

The described behaviour is quite normal since float environments are never positioned side by side. The caption manual has an interesting example how to merge a table and figure and put them side by side in one environment with a customized caption.


Best regards and welcome to the board
Thorsten
Post Reply