0

I am trying to get the text below longtable to have the same spacing as normal tables (as you can see, as for my example, the spacing is quite big (due to the fact, I added it as multirow text?) (I am using LuaLatex btw in case that matters)longtablenormal table

Is there a way to get it the same as normal tables?

%----------------------------------------------------------------------------
%   LAYOUT
%----------------------------------------------------------------------------
\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}

%----------------------------------------------------------------------------
%   TABLES
%----------------------------------------------------------------------------
\usepackage{longtable}% longtables 
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\renewcommand{\arraystretch}{1.5}
\usepackage{subcaption,booktabs}
\usepackage{arydshln}% draw dash-lines in tables
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\usepackage{diagbox}% diagonal box
\usepackage{multirow}% multirow for diagonal box 
\usepackage{tikz}% tikz
\usetikzlibrary{arrows.meta,decorations.pathmorphing,backgrounds,fit,positioning,shapes.symbols,chains}
%\usepackage{ltablex}
%\usepackage{pgfplotstable}

%----------------------------------------------------------------------------
%   MAIN
%----------------------------------------------------------------------------

\begin{document}

\begin{table}[htb]
\caption{TableA}\label{ta:ta1}
\centering
\begin{tabular}[htb]{l} 
\toprule
\textbf{TableA}  \\ 
\midrule
a                                      \\ \hdashline
b                                   \\ \hdashline
c                           \\ 
\bottomrule
\end{tabular}
\\Quelle: Eigene Darstellung\\
\end{table}
    
\setlength{\extrarowheight}{0pt}
\addtolength{\extrarowheight}{\aboverulesep}
\addtolength{\extrarowheight}{\belowrulesep}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\ADLnullwidehline

\setlength\tabcolsep{2pt} % default: 6pt

\begin{longtable}{llp{3cm}l}
\caption{Übersicht des historischen Korpus (CHJ) von Chunagon}\label{ta:choverview}\\
\toprule
Epoche      & Periode         & Korpora     & Einordnung    \\  
\midrule
\endhead

\bottomrule
\multicolumn{4}{p{\textwidth}}{\begin{center}Quelle: CHJ.2009\\
(Eigene Darstellung) \end{center}}
\endlastfoot

Altertum    & Nara            & Man’y\={o}sh\={u}               & Gedicht- und Liederanthologie \\ \cdashline{3-4}
            &                 & Norito                  & Ritualisierte shint\={o}. Gebete  \\ \cdashline{3-4}
            &                 & Senmy\={o}                  & Gesetzestexte                 \\ \cline{2-4}
            & Heian           & Monogatari              & Fiktive Erzählung (Märchen)   \\ \cdashline{3-4}
            &                 & Nikki                   & Tagebuchliteratur             \\ \hline
Mittelalter & Kamakura        & Kaid\={o}ki                 & Reiseliteratur                \\ \cdashline{3-4}
            &                 & Nikki                   & Tagebuchliteratur             \\ \cdashline{3-4}
            &                 & Zuihitsu                & Miszellenliteratur            \\ \cline{2-4}
            & Muromachi       & Ky\={o}gen                  & Theater-Form                  \\ \cdashline{3-4}
            &                 & Kirishitan Shiry\={o}       & Christliche Literatur         \\ \hline
Neuzeit     & Edo             & Kaid\={o}ki                 & Reiseliteratur                \\ \cdashline{3-4}
            &                 & Nikki                   & Tagebuchliteratur             \\ \cdashline{3-4}
            &                 & Zuihitsu                & Miszellenliteratur            \\ \cdashline{3-4}
            &                 & Share-bon               & Form der Komödie              \\ \cdashline{3-4}
            &                 & Ninj\={o}-bon               & Romantische Literatur         \\ \cline{2-4}
Moderne     & \multirow{2}{*}{\begin{tabular}[c]{@{}l@{}}Meiji \&\\ Taishō\end{tabular}} & Zasshi                  & Zeitschriften                 \\ \cdashline{3-4}
            &                 & Ky\={o}kasho                & Schulbücher                   \\ \cdashline{3-4}
            &                 & Meiji-shoki-k\={o}go Shiry\={o} & Sammlung gesprochener Sprache \\ \cdashline{3-4}
            &                 & Kindai sh\={o}setsu         & Moderne Romane           \\                         
\end{longtable}

\end{document}

1 Answer 1

1

If I remove from your document example all not used settings and wrong inserted \\ , than I get the following result:

enter image description here

Is above result what you after?

In MWE (Minimal Working example I use xltabular instead of longtable, for multiline text cell I use makecell package:

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage[hmargin=2.50cm, 
            vmargin={2.50cm, 2.00cm}, 
            footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}

% tables
\usepackage{booktabs, makecell, multirow, xltabular}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}

\newcolumntype{L}[1]{>{\raggedright\arraybackslash\hsize=#1\hsize}X}
\usepackage{arydshln}
\setlength\arrayrulewidth{0.15pt}
\usepackage[table]{xcolor}
\arrayrulecolor{gray}

%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't use in a real document


\begin{document}
    \begin{table}[htb]
\caption{TableA}
\label{ta:ta1}
    \centering
\begin{tabular}[htb]{l}
    \toprule
\textbf{Table A}    \\
    \midrule
a                   \\ \hdashline
b                   \\ \hdashline
c                   \\
    \midrule[\heavyrulewidth]
\end{tabular}

\small
Quelle: Eigene Darstellung\\
    \end{table}

\lipsum[66]

\begingroup
\setlength\LTleft{0pt}
\setlength\tabcolsep{4pt}% default: 6pt
    \begin{xltabular}{\textwidth}{ll L{0.9}L{1.1}}
\caption{Übersicht des historischen Korpus (CHJ) von Chunagon}
\label{ta:choverview}\\
    \toprule
Epoche  & Periode   & Korpora   & Einordnung        \\
    \midrule
\endhead
    \midrule[\heavyrulewidth]
\multicolumn{4}{p{\dimexpr\textwidth-2\tabcolsep}}{\centering\small
                               Quelle: CHJ.2009\\
                               (Eigene Darstellung)}
\endlastfoot
% table body
Altertum    & Nara  & Man’y\={o}sh\={u} & Gedicht- und Liederanthologie     \\
    \cdashline{3-4}
            &       & Norito            & Ritualisierte shint\={o}. Gebete  \\
    \cdashline{3-4}
            &           & Senmy\={o}    & Gesetzestexte                     \\
    \cline{2-4}
            & Heian & Monogatari        & Fiktive Erzählung (Märchen)       \\
    \cdashline{3-4}
            &       & Nikki             & Tagebuchliteratur                 \\ 
    \midrule
Mittelalter & Kamakura  & Kaid\={o}ki   & Reiseliteratur                    \\
    \cdashline{3-4}
            &       & Nikki             & Tagebuchliteratur                 \\
    \cdashline{3-4}
            &       & Zuihitsu          & Miszellenliteratur                \\ 
    \cmidrule{2-4}
            & Muromachi & Ky\={o}gen    & Theater-Form                      \\
    \cdashline{3-4}
            &   & Kirishitan Shiry\={o} & Christliche Literatur             \\ 
    \midrule
Neuzeit     & Edo   & Kaid\={o}ki       & Reiseliteratur                    \\
    \cdashline{3-4}
            &       & Nikki             & Tagebuchliteratur                 \\
    \cdashline{3-4}
            &       & Zuihitsu          & Miszellenliteratur                \\        
    \cdashline{3-4}
            &       & Share-bon         & Form der Komödie                  \\
    \cdashline{3-4}
            &       & Ninj\={o}-bon     & Romantische Literatur             \\
    \cmidrule{2-4}
Moderne     & \multirow{2}{*}{\makecell{Meiji\\ Taishō}}
                    & Zasshi            & Zeitschriften                     \\
    \cdashline{3-4}
            &       & Ky\={o}kasho      & Schulbücher                       \\
    \cdashline{3-4}
            &       & Meiji-shoki-k\={o}go Shiry\={o} 
                                        & Sammlung gesprochener Sprache     \\
    \cdashline{3-4}
            &   & Kindai sh\={o}setsu   & Moderne Romane                    \\
    \end{xltabular}
\endgroup
\end{document}

As you can see, solid horizontal lines in table are not equal. Is this intentional? Anyway, I would remove almost all horizontal lines in table:

enter image description here

In the MWE, by which is produced above image, is more complete as in the first example. It is extended so, that in the case, if xltabular is really needed (it span two or more pages) it repeat captions and column headers on all pages:

Edit: Ups, I forgot to upload code for the second example:

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage[hmargin=2.50cm, 
            vmargin={2.50cm, 2.00cm}, 
            footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}

% tables
\usepackage{booktabs, makecell, multirow, xltabular}
\setcellgapes{2pt}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash\hsize=#1\hsize}X}

%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't use in a real document


\begin{document}
    \begin{table}[htb]
\caption{TableA}
\label{ta:ta1}
    \centering
\begin{tabular}[htb]{l}
    \toprule
\textbf{Table A}    \\
    \midrule
a                   \\ 
b                   \\ 
c                   \\
    \midrule[\heavyrulewidth]
\end{tabular}

\small
Quelle: Eigene Darstellung\\
    \end{table}

\lipsum[1]

\begingroup
\setlength\LTleft{0pt}
\setlength\tabcolsep{4pt}% default: 6pt
\makegapedcells
    \begin{xltabular}{\textwidth}{ll L{0.9}L{1.1}}
\caption{Übersicht des historischen Korpus (CHJ) von Chunagon}
\label{ta:choverview}\\
    \toprule
Epoche  & Periode   & Korpora   & Einordnung        \\
    \midrule
\endfirsthead
\caption[]{Übersicht des historischen Korpus (CHJ) von Chunagon}
\label{ta:choverview}\\
    \toprule
Epoche  & Periode   & Korpora   & Einordnung        \\
    \midrule
\endhead
    \midrule[\heavyrulewidth]
    \multicolumn{4}{r}{\small\textit{Continue on the next page}}
\endfoot
    \midrule[\heavyrulewidth]
\multicolumn{4}{p{\dimexpr\textwidth-2\tabcolsep}}{\centering\small
                               Quelle: CHJ.2009\\
                               (Eigene Darstellung)}
\endlastfoot
% table body
Altertum    & Nara  & Man’y\={o}sh\={u} & Gedicht- und Liederanthologie     \\           
            &       & Norito            & Ritualisierte shint\={o}. Gebete  \\
            &           & Senmy\={o}    & Gesetzestexte                     \\
    \addlinespace
            & Heian & Monogatari        & Fiktive Erzählung (Märchen)       \\
            &       & Nikki             & Tagebuchliteratur                 \\ 
    \addlinespace
Mittelalter & Kamakura  & Kaid\={o}ki   & Reiseliteratur                    \\
            &       & Nikki             & Tagebuchliteratur                 \\
            &       & Zuihitsu          & Miszellenliteratur                \\ 
            & Muromachi & Ky\={o}gen    & Theater-Form                      \\
            &   & Kirishitan Shiry\={o} & Christliche Literatur             \\ 
    \addlinespace
Neuzeit     & Edo   & Kaid\={o}ki       & Reiseliteratur                    \\
            &       & Nikki             & Tagebuchliteratur                 \\
            &       & Zuihitsu          & Miszellenliteratur                \\        
            &       & Share-bon         & Form der Komödie                  \\
            &       & Ninj\={o}-bon     & Romantische Literatur             \\
    \addlinespace
Moderne     & \multirow{2}{*}{\makecell{Meiji\\ Taishō}}
                    & Zasshi            & Zeitschriften                     \\
            &       & Ky\={o}kasho      & Schulbücher                       \\
            &       & Meiji-shoki-k\={o}go Shiry\={o} 
                                        & Sammlung gesprochener Sprache     \\
            &   & Kindai sh\={o}setsu   & Moderne Romane                    \\
    \end{xltabular}
\endgroup
\end{document}

Addendum: An example, where for long table is also used threeparttable, which enable add nicer notes about table's data source. IN MWE is consider only long table:

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}
% pagelayout
\usepackage[hmargin=2.50cm, 
            vmargin={2.50cm, 2.00cm}, 
            footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
% tables
\usepackage{booktabs, makecell, multirow, xltabular}
\setcellgapes{2pt}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash\hsize=#1\hsize}X}
\usepackage[referable]{threeparttablex}
\usepackage[table]{xcolor}

\usepackage{lipsum}% For dummy text. Don't use in a real document


\begin{document}
\lipsum[1-2]

\begingroup
\setlength\LTleft{0pt}
\setlength\tabcolsep{4pt}% default: 6pt
\makegapedcells
\begin{ThreePartTable}
    \setTableNoteFont{\color{gray}\footnotesize\vspace*{-0.5ex}}
\begin{TableNotes}[para,raggedright]\smallskip
\source{\textcolor{gray}{CHJ.2009 (Eigene Darstellung)}}
\end{TableNotes}
    \begin{xltabular}{\textwidth}{ll L{0.9}L{1.1}}
\caption{Übersicht des historischen Korpus (CHJ) von Chunagon}
\label{ta:choverview}\\
    \toprule
Epoche  & Periode   & Korpora   & Einordnung        \\
    \midrule
\endfirsthead
\caption[]{Übersicht des historischen Korpus (CHJ) von Chunagon}
\label{ta:choverview}\\
    \toprule
Epoche  & Periode   & Korpora   & Einordnung        \\
    \midrule
\endhead
    \midrule[\heavyrulewidth]
    \multicolumn{4}{r}{\small\textit{Continue on the next page}}
\endfoot
    \bottomrule
    \insertTableNotes\\
\endlastfoot
% table body
Altertum    & Nara  & Man’y\={o}sh\={u} & Gedicht- und Liederanthologie     \\           
            &       & Norito            & Ritualisierte shint\={o}. Gebete  \\
            &           & Senmy\={o}    & Gesetzestexte                     \\
    \addlinespace
            & Heian & Monogatari        & Fiktive Erzählung (Märchen)       \\
            &       & Nikki             & Tagebuchliteratur                 \\ 
    \addlinespace
Mittelalter & Kamakura  & Kaid\={o}ki   & Reiseliteratur                    \\
            &       & Nikki             & Tagebuchliteratur                 \\
            &       & Zuihitsu          & Miszellenliteratur                \\ 
            & Muromachi & Ky\={o}gen    & Theater-Form                      \\
            &   & Kirishitan Shiry\={o} & Christliche Literatur             \\ 
    \addlinespace
Neuzeit     & Edo   & Kaid\={o}ki       & Reiseliteratur                    \\
            &       & Nikki             & Tagebuchliteratur                 \\
            &       & Zuihitsu          & Miszellenliteratur                \\        
            &       & Share-bon         & Form der Komödie                  \\
            &       & Ninj\={o}-bon     & Romantische Literatur             \\
    \addlinespace
Moderne     & \multirow{2}{*}{\makecell{Meiji\\ Taishō}}
                    & Zasshi            & Zeitschriften                     \\
            &       & Ky\={o}kasho      & Schulbücher                       \\
            &       & Meiji-shoki-k\={o}go Shiry\={o} 
                                        & Sammlung gesprochener Sprache     \\
            &   & Kindai sh\={o}setsu   & Moderne Romane                    \\
    \end{xltabular}
\end{ThreePartTable}
\endgroup
\end{document}

enter image description here

6
  • Thank you! Hm so I have to completely change packages again right? Solid lines are set as per booktabs (toprule/midrule/bottomrule). I was under the assumption this would make it more readable.
    – user236381
    Commented Jun 22, 2021 at 8:30
  • What does \begingroup \setlength\LTleft{0pt} do? @Zarko
    – user236381
    Commented Jun 22, 2021 at 8:36
  • 1
    @user236381, I nothing change again. I only make your MWE compilable and solve your problem. It is true, that I took a liberty and show you, how I would design your table. With \begingroup ... \endgroup is limited local settings for long table (used xltabular). LT\left is table distance from left side of text area on page. For details see docuentation for longtable and xltabule (which combine longtable and tabularx).
    – Zarko
    Commented Jun 22, 2021 at 8:40
  • Thank you! I will try to modify!
    – user236381
    Commented Jun 22, 2021 at 9:32
  • Hm.. for me the text below is still different (although I was able to reduce some space thanks to you! Also, for me it won't show the "to be continued" part actually). Will try to solve
    – user236381
    Commented Jun 22, 2021 at 10:55

You must log in to answer this question.

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