I want to put a table and a figure side-by-side. The table should fill two third of the text width, and the figure the last third.
So I'd like to achieve one of the following effects (which are equivalent in my case):
-
One table with 3 columns. The first two columns contain text, the third column contains a lengthy image. The height of the image should be determined by the height of the whole table, if that's possible
-
Or, a divided page like in newspapers. On the left side I have the table, on the right side the image.
What I have tried:
\begin{multicols}{2}
\begin{tabular}{ l l }
Text & Text \\
Text & Text \\
... & ... \\
\end{tabular}
\vfill
\begin{figure}[H]
\includegraphics[]{images/image}
\end{figure}
\end{multicols}
But this places the picture directly on top of the table.
I also tried using \usepackage[export]{adjustbox}
and \includegraphics[right]{images/image}
but the caption is still in the center of the page and therefor on top of the table.
Best Answer
What about this?
It uses two
minipages
(with respectively a width of 60% and 30% of\textwidth
(so that it remains a 10% margin)) that are embedded in afigure
environment in order to make it "float". (You could also use another minipage, or nothing at all.)The two
minipage
s are vertically centered the one relatively to the other (cf. their[c]
argument).The array (I used
tabularx
in order to show you its width) use the relative length\linewidth
in order to define its width: indeed, it must use all the line width of the minipage it is embedded in. Like this, you only have to care about minipages widths.).Idem to the picture.
Both minipages are separated with the gutter
\hfill
that insert an horizontal "spring" between them.MWE: