0

This is not the first time i post (see here and here) about sidecaption environment error and memoir class, but i continue to have lot of problem with my layout.

I search a way to :

  • make correct caption text size for all subcaption (subbottom for memoir) and sidecaption in the document \scriptsize
  • make correct automatic line return for the subcation text to set the two Image on the same line,
  • as you can see centering my table doesn't seem to work ...

As you can see in the MWE, final result is catastrophic.

\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}

\newsubfloat{figure}{\centering}
\newsubfloat{table}{\centering}

\sidecapmargin{outer}
\setsidecappos{t}

\usepackage{ragged2e}

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

\begin{document}

\begin{table}
\begin{sidecaption}[fortoc]{Tableau de résultats des fonction objectifs $f_1$ et $f_2$ pour un vecteur de solutions candidates $\{a \dotsc p\}$ dans l'espace des objectifs $\mathbb{Y}$, et résultat du \textit{Pareto Ranking}}
    [tab:pranking]

    \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$} >{$}l<{$}}
            \toprule
            \text{solutions candidates} & f_1 & f_2 & \text{dominated by} \\
            \midrule
            a      & 3.5    & 1    &  \varnothing \\
            b      & 3      & 1,5  &  \varnothing \\
            c      & 2      & 2    &  \varnothing \\
            d      & 1      & 3    &  \varnothing \\
            e      & 0.5    & 4    &  \varnothing \\
            f      & 0.5    & 4.5  &  \{e \}  \\
            g      & 1.5    & 4.5  &  \{d,e,f,h \} \\
            h      & 1.5    & 3.5  &  \{d \} \\
            i      & 2      & 3.5  &  \{c,d,h \} \\
            j      & 2.5    & 3    &  \{c,d \} \\
            k      & 3.5    & 2    &  \{a,b,c \} \\
            l      & 4.5    & 1    &  \{a \} \\
            m      & 4.5    & 2.5  &  \{a,b,c,k,l \} \\
            n      & 4      & 4    &  \{a,b,c,d,e,h,i,j,k,o \} \\
            o      & 3      & 4    &  \{b,c,d,e,h,i,j \} \\
            p      & 5     & 4.5   &  \{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o \} \\
            \bottomrule
    \end{tabular}
  \end{sidecaption}
\end{table}

\begin{figure}[h]
\begin{sidecaption}[fortoc]{Tableau de données et résultats du calcul pour l'algorithme de \textit{Pareto Ranking}}[fig:pranking]
      \subbottom[]{
        \includegraphics[width=.4\linewidth]{example-image}{Graphique \ref{subfig_pranking:a} initial en deux dimensions des fonction objectifs $f_1$ et $f_2$ du tableau \ref{tab:pranking}}
        \label{subfig_pranking:a}
        }\qquad
      \subbottom[]{
        \includegraphics[width=.4\linewidth]{example-image}{tracé du front résultat à partir du calcul des individus non dominés $\varnothing$ du tableau \ref{tab:pranking}}
        \label{subfig_pranking:b}}

  \end{sidecaption}
\end{figure}

\end{document}

1 Answer 1

1

I finally solve my problem, here you can find the result code using the cryptic documentation of memoir :)

Correction of font size :

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

Correction of the margin problem use : \sidecapmargin{outer} and \setsidecappos{t}

I find information about different type of spacing between subfigure here

Centering of figure is defined for each figure, because i don't know how to do that globally.

\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}

\sidecapmargin{outer}
\setsidecappos{t}

\newsubfloat{figure}{}
\newsubfloat{table}{}

\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}


\begin{document}

\begin{table}
\begin{sidecaption}[fortoc]{Tableau de résultats des fonction objectifs $f_1$ et $f_2$ pour un vecteur de solutions candidates $\{a \dotsc p\}$ dans l'espace des objectifs $\mathbb{Y}$, et résultat du \textit{Pareto Ranking}}[tab:pranking]
    \centering

    \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$} >{$}l<{$}}
            \toprule
            \text{solutions candidates} & f_1 & f_2 & \text{dominated by} \\
            \midrule
            a      & 3.5    & 1    &  \varnothing \\
            b      & 3      & 1,5  &  \varnothing \\
            c      & 2      & 2    &  \varnothing \\
            d      & 1      & 3    &  \varnothing \\
            e      & 0.5    & 4    &  \varnothing \\
            f      & 0.5    & 4.5  &  \{e \}  \\
            g      & 1.5    & 4.5  &  \{d,e,f,h \} \\
            h      & 1.5    & 3.5  &  \{d \} \\
            i      & 2      & 3.5  &  \{c,d,h \} \\
            j      & 2.5    & 3    &  \{c,d \} \\
            k      & 3.5    & 2    &  \{a,b,c \} \\
            l      & 4.5    & 1    &  \{a \} \\
            m      & 4.5    & 2.5  &  \{a,b,c,k,l \} \\
            n      & 4      & 4    &  \{a,b,c,d,e,h,i,j,k,o \} \\
            o      & 3      & 4    &  \{b,c,d,e,h,i,j \} \\
            p      & 5     & 4.5   &  \{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o \} \\
            \bottomrule
    \end{tabular}
  \end{sidecaption}
\end{table}

\begin{figure}[h]
\begin{sidecaption}[fortoc]{Tableau de données et résultats du calcul pour l'algorithme de \textit{Pareto Ranking}}[fig:pranking]
    \centering

      \subbottom[Graphique initial en deux dimensions des fonction objectifs $f_1$ et $f_2$ du tableau \ref{tab:pranking}]{
        \includegraphics[width=.4\linewidth]{example-image}
        \label{subfig_pranking:a}
        }\hspace{1em}
      \subbottom[Tracé du front résultat à partir du calcul des individus non dominés $\varnothing$ du tableau \ref{tab:pranking}]{
        \includegraphics[width=.4\linewidth]{example-image}
        \label{subfig_pranking:b}}
  \end{sidecaption}
\end{figure}

\end{document}
3
  • 1
    Where do you get that \newsubfloat should take two arguments? It only takes one as mentioned in the manual.
    – daleif
    Feb 4, 2015 at 22:04
  • I see that in an example on the web :/ Don't believe the web, and i supose i merit a rtfm on that :)
    – reyman64
    Feb 4, 2015 at 22:07
  • Of it did not come from this site, then I'd take it with a grain of salt ;-)
    – daleif
    Feb 5, 2015 at 7:13

You must log in to answer this question.

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