결합된 부동소수점(그림 및 표)에서 캡션 패키지를 사용하여 표 참조

결합된 부동소수점(그림 및 표)에서 캡션 패키지를 사용하여 표 참조

figuresas subfigures와 3개가 포함된 float를 만들려고 합니다 threeparttable. 결국 caption패키지 문서에 제공된 예를 기반으로 하나의 공동 캡션을 만들고 싶습니다. 그러나 나는 표 위에 캡션을 원하지 않습니다(이것은 공동 캡션의 목적에 어긋나기 때문입니다). 그러나 captionof내부 환경 을 사용하지 않으면 table테이블을 별도로 참조하는 것이 (분명히) 불가능합니다. 그렇다면 추가 캡션을 만들지 않고 어떻게 표를 참조할 수 있습니까?

MWE:

\documentclass{scrartcl}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}

\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable} % combined Figure and Table
\begin{document}
    \section{some section}
    \begin{figure}[ht]
            \begin{subfigure}[t]{.45\linewidth}
                \includegraphics[width=.1\linewidth]{example}
            \caption{Figure 1 of a couple more\label{fig:subfigure}}
        \end{subfigure}
        \begin{minipage}[b]{.54\textwidth}
            \centering
            \begin{threeparttable}[b]
                \captionof{table}{\label{tab:table}}
                \begin{tabular}{@{}p{0.8\linewidth}@{}}
                    \begin{tabular}{cc}
                    A\tnote{1} & B \\
                    C & D\\
                    \end{tabular}
                \end{tabular}
                \begin{tablenotes}
                    \item [1]  Some footnote.
                \end{tablenotes}
            \end{threeparttable}
        \end{minipage}
        \captionlistentry[table]{This is a table.}\addtocounter{figure}{-1}
        \captionsetup{labelformat=andtable}
        \caption{Joint caption for the figure and the table.\label{fig:figure}}
    \end{figure}

    This is some text for referencing Figure~\ref{fig:figure} and Subfigure~\ref{fig:subfigure}.
    More text referencing Table~\ref{tab:table}.
\end{document}

답변1

\captionlistentry참조도 생성하는 것 같으므로 \label그 뒤에 바로 넣을 수 있습니다.

\documentclass{scrartcl}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}

\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable} % combined Figure and Table
\begin{document}
    \section{some section}
    \begin{figure}[ht]
        \begin{subfigure}[t]{.45\linewidth}
            \includegraphics[width=.1\linewidth]{example}
            \caption{Figure 1 of a couple more\label{fig:subfigure}}
        \end{subfigure}
        \begin{minipage}[b]{.54\textwidth}
            \centering
            \begin{threeparttable}[b]
%%%             \captionof{table}{\label{tab:table}}
                \begin{tabular}{@{}p{0.8\linewidth}@{}}
                    \begin{tabular}{cc}
                    A\tnote{1} & B \\
                    C & D\\
                    \end{tabular}
                \end{tabular}
                \begin{tablenotes}
                    \item [1]  Some footnote.
                \end{tablenotes}
            \end{threeparttable}
        \end{minipage}
        \captionlistentry[table]{This is a table.}\label{tab:table}
        \addtocounter{figure}{-1}
        \captionsetup{labelformat=andtable}
        \caption{Joint caption for the figure and the table.\label{fig:figure}}
    \end{figure}

    This is some text for referencing Figure~\ref{fig:figure} and Subfigure~\ref{fig:subfigure}.
    More text referencing Table~\ref{tab:table}.
\end{document}

관련 정보