Ссылка на таблицу с использованием пакета caption в комбинированном float (рисунок и таблица)

Ссылка на таблицу с использованием пакета caption в комбинированном float (рисунок и таблица)

Я пытаюсь создать float, содержащий три figuresas subfiguresи a threeparttable. В конце концов, я хочу создать одну совместную подпись на основе примера, приведенного в captionдокументации пакета. Однако я НЕ хочу, чтобы подпись была над таблицей (потому что это противоречит цели совместной подписи). Однако, не используя внутреннюю captionofсреду table, становится (очевидно) невозможно ссылаться на таблицу отдельно. Итак, как я могу ссылаться на таблицу, не создавая дополнительную подпись?

МВЭ:

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

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