0

I am trying to have multiple tabulars as subfloats using the subfig package and the table environment. Adding another table environment and binding them with \ContinuedFloat and stopping the table-counter from rising (using \addtocounter{table}{0} ) I am getting questionsmarks when using \ref to refer to either subref of any subfloat or label of the second table environment, which table counter didn't rise.

To add up another error, I am getting question marks next to the subfloat captions, when there are more than 1 subfloat in a table environment

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

Probably this is what you wanted to achieve:

\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}
  • That easy? All it took was replacing \subref with \label ?! Thanks alot! – Im4X Jun 12 at 11:59
  • @lm4X: I also moved the \continuedFloat command before the \caption in the second table environment. You can also remove the \addtocounter{table}{0} command. – leandriis Jun 12 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.