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 place 2 SideCaption Figures next to each other but having real trouble with it. I tried to place them in a minipage and tabular environment but nothing worked. Always got a while bunch of errors...

\documentclass[
    11pt, % Schriftgröße
    DIV10,
    ngerman, % für Umlaute, Silbentrennung etc.
    a4paper, % Papierformat
    oneside, % einseitiges Dokument
    titlepage, % es wird eine Titelseite verwendet
    parskip=half, % Abstand zwischen Absätzen (halbe Zeile)
    headings=normal, % Größe der Überschriften verkleinern
    listof=totoc, % Verzeichnisse im Inhaltsverzeichnis aufführen
    bibliography=totoc, % Literaturverzeichnis im Inhaltsverzeichnis aufführen
    index=totoc, % Index im Inhaltsverzeichnis aufführen
    captions=tableheading, % Beschriftung von Tabellen unterhalb ausgeben
    %draft % Status des Dokuments (final/draft)
    final % Status des Dokuments (final/draft)
]{scrreprt}

\usepackage[labelfont=bf,font=footnotesize]{caption}
\captionsetup{format=plain} 

\usepackage{sidecap}

\begin{document}

  \begin{SCfigure}
    \includegraphics[width=0.25\textwidth]{android-linearlayout}
    \caption[Android Layout 1]{Android Layout 1 \cite{Google.2010}}
    \label{fig:android-linearlayout1}
  \end{SCfigure}


  \begin{SCfigure}
    \includegraphics[width=0.25\textwidth]{android-linearlayout}
    \caption[Android Layout 2]{Android Layout 2 \cite{Google.2010}}
    \label{fig:android-linearlayout2}
  \end{SCfigure}

\end{document}

Hope someone can help.

share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. In particular, add the package that provides the side captions. –  egreg Apr 17 '12 at 22:42
    
thx egreg I enhanced the example to a MWE –  kitingChris Apr 18 '12 at 15:25

1 Answer 1

up vote 6 down vote accepted

Your problem here is that the SCfigure environment (offered by the sidecap package) sets a side-captioned float. And floats should not be contained within a restrictive environment. See the UK TeX FAQ entry Not in outer par mode.

One way around this is to avoid using float and use \captionof from the capt-of package (or caption) to set a float-specific caption. Here's a little example:

enter image description here

\documentclass{article}
\usepackage{capt-of}% http://ctan.org/pkg/capt-of
\usepackage[demo]{graphicx}% http://ctan.org/pkg/graphicx
% [demo] option just for this example
\begin{document}

\noindent
\begin{minipage}{.45\textwidth}
  \begin{minipage}{.45\linewidth}
    \includegraphics[width=\linewidth]{layout1}
  \end{minipage}\hfill
  \begin{minipage}{.45\linewidth}
    \captionof{figure}{Layout 1}
    \label{fig:layout1}
  \end{minipage}%
\end{minipage} \hfill
\begin{minipage}{.45\textwidth}
  \begin{minipage}{.45\linewidth}
    \includegraphics[width=\linewidth]{layout2}
  \end{minipage}\hfill
  \begin{minipage}{.45\linewidth}
    \captionof{figure}{Layout 2}
    \label{fig:layout2}
  \end{minipage}%
\end{minipage}
\end{document}​​​​​​​​​​​​​​​​​​​​​​​​

This also allows you freedom over specifying the width of the caption, as well as the location.

share|improve this answer
    
Why avoiding floating environments here? Your example code should work fine within a figure environment (and \caption), too!? –  Axel Sommerfeldt Apr 18 '12 at 4:17
    
works great thanks for the fast answer! –  kitingChris Apr 18 '12 at 10:53
    
@kitingChris: Note that my example sets the two figures within the text. However, as mentioned by Axel (the caption package author), you can place the content inside a floating environment as well (like a figure). –  Werner Apr 18 '12 at 15:44

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.