floatrow가 있는 하위 참조(하위 캡션 없음)

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}

디스플레이는 딱 제가 원하는대로네요. 주 캡션에는 "Fig. 1:"이라는 레이블이 있고, 하위 캡션에는 "(a)"와 "(b)"가 있습니다.

하지만 하위 그림에 직접 연결하는 패키지 \subref의 매크로가 그리워요 . I를 subcaption사용하면 "1a" floatrow만 산출할 수 있습니다 . \ref{lab1}전자는 \subref{lab1}단지 "a" 또는 더 나은 "(a)"( 와 일치하도록 labelformat=parens)를 제공했습니다.

only floatrowcaption로드를 사용하여 비슷한 작업을 수행할 수 있나요? 그렇지 않은 경우 \ref매크로를 재정의하여 labelformat"1a" 대신 "1(a)"를 표시하려면 어떻게 해야 합니까?

답변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}

관련 정보