3

I have a two column document and need to display two tables alongside each other, with the caption in the margin. I've hit a wall with it -- I use table* float to span two columns with one figure and then minipages inside the figure to construct the tables.

This works, but how do I get the margin text to be alongside the floating tables? Also, is it possible to use a caption so I can \Cref the label in the document body?

\documentclass[
    a4paper,
    11pt,
    twoside,
    twocolumn]{article}
\usepackage[
    top=2cm,
    bottom=3cm,
    hmarginratio=4:1]{geometry}

\usepackage{booktabs}
\usepackage{lipsum}

\begin{document}
\lipsum[9]

\begin{table*}[tbp]
\centering
\begin{minipage}[t]{.45\linewidth}
    \centering
    \begin{tabular}{rr}
        \toprule
        \textbf{Reported FPS}   &   \textbf{Count}   \\
        \midrule
        $12$    &   $1646$  \\
        $14$    &   $25$    \\
        \bottomrule
    \end{tabular}
    \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
\end{minipage}%
%
\hskip2em\relax
\begin{minipage}[t]{.45\linewidth}
\centering
\begin{tabular}{ccr}
\toprule
\textbf{Dimensions} & \textbf{Standard} & \textbf{Count}      \\
\midrule
$352\times288$      & CIF   & $129$\\
$360\times288$      & --    & $560$ \\
\bottomrule
\end{tabular}
\end{minipage}%
\end{table*}
\marginpar{
    \begin{minipage}{35mm}
        \raggedright \emph{\textbf{
        Table 2. Suspendisse vitae erat vitae ante aliquam condimentum.}}
    \end{minipage}
}

\end{document}
  • 1
    Give a look to memoir document class. It has an embedded sidecaption environment that work out of the box. – Astrinus Jun 10 '15 at 10:04
  • Try \setlength\marginparwidth{1.6in} in the preamble, though I don't quite get the full extent of your MWE (where the table itself should go) – Steven B. Segletes Jun 10 '15 at 10:09
  • The tables are in the right place, I need the caption to appear in the margin next to them, not on the first page next to the lipsum text. It's a vertical alignment problem. – cdmh Jun 10 '15 at 10:17
  • The \marginpar is (and must be) outside the table, so it will not float with the table. \marginnote (from the marginnote package) can be used inside the table. Second, \marginpar (or \marginnote) already uses a \parbox, so the minipage is redundant. Third, unless you increase the margin (and \marginparwidth) it will look very ugly. – John Kormylo Jun 10 '15 at 13:15
  • Thanks John. I use hmarginratio=4:1 to get wide gutters starting on the left for odd pages. \marginnote always puts the right in the right margin. How do I move it to the gutter side? – cdmh Jun 10 '15 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.