3

I want to switch from sidecap to floatrow in putting figure captions in the margin. When using sidecapthe text is perfectly positoned within the margin. When i use floatrow there is a slight shift. What am i doing wrong?

Note: Adding marginparsep=50ptto the geometry package exacerbates this problem. Seems like the distance marginparsep is not properly set by floatrow. Mh.

enter image description here

Code:

  \documentclass[twoside]{scrartcl}
  \usepackage[a4paper,textwidth=300pt,marginparwidth=150pt,inner=1in,asymmetric]{geometry}
  \usepackage{blindtext}
  \usepackage{showframe}
  \usepackage[format=plain]{caption}
  \usepackage[english]{babel}
  \usepackage{floatrow}
  \usepackage[margincaption]{sidecap}
  \begin{document}

  \section{one}

  \blindtext[1]

  \begin{SCfigure}[][h]
  \rule{3.5in}{0.5in}
  \caption{Nulla malesuada porttitor diam. Donec felis erat, congue non, volut- pat at, tincidunt tristique, libero.}
  \label{fig}
  \end{SCfigure}

  \thisfloatsetup{%
  floatwidth=\linewidth,
  capposition=beside,
  capbesideposition={bottom,right},
  capbesidewidth=\marginparwidth,
  }
  \begin{figure}[h]
  \raggedleft
  \rule{3.5in}{0.5in}
  \caption{Nulla malesuada porttitor diam. Donec felis erat, congue non, volut- pat at, tincidunt tristique, libero.}
  \label{fig}
  \end{figure}



  \end{document}

1 Answer 1

2

Output

enter image description here

  • I borrowed a strategy of a previous question that I have answered: Alignment of Margin caption with floatrow and caption, where a new length was defined.

    \newlength{\figWidthForMarginCap}%
    \setlength{\figWidthForMarginCap}{\textwidth}%
    \addtolength{\figWidthForMarginCap}{-0.9em}%
    \addtolength{\figWidthForMarginCap}{\marginparsep}%
    
  • You can then use this as follows:

    \thisfloatsetup{%
    capposition=beside,
    capbesidewidth=\marginparwidth,
    capbesideposition={bottom,right},
    floatwidth=\figWidthForMarginCap
    }
    
  • To set up your caption, you can then do

    \captionsetup{
    format=plain,
    margin=0em,
    justification=justified,
    }
    

Code

And here is the full MWE that works with your setup.

\documentclass[twoside]{scrartcl}
\usepackage[a4paper,textwidth=300pt,marginparwidth=150pt,inner=1in,asymmetric]{geometry}
\usepackage{blindtext}
\usepackage{showframe}
\usepackage[format=plain]{caption}
\usepackage[english]{babel}
\usepackage{floatrow}
\usepackage[margincaption]{sidecap}

\newlength{\figWidthForMarginCap}%
\setlength{\figWidthForMarginCap}{\textwidth}%
\addtolength{\figWidthForMarginCap}{-0.9em}%
\addtolength{\figWidthForMarginCap}{\marginparsep}%

\begin{document}

\section{one}

\blindtext[1]

\begin{SCfigure}[][h]
\rule{3.5in}{0.5in}
\caption{Nulla malesuada porttitor diam. Donec felis erat, congue non, volut- pat at, tincidunt tristique, libero.}
\label{fig}
\end{SCfigure}

\thisfloatsetup{%
    capposition=beside,
    capbesidewidth=\marginparwidth,
    capbesideposition={bottom,right},
    floatwidth=\figWidthForMarginCap
  }
\begin{figure}[h]
\captionsetup{
format=plain,
margin=0em,
justification=justified,
}
\rule{3.5in}{0.5in}
\caption{Nulla malesuada porttitor diam. Donec felis erat, congue non, volut- pat at, tincidunt tristique, libero.}
\label{fig}
\end{figure}

\end{document}

You must log in to answer this question.

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