Side by side latex figure/table placement

1.  Place two figures side by side with separate captions and labels [copied from https://tex.stackexchange.com/a/37582/88745%5D

\usepackage{subfigure}
\begin{figure}
\centering
\parbox{5cm}{
\includegraphics[width=5cm]{img1}
\caption{First.}
\label{fig:2figsA}}
\qquad
\begin{minipage}{5cm}
\includegraphics[width=5cm]{img2}
\caption{Second.}
\label{fig:2figsB}
\end{minipage}
\end{figure}

2. Place Table and a Figure side by side.   [source:https://tex.stackexchange.com/a/265891/88745%5D

\documentclass{article}
\usepackage{graphicx}
\usepackage{capt-of}% or \usepackage{caption}
\usepackage{booktabs}
\usepackage{varwidth}

\begin{document}
\begin{table}[ht]
  \begin{varwidth}[b]{0.6\linewidth}
    \centering
    \begin{tabular}{ l r r r }
      \toprule
      Student & Hours/week & Grade \\
      \midrule
      Ada Lovelace & 2 & A \\
      Linus Thorvalds & 8 & A \\
      Bruce Willis & 12 & F \\
      Richard Stallman & 10 & B \\
      Grace Hopper & 12 & A \\
      Alan Turing & 8 & C \\
      Bill Gates & 6 & D \\
      Steve Jobs & 4 & E \\
      \bottomrule
    \end{tabular}
    \caption{Student Database}
    \label{table:student}
  \end{varwidth}%
  \hfill
  \begin{minipage}[b]{0.4\linewidth}
    \centering
    \includegraphics[width=40mm]{example-image}
    \captionof{figure}{2-D scatterplot of the Student Database}
    \label{fig:image}
  \end{minipage}
\end{table}
\end{document}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s