1

I was trying to align multiple tables as subtables, however this will (as per my current code) lead to a wrong numbering of the tables in listing them. I would either like to have it as

  1. Table A
  2. Table B

or

  1. Table A 1.1 TableA1 1.2 TableA2 1.3 TableA3
  2. Table B 2.1 ...

How do I achieve that?

%----------------------------------------------------------------------------
%   LAYOUT
%----------------------------------------------------------------------------
\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
%----------------------------------------------------------------------------
%   TOC
%----------------------------------------------------------------------------
\KOMAoptions{toc=sectionentrydotfill}
\renewcaptionname{ngerman}{\contentsname}{Inhaltsverzeichnis}
\BeforeTOCHead[toc]{{\pdfbookmark[1]{\contentsname}{toc}}}% TOC in bookmarks
%----------------------------------------------------------------------------
%   BIB
%----------------------------------------------------------------------------
\usepackage[
  backend=biber,
  style=ext-authoryear,
  sorting=nyvt,
  datamodel=customstyles,
  maxnames=25
]{biblatex}
\addbibresource{library.bib}
%----------------------------------------------------------------------------
%   FIGURES & TABLES
%----------------------------------------------------------------------------
\renewcommand{\listtablename}{Tabellenverzeichnis}
\renewcommand{\tablename}{Tab.}
\counterwithout{table}{section}
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\renewcommand{\arraystretch}{1.5}
\usepackage{subcaption,booktabs}
\usepackage{arydshln}% draw dash-lines in tables
\usepackage{colortbl}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\usepackage{diagbox}% diagonal box
\usepackage{multirow}% multirow for diagonal box
%----------------------------------------------------------------------------
%   MAIN
%----------------------------------------------------------------------------

\begin{document}
    \listoftables 
    \addcontentsline{toc}{chapter}{Tabellenverzeichnis}
    \renewcommand{\listtablename}{Tabellenverzeichnis}
\renewcommand{\tablename}{Tab.}
\counterwithout{table}{section}
    
   \begin{table}
\caption{TableA}\label{ta:ta1}
\begin{subtable}[t]{0.275\linewidth}
\caption{TableA1}\label{ta:ta1a}
\centering
\begin{tabular}[t]{l} 
\toprule
\multicolumn{1}{c}{\textbf{TableA1}}  \\ 
\midrule
a                                      \\ \hdashline
b                                   \\ \hdashline
c                           \\ \hdashline
d                                \\ \hdashline
e                                    \\ \hdashline
f                                     \\ \hdashline
g                                 \\ \hdashline
h                          \\ \hdashline
i                                \\
\bottomrule
\end{tabular}\smallskip
\end{subtable}
\begin{subtable}[t]{0.275\linewidth}
\caption{TableA2}\label{ta:ta1b}
\centering
\begin{tabular}[t]{l} 
\toprule
\multicolumn{1}{c}{\textbf{TableA2}}  \\ 
\midrule
a                                \\ \hdashline
b               \\ \hdashline
c                               \\ \hdashline
d                                   \\ \hdashline
e                   \\
\bottomrule
\end{tabular}
\smallskip
\end{subtable}
\begin{subtable}[t]{0.275\linewidth}
\caption{TableA3}\label{ta:ta1c}
\centering
\begin{tabular}[t]{lp{2.5cm}} 
\toprule
\multicolumn{2}{c}{\textbf{TableA3}}                                                                                  \\ 
\midrule
1               & 2                                                                     \\ 
\hdashline
3      & 4  \\ 
\hdashline
5 & 6                                                                                       \\
\bottomrule
\end{tabular}
\smallskip
\end{subtable}
\begin{center}
Quelle: XYZ
\end{center}
\end{table}

\begin{table}
\caption{TableB}\label{ta:action}
\begin{subtable}[t]{0.45\linewidth}
\caption{TableB2}\label{ta:TA2a}
\centering
\begin{tabular}[t]{l} 
\toprule
\textbf{TA2a}  \\ 
\midrule
nicht         \\ 
\hdashline
einnehmen                \\ 
\hdashline
(be)handeln              \\ 
\hdashline
ausnutzen                \\ 
\hdashline
beschließen              \\ 
\hdashline
konversieren             \\ 
\hdashline
veranlassen              \\ 
\hdashline
Entschluss               \\ 
\hdashline
notwendig sein           \\ 
\hdashline
handeln                  \\
\bottomrule
\end{tabular}\smallskip
\end{subtable}
\begin{subtable}[t]{0.45\linewidth}
\caption{Table2b}\label{ta:TA2b}
\centering
\begin{tabular}[t]{l} 
\toprule
\textbf{TA2b}             \\ 
\midrule
Unheil                                 \\ 
\hdashline
Katastrophe                            \\ 
\hdashline
auf etw. hinauslaufen                  \\ 
\hdashline
fallen                                 \\ 
\hdashline
Unruhe, Verwirrung der Welt            \\ 
\hdashline
Lage, Situation                        \\ 
\hdashline
Übel                                   \\ 
\hdashline
Unfall                                 \\ 
\hdashline
himmlischer Beistand  \\ 
\bottomrule
\end{tabular}
\smallskip
\end{subtable}
\begin{center}
Quelle: XYZ
\end{center}
\end{table}
\end{document} 

1 Answer 1

1

First of all, your MWE can be drastically shortened by removing all contents of the subtable environment, except for the \caption commands. There are also quite some packages that are not related to the issue, in fact, the behaviour can be recreated using scrartcl and subcaption only.

Using this shortened example, we can see, that adding \KOMAoption{captions}{tableheading} results in the correct table numbers:

\documentclass{scrartcl}
\KOMAoption{captions}{tableheading}
\usepackage{subcaption}

\begin{document}
\listoftables 
    
\begin{table}
  \caption{TableA}\label{ta:ta1}
  \centering
  \begin{subtable}[t]{0.275\linewidth}
    \caption{TableA1}\label{ta:ta1a}
  \end{subtable}
  \begin{subtable}[t]{0.275\linewidth}
    \caption{TableA2}\label{ta:ta1b}
  \end{subtable}
  \begin{subtable}[t]{0.275\linewidth}
    \caption{TableA3}\label{ta:ta1c}
  \end{subtable}
\end{table}

\begin{table}
  \caption{TableB}\label{ta:action}
  \begin{subtable}[t]{0.45\linewidth}
    \caption{TableB2}\label{ta:TA2a}
  \end{subtable}
  \begin{subtable}[t]{0.45\linewidth}
    \caption{Table2b}\label{ta:TA2b}
  \end{subtable}
\end{table}
\end{document}
1
  • Thanks! @leandriis !
    – user236381
    Jun 4, 2021 at 0:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .