3

As you can see, when using sidecaption in memoir class, the text in the margin control the text position under the tabulate.

enter image description here

Is it possible to remove all this blankspace under the tabular subcaption ?

Oh, and do you think is it possible to center the table in the sidecaption ?

Here the Mwe

% !TEX encoding =  UTF-8 Unicode
% -*- program: xelatex -*-
\documentclass[a4paper, 11pt,twoside, openright]{memoir}
\usepackage{mwe} % just for dummy images
\usepackage{amssymb}
\usepackage{amsmath,mathtools}
\usepackage{amstext}    % defines the \text command, needed here
\usepackage{array}
\usepackage{showframe}
\usepackage{tikz}

\usepackage{graphicx}

%%%%%%%%%%%%%%%%%%
% SIDE CAPTION 
\newsubfloat{figure}{}
\newsubfloat{table}{}

\sidecapmargin{outer}
\setsidecappos{t}

\captiontitlefont{\normalfont}% title font
\precaption{\raggedright}% for Caption N
\captiondelim{\newline}% newline*
\captionstyle{\raggedright}% for title
\setlength{\belowcaptionskip}{\onelineskip}

\usepackage{ragged2e}

\renewcommand*{\sidecapstyle}{%
 \ifscapmargleft
    \captionstyle{\justifying\scriptsize}%
  \else
    \captionstyle{\justifying\scriptsize}%
  \fi}

%%%%%%%%%%%%%%%%%%$

%%%%%%%%%%%%%%%%%%
% SUB CAPTION 
% http://tex.stackexchange.com/questions/49448/controlling-the-subcaption-space-in-memoir
\loosesubcaptions
%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{table}
    \centering
    \begin{sidecaption}[fortoc]{Application des règles de dominance aux points $e$ et $f$. \\ \\
           \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}}
                    \toprule
                     & f1 & f2 \\
                    \midrule
                    e      & 0.5    &  4   \\
                    f      & 0.5    & 5,5  \\
                    \bottomrule
            \end{tabular}\\ \\ 
            (a) $e \prec f$ car e est bien le meilleur sur au moins un des deux objectifs, et n'est pas pire sur aucuns des autres objectifs ($e \preceq f$ \\ )
            (b) f ne domine pas e car f n'est pas meilleur sur aucun des deux objectifs et il est pire sur au moins un des deux objectif}[tab:pranking]

        \begin{minipage}{0.5\textwidth}
            \centering
            \subbottom[e est faiblement dominé par f ?]{
                \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}}
                    \toprule
                        & f1 & f2 \\
                    \midrule
                    e \leq f & \text{true} & \text{true} \\
                    e < f   & \text{false}  & \text{true} \\
                    \bottomrule
                \end{tabular}
            \label{subfig_xyespaceSolutionCandidate:a}}
         \end{minipage}\hspace{1em}
         \begin{minipage}{0.5\textwidth}
            \centering
            \subbottom[f est faiblement dominé par e ?]{
                \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}}
                    \toprule
                      & f1 & f2 \\
                    \midrule
                    f \leq  e & \text{true} & \text{false} \\
                    f < e  & \text{false}  & \text{false} \\
                    \bottomrule
                \end{tabular}
            \label{subfig_xyespaceSolutionCandidate:a}}
        \end{minipage}
  \end{sidecaption}
\end{table}

Les solutions admise parmis le front de pareto (voir figure \ref{fig:frontoptimal}) sont donc ici tout ceux qui ne sont pas dominé faiblement ($\preceq$), ce qui revient à exclure les points $f$ et $l$ du front optimum $\{a,b,c,d,e\}$ car ils sont dominés faiblement ($e \preceq f$); alors que dans le cadre d'une dominance forte ($\prec \prec$), ceux-ci aurait fait partie du front $\{a,b,c,d,e,f,l\}$. En effet si on prend toujours le cas de $e$ et $f$, la condition testant que $e$ est strictement meilleur que $f$ sur tout les objectif n'est pas rempli. %Cet ensemble de cardinalité forcément inférieure ou égale est qualifié \enquote{d'ensemble fort non dominé} (\textit{Strongly non dominated set}).

\end{document}
2
+50

A better hack might be to use

\makeatletter
\renewcommand*{\m@mscapopboxes}{%
  \m@mcalcscapraise%
  \usebox{\m@mscap@fbox}%\m@mscapcheckside
  \ifscapmargleft%
  \rlap{\kern-\m@mscaplkern%
    \raisebox{\m@mscapraise}{\smash[b]{\usebox{\m@mscap@capbox}}}%
  }%
  \else%
    \rlap{\kern\sidecapsep%
      \raisebox{\m@mscapraise}{\smash[b]{\usebox{\m@mscap@capbox}}}%
    }%
  \fi%
  \gdef\m@mscapthisside{}%
  \@mem@scap@afterhook%
}
\makeatother

I added the \smash[b]. Basically sidecaption makes the assumption that captions are short and ends up making two boxes next to each other, one with the figure and the other protruning into the margin. It does not make any attempt to hide the size of what ever goes into the margin.

| improve this answer | |
  • @reyman64, notice that it requires amsmath, standard \smash does not have the extra option – daleif Feb 17 '15 at 15:37
1

Quick and dirty trick, add the following to your preamble:

\makeatletter
\renewcommand{\endsidecaption}{\m@mscapend@fbox\refstepcounter\@captype\m@mscaplabel%
    \begin{lrbox}{\m@mscap@capbox}%
        \raisebox{0pt}[\height][0pt]{% This line is added, to remove the depth of the box
        \begin{minipage}[c]{\sidecapwidth}%
          \sidecapstyle\@caption\@captype[\m@mscap@fortoc]{\m@mscap@forcap}%
        \end{minipage}%
        }%
    \end{lrbox}\m@mscapopboxes}
\makeatother
| improve this answer | |
  • Hi, hum it doesn't resolve the problem on my real use case, don't know why .. – reyman64 Feb 14 '15 at 15:38

Your Answer

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

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