我正在尝试使用 subfig 包和 table 环境将多个表格作为子浮点数。添加另一个 table 环境并将其与 \ContinuedFloat 绑定,并阻止表计数器上升(使用 \addtocounter{table}{0} )当我使用 \ref 引用任何子浮点数的子引用或第二个 table 环境的标签时,我得到了问号,而该表计数器没有上升。
还有一个错误,当表格环境中有超过 1 个子浮点数时,子浮点数标题旁边会出现问号
\documentclass[
fontsize=12pt,
BCOR=1cm,
DIV=12,
parskip=half,
numbers=noendperiod
]{scrartcl}
%general stuff
\usepackage[english,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{tgheros}
%table-edits
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{ltxtable}
\usepackage{tabularx}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{M}[1]{>{\centering}m{#1}}
%others
\usepackage{subfig}
\usepackage{longtable}
\usepackage{multirow, multicol}
\usepackage{lscape}
\usepackage{todonotes}
\begin{document}
\begin{landscape}
\begin{table}[h]
\centering
\caption{overall caption}
\label{tab:overalllabel}
%1
\subfloat[subtabular-1]{
\begin{tabular}{|M{3cm}|M{3cm}|}
\hline
& bla \tabularnewline
bla & bla \tabularnewline
\hline
\end{tabular} }
\subref{tab:tabular1}
\subfloat[subtabular-2]{
\begin{tabular}{|M{3cm}|M{3cm}|}
\hline
& bla \tabularnewline
bla & bla \tabularnewline
\hline
\end{tabular} }
\subref{tab:tabular2}
\end{table}
\begin{table}[h]
\centering
\caption*{overall caption-continued}
\label{tab:overalllabel_1}
\ContinuedFloat
\addtocounter{table}{0}
%1
\subfloat[subtabular33]{
\begin{tabular}{|M{3cm}|M{3cm}|}
\hline
& bla \tabularnewline
bla & bla \tabularnewline
\hline
\end{tabular} }
\subref{tab:tabular3}
\end{table}
\end{landscape}
\ref{tab:overalllabel}
\ref{tab:overalllabel_1}
\ref{tab:tabular1}
\end{document}
答案1
这可能就是您想要实现的目标:
\documentclass[
fontsize=12pt,
BCOR=1cm,
DIV=12,
parskip=half,
numbers=noendperiod
]{scrartcl}
%general stuff
\usepackage[english,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{tgheros}
%table-edits
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{ltxtable}
\usepackage{tabularx}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{M}[1]{>{\centering}m{#1}}
%others
\usepackage{subfig}
\usepackage{longtable}
\usepackage{multirow, multicol}
\usepackage{lscape}
\usepackage{todonotes}
\begin{document}
% \begin{landscape}
\begin{table}[h]
\centering
\caption{overall caption}
\label{tab:overalllabel}
%1
\subfloat[subtabular-1]{
\begin{tabular}{|M{3cm}|M{3cm}|}
\hline
& bla \tabularnewline
bla & bla \tabularnewline
\hline
\end{tabular} \label{tab:tabular1}}
\subfloat[subtabular-2]{
\begin{tabular}{|M{3cm}|M{3cm}|}
\hline
& bla \tabularnewline
bla & bla \tabularnewline
\hline
\end{tabular}\label{tab:tabular2}}
\end{table}
\begin{table}[h]
\ContinuedFloat
\centering
\caption{overall caption-continued}
\label{tab:overalllabel_1}
\subfloat[subtabular33]{
\begin{tabular}{|M{3cm}|M{3cm}|}
\hline
& bla \tabularnewline
bla & bla \tabularnewline
\hline
\end{tabular}\label{tab:tabular3}}
\end{table}
% \end{landscape}
\ref{tab:overalllabel}
\ref{tab:overalllabel_1}
\subref{tab:tabular1}
\end{document}