0

I'm using the floatrow package for float and caption design. I like the prospect of captions beside figures/tables; however, when I vertically position them to the top, I think it would look better if the caption (including the label) were a few pts lower. Any suggestion on how to achieve this? I've looked through the floatrow documentation and don't see an obvious solution. The \floatcapbesidemargins option sets left/right margins. Adding vspace in the first argument of floatbox wont do the trick (EDIT as the table then protrudes into the top \rule I've drawn), so perhaps temporarily re-defining caption would be smarter?

\documentclass[11pt]{scrartcl}
\usepackage{floatrow}
\usepackage{booktabs}

\begin{document}

\rule{\linewidth}{0.4pt}

\floatbox[\capbeside\thisfloatsetup{capbesideposition={left,top},capbesidesep=columnsep}]{table}
{\caption{I would like this caption, including the label, to be slightly lower. Say a few pts}\label{test}}%
{\begin{tabular}{ll}\toprule
column 1a & column 2a \\
column 1b & column 2b \\
column 1c & column 2c\\\bottomrule
\end{tabular}}

\rule{\linewidth}{0.4pt}

\end{document}

enter image description here

3 Answers 3

1

You can fool latex, making it believe is less high than it really is with the optional argument of \raisebox, and add a \vertical spacing before the table to compensate:

\documentclass[11pt]{scrartcl}
\usepackage{floatrow}
\usepackage{booktabs}

\begin{document}

\noindent\hrulefill
\vskip 1ex
\floatbox[\capbeside\thisfloatsetup{capbesideposition={left,top},capbesidesep=columnsep}]{table}
{\caption{I would like this caption, including the label, to be slightly lower. Say a few pts}\label{test}}%
{\raisebox{0pt}[0.8\height]{\begin{tabular}{ll}\toprule
column 1a & column 2a \\
column 1b & column 2b \\
column 1c & column 2c\\\bottomrule
\end{tabular}}}

\noindent\hrulefill

\end{document} 

enter image description here

3
  • Wouldn't the spacing then depend on the height of the table? What if I wanted, say 3 pt for every caption. Jan 28, 2021 at 18:02
  • I can answer my comment above: use the calc package, and \height-3pt for example Jan 28, 2021 at 18:15
  • That's right. You also can use, without loading calc, [\dimexpr \height-3pt] (I would rather subtract a fixed width measured in ex, so would produce the same layout when you change the font size in the document).
    – Bernard
    Jan 28, 2021 at 19:31
0

Just add below code to your mwe.

\usepackage[font=small]{caption}

enter image description here

1
0

Similar result you as with @Bernard answer (+1) you can obtain by the following trick:

\documentclass[11pt]{scrartcl}
\usepackage{floatrow}
\usepackage{booktabs}

\usepackage{lipsum}

\begin{document}
\lipsum[1]{1-2]

\noindent\rule{\linewidth}{1pt}
\floatbox[\capbeside\thisfloatsetup{capbesideposition={left,top},capbesidesep=columnsep}]{table}
{
 \caption{\protect\rule{0pt}{2.8ex}
          I would like this caption, including the label, to be slightly lower. Say a few pts}
 \label{test}}%
{
\begin{tabular}{ll}\toprule
column 1a & column 2a \\
column 1b & column 2b \\
column 1c & column 2c \\\bottomrule
\end{tabular}
}

\lipsum[1]{3-4]
\end{document} 

enter image description here

Edit: Solution is now rewritten. Caption is mowed down by inserting \protect\rule{0pt}{2.8ex} before text in the caption.

I wonder, what is purpose of rules above and below floatbox. They have strong influence on space above and below floatbox.

6
  • Notice how the table protrudes into the top horizontal rule? That's why I mentioned adding \vspace won't do the trick. Also why I added the rules. Jan 28, 2021 at 18:04
  • I suppose adding \vskip3pt could be used above the floatbox to compensate Jan 28, 2021 at 18:18
  • @likethevegetable, I know this, but forgot to add ... see edited answer.
    – Zarko
    Jan 28, 2021 at 18:59
  • @likethevegetable, I edit my answer again. See, if now better fit your expectations.
    – Zarko
    Jan 28, 2021 at 20:16
  • I was thinking about adding an invisible rule too.. would there be implications for the List of Tables in the ToC, though? Jan 28, 2021 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .