Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
add comment

1 Answer

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.