Subref mit Floatrow (ohne Unterüberschrift)

Subref mit Floatrow (ohne Unterüberschrift)

Ich habe mit dem floatrowPaket Subfigures erstellt, statt mit dem subcaptionPaket. Letzteres wird nicht geladen.

\begin{figure}[htbp]
    \ffigbox[\FBwidth]
    {\begin{subfloatrow}[2]
    \ffigbox[\FBwidth]
    {\caption{Cap1}\label{lab1}}
    {Test1}
    \ffigbox[\FBwidth]
    {\caption{Cap2}\label{lab2}}
    {Test2}
    \end{subfloatrow}}
    {\caption{Cap}
    \label{lab}}
\end{figure}

Die Darstellung ist so wie ich sie haben möchte. Die Hauptüberschrift hat die Beschriftung "Abb. 1:", die Unterüberschriften haben "(a)" und "(b)".

Allerdings fehlt mir das \subrefMakro des subcaptionPakets, um direkt auf Unterabbildungen zu verlinken. Mit floatrowkann ich nur \ref{lab1}"1a" ausgeben. Ersteres \subref{lab1}gab nur "a" oder noch besser "(a)" (passend zu labelformat=parens) aus.

floatrowKann ich mit only und captionloaded etwas Ähnliches machen ? Und wenn nicht, wie kann ich das \refMakro so umdefinieren, dass es dem entspricht labelformatund somit "1(a)" statt "1a" anzeigt?

Antwort1

So können Sie es tun caption:

\documentclass{article}
\usepackage{floatrow}
\usepackage{caption}
\usepackage{graphicx}

\DeclareCaptionSubType[alph]{figure}

\renewcommand\thesubfigure{(\alph{subfigure})}
\captionsetup[subfloat]{labelformat=simple,listformat=simple}

\begin{document}

\listoffigures

\begin{figure}[htbp]
    \ffigbox[\FBwidth]
    {\begin{subfloatrow}[2]
    \ffigbox[\FBwidth]
    {\caption{Caption for subfigure 1}\label{lab1}}
    {\rule{5cm}{1cm}}
    \ffigbox[\FBwidth]
    {\caption{Caption for subfigure 2}\label{lab2}}
    {\rule{5cm}{1cm}}
    \end{subfloatrow}}
    {\caption{General caption}
    \label{lab}}
\end{figure}

As we see in subfigures~\ref{lab1} and~\ref{lab2}, which are subfigures to Figure~\ref{lab}...

\end{document}

Bildbeschreibung hier eingeben

Wenn Sie nicht möchten, dass Unterfiguren im LoF erscheinen, ändern Sie

\captionsetup[subfloat]{labelformat=simple,listformat=simple}

Zu

\captionsetup[subfloat]{labelformat=simple,list=no}

verwandte Informationen