Referenzieren einer Tabelle mithilfe des Beschriftungspakets in einem kombinierten Float (Abbildung und Tabelle)

Referenzieren einer Tabelle mithilfe des Beschriftungspakets in einem kombinierten Float (Abbildung und Tabelle)

Ich versuche, einen Float zu erstellen, der drei figuresas subfiguresund a enthält threeparttable. Am Ende möchte ich eine gemeinsame Überschrift basierend auf dem Beispiel in der captionPaketdokumentation erstellen. Ich möchte jedoch KEINE Überschrift über der Tabelle (weil das den Zweck der gemeinsamen Überschrift zunichte macht). Wenn captionofinnerhalb der tableUmgebung nicht verwendet wird, ist es jedoch (anscheinend) unmöglich, die Tabelle separat zu referenzieren. Wie kann ich also auf die Tabelle verweisen, ohne die zusätzliche Überschrift zu erstellen?

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}

Antwort1

\captionlistentryscheint auch eine Referenz zu erstellen, also könnten Sie ein \labelRecht dahinter setzen:

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

verwandte Informationen