1

On my question "memoir: subcaption outside float" Gonzales Medina provide the answer, which in first hand solve my basic problem but on second hand open two new: - subcaptions can not be referenced. It seems that their definition should be upgraded with referencing ability. - It clash with subfloats determined with subfig package, which I use (up to now) for sub floats.

Later problem I partly solve with use \subbotom of memoir package instead of subfloat of subfig package. Instead usepackage[caption=false]{subfig} I put in preamble \let\subfloat\subbottom by which I (try to) preserve the syntax for sub floats constructs in my old documents:

\documentclass{memoir}
%%--------------------------------------------------------------%
    \newfixedcaption{\figcaption}{figure}
    \newfixedcaption{\tabcaption}{table}
\newsubfloat{figure}
    \newfixedcaption[\subcaption]{\subfigcaption}{figure}
%%--------------------------------------------------------------%
    \let\subfloat\subbottom
%---------------------------------------------------------------%
\newcolumntype{C}{>{\centering\arraybackslash}X}
    \usepackage{graphicx}

    \begin{document}

    \begin{figure}
\subfloat[sub figure  left \label{subfig-1}]
    {\includegraphics[width=0.45\hsize]{example-image-a}}
\subfloat[sub figure right \label{subfig-2}]
    {\includegraphics[width=0.45\hsize]{example-image-b}}
\caption{test}
    \end{figure}

\begin{center}
    \begin{tabularx}{\hsize}{CC}
\includegraphics[width=0.9\hsize]{example-image-a}\newline
\subfigcaption{sub caption a} \label{subfig-3}
    &
\includegraphics[width=0.9\hsize]{example-image-b}\newline
\subfigcaption{sub caption b}  \label{subfig-4}
    \end{tabularx}
\figcaption{figure caption}\label{fig:3-4}
\end{center}

Added test of referencing: see Fig. \ref{subfig-1}, Fig. \ref{subfig-2} and Fig. \ref{fig:3-4}, which is consist of Fig. \ref{subfig-3} and Fig. \ref{subfig-4}..
    \end{document}

which gives: enter image description here

Questions:

  • how to subfigcaption add referencing ability?
  • how to redefine style of references mark from 0.1(a) to 0.1a?
  • \subfigcaption{...\label{...}} works. – daleif Jul 7 '15 at 12:49
  • @daleif, indeed. With this my firs (sub) question is answered. I wonder, why this is not necessary to do at figcaption? – Zarko Jul 7 '15 at 13:04
  • You are not using \figcaption in your example. If added you will notice that \figcaption{}\label{} does not catch the correct number (because the number stuff inside \figcaption is made inside a group – daleif Jul 7 '15 at 13:28
  • @daleif, I edit my MWE to show the working of \figcaption. Up to now I didn't observe the problem you mentioned. Now is more important, how to change the style of referencing mark (my second question) – Zarko Jul 7 '15 at 13:39
  • @daleif I think you should turn your comment into an answer. – Gonzalo Medina Jul 7 '15 at 13:41
2

For question (1) just place \label inside \subfigcaption{...}. This is due to how \subfigcaption is made. The material for \label is made inside a group and thus not available in \subfigcaption{}\label{}

As for (2), I don't think it is possible to easily be changed. Especially if we want (2) in text, and 1a at not 1(a). The code is hardwired into the construction. I'll add it to my memoir todo list (actually it is already there, I'll just up the priority)

|improve this answer|||||
  • well, this means that I should wait for while :-). This is ok. Meanwhile I will avoid to use subficaption as well subbottom out of the floats as I do so far. Thank you! – Zarko Jul 7 '15 at 18:59

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.