Subref с floatrow (без подзаголовка)

Subref с floatrow (без подзаголовка)

У меня есть подфигуры, созданные с помощью floatrowпакета вместо subcaptionпакета. Последний не загружается.

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

Дисплей такой, как я хочу. Основная подпись имеет метку "Рис. 1:", подзаголовки имеют "(a)" и "(b)".

Однако мне не хватает \subrefмакроса пакета subcaptionдля прямой ссылки на подфигуры. С помощью floatrowя могу сделать только \ref{lab1}yielding "1a". Первый \subref{lab1}дал просто "a" или даже лучше "(a)" (чтобы соответствовать labelformat=parens).

Могу ли я сделать что-то подобное с only floatrowи captionзагруженным? И если нет, как мне переопределить макрос, \refчтобы он соответствовал labelformatи, таким образом, отображал "1(a)" вместо "1a"?

решение1

Вот как это можно сделать 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}

введите описание изображения здесь

Если вы не хотите, чтобы в LoF отображались подфигуры, измените

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

к

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

Связанный контент