将表格拆分为多个页面

将表格拆分为多个页面

我想将长表格分成多页(如果可能的话,可以加上“下页继续”这样的标题)。

我发现 kableExtra 看起来很有前途,然而这似乎与 R 有关,我真的不知道如何将其实现到我当前的乳胶环境中,这就是为什么我想知道是否有更简单的方法?

这是我的 MWE(抱歉,它很长 - 这就是为什么我真的需要拆分表格:D)

    %----------------------------------------------------------------------------
%   COMPILING SORTING
%----------------------------------------------------------------------------
% arara: lualatex: { shell: true, synctex: true }
% arara: bib2gls: { group: true }
% arara: lualatex: { shell: true, synctex: true }
% arara: makeindex: { style: mind.ist }
% arara: biber
% arara: lualatex: { shell: true, synctex: true }
% [arara:] clean: { extensions: [ aux, bbl, bcf, blg, ltjruby, run.xml, synctex.gz, glg, glstex, idx, ilg, ind, lof, log, lot, out, toc ] }

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

\usepackage[hmargin=2.5cm, top=2.5cm, bottom=2cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
%----------------------------------------------------------------------------
%   FONT
%----------------------------------------------------------------------------
\usepackage{libertine}
\usepackage{libertinust1math}

\makeatletter
\renewenvironment{table}% table ssf
  {\renewcommand\familydefault\sfdefault
   \@float{table}}
  {\end@float}
\makeatother
\makeatletter
\renewenvironment{figure}% figure ssf
  {\renewcommand\familydefault\sfdefault
   \@float{figure}}
  {\end@float}
\makeatother

\usepackage[match,MogaHMinEx90]{luatexja-preset}% Japanese
\setmainjfont{MogaHMinEx90}
\usepackage{luatexja-ruby}% hiragana
\ltjsetparameter{jacharrange={-3}}% punctuation is Latin
%----------------------------------------------------------------------------
%   PAGING TITLES
%----------------------------------------------------------------------------
\renewcommand\sectionformat{\mbox{\thesection.\enskip$|$\enskip}}% 

\RedeclareSectionCommand[
  beforeskip=2\baselineskip,% positive value, if afterindent=false is set
  afterindent=false,
  afterskip=.5\baselineskip,
  tocentrynumberformat=\def\autodot{.}% replace \autodot by a fixed dot for section entries
   ]{section}
   
\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subsection}
  
\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subsubsection}
  
\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{paragraph}
  
\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subparagraph}
  \usepackage{authblk}
%----------------------------------------------------------------------------
%   TOC
%----------------------------------------------------------------------------
\KOMAoptions{toc=sectionentrydotfill}
\KOMAoption{captions}{tableheading}% correct TOC count for tables
\renewcaptionname{ngerman}{\contentsname}{Inhaltsverzeichnis}
\BeforeTOCHead[toc]{{\pdfbookmark[1]{\contentsname}{toc}}}% TOC in bookmarks
%----------------------------------------------------------------------------
%   GLOSSARIES & INDECES
%----------------------------------------------------------------------------
\usepackage{makeidx}
\usepackage[record,% using bib2gls
 abbreviations,% create 'abbreviations' glossary
 style=indexgroup,% set the default style to 'tree'
 postdot
]{glossaries-extra}
\setabbreviationstyle[common]{short}% set abbreviation style before \GlsXtrLoadResources
\glssetcategoryattribute{general}{glossname}{firstuc}
\glssetcategoryattribute{general}{glossdesc}{firstuc}
\GlsXtrLoadResources[src={glossary}]
%\setkomafont{descriptionlabel}{\normalfont\bfseries}% set serif style glossary
\makeindex
\usepackage[totoc]{idxlayout}
%----------------------------------------------------------------------------
%   APPENDICES
%----------------------------------------------------------------------------
\newcommand*\appendixmore{
  \clearpage
  \renewcommand{\thesubsection}{\Alph{subsection}}%
}
%----------------------------------------------------------------------------
%   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
\usepackage[table]{xcolor}
\usepackage{xcolor}% mark text
\usepackage{colortbl}
\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}

\setlength{\extrarowheight}{0pt}
\addtolength{\extrarowheight}{\aboverulesep}
\addtolength{\extrarowheight}{\belowrulesep}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\ADLnullwidehline

\arrayrulecolor[rgb]{0.8,0.8,0.8}
\setlength\tabcolsep{4pt} % default: 6pt

\begin{longtable}{ll >{\raggedright}p{2.5cm} >{\raggedright}p{3cm} cr} 
\caption{Kollokationen von 禍} \\
%\toprule
\textbf{Syntax} & \textbf{Kollokation} & \textbf{Kana} & 
\textbf{Translat} & \textbf{Frequenz} & \textbf{Score}  \\ 
%\arrayrulecolor{black}
\midrule
\endhead

\arrayrulecolor{black}
\bottomrule
\endlastfoot

\rowcolor[rgb]{0.937,0.937,0.937} wo + Verb & &  & & 15  & 11,0 \\ 
  & 転ずる  & tenzuru & wenden & 11  & 11,8 \\ 
\cdashline{2-6}
  & 及ぼす  & oyobosu & ausüben & 4 & 10,2 \\ 
\rowcolor[rgb]{0.937,0.937,0.937} Pron. + no & &  & & 23  & 10,2 \\ 

  & 鳥 & tori  & Vogel  & 2 & 11,1 \\ 
\cdashline{2-6}
  & 洪水   & kōzui & Überschwemmung & 2 & 10,9 \\ 
\cdashline{2-6}
  & 虫 & mushi & Insekt & 1 & 10,3 \\ 
\cdashline{2-6}
  & 人滿   &  & Menschenmenge & 1 & 10,2 \\ 
\cdashline{2-6}
  & 所謂政教混乱 & iwayuru seikyō konran & s.\ g.\ politisch-religiöse Verwirrung  & 1 & 10,2 \\ 
\cdashline{2-6}
  & 生民   & seimin  & Volk   & 1 & 10,2 \\ 
\cdashline{2-6}
  & 子孫赤族 & shison aka-zoku  & Nachkomme der Akha  & 1 & 10,2 \\ 
\cdashline{2-6}
  & 破船   & hasen & Schiffbruch  & 1 & 10,2 \\ 
\cdashline{2-6}
  & 国家党人 & kokka tōjin & Parteimitglied & 1 & 10,2 \\ 
\cdashline{2-6}
  & 東夷北狄 & tōi hokuteki & Dongyi und Beidi~(indigene Völker Chinas)  & 1 & 10,2 \\ 
\cdashline{2-6}
  & 連累   & renrui  & Mitschuld  & 1 & 10,2 \\ 
\cdashline{2-6}
  & 江浙   & kōnan & Jiangzhe~(hist. Region Chinas, ca.\ 1276--1299) & 1 & 10,2 \\ 
\cdashline{2-6}
  & 文字   & moji  & Schrift(zeichen) & 1 & 10,2 \\ 
\cdashline{2-6}
  & 代々弑殺 & daidai shīsatsu  & & 1 & 10,2 \\ 
\cdashline{2-6}
  & 滔天   & tōten & Tōten (pol. Aktivist, $\approx$1871--1922) & 1 & 10,1 \\ 
\cdashline{2-6}
  & 宦者   & kanja & Eunuch & 1 & 10,1 \\ 
\cdashline{2-6}
  & 不思議  & fushigi & Mysterium  & 1 & 10,1 \\ 
\cdashline{2-6}
  & 先達て  & sakidachite & zuvor  & 1 & 10,1 \\ 
\cdashline{2-6}
  & 外寇   & gaikō & Invasion   & 1 & 10,1 \\ 
\cdashline{2-6}
  & 孛佛兵争 & haifutsu heisō & Deutsch-Französischer Krieg (1870--1871) & 1 & 10,1 \\ 
\cdashline{2-6}
  & 人為   & jin'i & menschliches Tun & 1 & 10,1 \\ 
\rowcolor[rgb]{0.937,0.937,0.937} ni + Verb & &  & & 10  & 10,8 \\ 

  & 逢う   & au & sich begegnen & 3 & 11,5 \\ 
\cdashline{2-6}
  & 罹る   & kakaru  & erleiden   & 4 & 11,2 \\ 
\cdashline{2-6}
  & 堪ざる  & koezaru & (nicht) aushalten & 1 & 10,7 \\ 
\cdashline{2-6}
  & 陥る   & ochiiru & in etw. (ver)fallen & 1 & 10,5 \\ 
\cdashline{2-6}
  & 當る   & ataru & treffen & 1 & 10,3 \\ 

\rowcolor[rgb]{0.937,0.937,0.937} wa + Verb & &  & & 11  & 10,8 \\ 

  & 起こる  & okoru & sich ereignen & 4 & 11,9 \\ 
\cdashline{2-6}
  & 伏蔵為る & fukuzō suru & sich verborgen halten & 1 & 10,9 \\ 
\cdashline{2-6}
  & 有る得る & arueru  & möglich sein & 1 & 10,8 \\ 
\cdashline{2-6}
  & 局為る  & kyokusuru & begrenzen  & 1 & 10,8 \\ 
\cdashline{2-6}
  & 及ぶ   & oyobu & sich erstrecken  & 2 & 10,7 \\ 
\cdashline{2-6}
  & 避ける  & sakeru  & (ver)meiden  & 1 & 10,5 \\ 
\cdashline{2-6}
  & 関する  & kansuru & betreffen  & 1 & 10,2 \\ 
\rowcolor[rgb]{0.937,0.937,0.937} Adn & &  & & 1 & 10,6 \\ 

  & 然したる & sashitaru & nicht sonderlich & 1 & 10,9 \\ 

\rowcolor[rgb]{0.937,0.937,0.937} no + Pronomen & &  & & 7 & 7,1  \\ 

  & 門 & monkado & Tor    & 3 & 12,3 \\ 
\cdashline{2-6}
  & 根源   & kongen  & Ursprung   & 1 & 10,4 \\ 
\cdashline{2-6}
  & 身 & mi & Körper & 1 & 10,4 \\ 
\rowcolor[rgb]{0.937,0.937,0.937} Kompositum    & &  & & 1 & 13,4 \\ 

  & 仏郎察  & futsu rō satsu & Frankreich & 1 & 13,4 \\
\end{longtable}
\end{document}

现在,我很难调整它们的顺序,以使它们不互相冲突。

\usepackage{arydshln}% draw dash-lines in tables
\usepackage[table]{xcolor}
\usepackage{xcolor}% mark text
\usepackage{colortbl}
\usepackage{tikz}% tikz

使用上述设置确实可以工作,但是由于某种原因,第一个字段“语法”被涂黑了。有什么办法可以解决这个问题吗?

这里

答案1

我建议你table/tabular长桌环境。结果表大约有 3-1/2 页。

对于以下示例代码,我不得不猜测是否应该加载可以显示日文汉字的字体。我选择了软件包fontspec和免费Noto Serif CJK JP字体。您显然可以自由选择其他字体。

最后的建议(未在下面的代码中实现):我认为

\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}

可以(应该?)删除或注释掉。FWIW,我已经注释掉了大多数\hline指令,因为它们没有任何用处。

在此处输入图片描述

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

\usepackage[hmargin=2.5cm, top=2.5cm, bottom=2cm, footskip=1cm]{geometry}


\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}


% -----
% Fonts
% -----

\usepackage{fontspec}
\setmainfont{Noto Serif CJK JP} % or some other suitable font


%---------
%   TABLES
%---------

\usepackage{longtable} % <-- new

\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\renewcommand{\arraystretch}{1.5}
\usepackage{subcaption,booktabs}
\usepackage{arydshln}% draw dash-lines in tables
\usepackage[table]{xcolor}
\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}
   
\setlength{\extrarowheight}{0pt}
\addtolength{\extrarowheight}{\aboverulesep}
\addtolength{\extrarowheight}{\belowrulesep}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\ADLnullwidehline

\arrayrulecolor[rgb]{0.8,0.8,0.8}
\setlength\tabcolsep{4pt} % default: 6pt

\begin{longtable}{ll >{\raggedright}p{2.5cm} >{\raggedright}p{3cm} cr} 
\caption{Kollokationen von 禍} \\
%\toprule
\textbf{Syntax} & \textbf{Kollokation} & \textbf{Kana} & 
\textbf{Translat} & \textbf{Frequenz} & \textbf{Score}  \\ 
%\arrayrulecolor{black}
\midrule
\endhead

\arrayrulecolor{black}
\bottomrule
\endlastfoot

\rowcolor[rgb]{0.937,0.937,0.937} wo + Verb & &  & & 15  & 11,0 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 転ずる  & tenzuru & wenden & 11  & 11,8 \\ 
\arrayrulecolor{black}\cdashline{2-6}
  & 及ぼす  & oyobosu & ausüben & 4 & 10,2 \\ 
%\hline
\rowcolor[rgb]{0.937,0.937,0.937} Pron. + no & &  & & 23  & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 鳥 & tori  & Vogel  & 2 & 11,1 \\ 
\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 洪水   & kōzui & Überschwemmung & 2 & 10,9 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 虫 & mushi & Insekt & 1 & 10,3 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 人滿   &  & Menschenmenge & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 所謂政教混乱 & iwayuru seikyō konran & s.\ g.\ politisch-religiöse Verwirrung  & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 生民   & seimin  & Volk   & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 子孫赤族 & shison aka-zoku  & Nachkomme der Akha  & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 破船   & hasen & Schiffbruch  & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 国家党人 & kokka tōjin & Parteimitglied & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 東夷北狄 & tōi hokuteki & Dongyi und Beidi~(indigene Völker Chinas)  & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 連累   & renrui  & Mitschuld  & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 江浙   & kōnan & Jiangzhe~(hist. Region Chinas, ca.\ 1276--1299) & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 文字   & moji  & Schrift(zeichen) & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 代々弑殺 & daidai shīsatsu  & & 1 & 10,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 滔天   & tōten & Tōten (pol. Aktivist, $\approx$1871--1922) & 1 & 10,1 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 宦者   & kanja & Eunuch & 1 & 10,1 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 不思議  & fushigi & Mysterium  & 1 & 10,1 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 先達て  & sakidachite & zuvor  & 1 & 10,1 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 外寇   & gaikō & Invasion   & 1 & 10,1 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 孛佛兵争 & haifutsu heisō & Deutsch-Französischer Krieg (1870--1871) & 1 & 10,1 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 人為   & jin'i & menschliches Tun & 1 & 10,1 \\ 
%\hline
\rowcolor[rgb]{0.937,0.937,0.937} ni + Verb & &  & & 10  & 10,8 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 逢う   & au & sich begegnen & 3 & 11,5 \\ 
\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 罹る   & kakaru  & erleiden   & 4 & 11,2 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 堪ざる  & koezaru & (nicht) aushalten & 1 & 10,7 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 陥る   & ochiiru & in etw. (ver)fallen & 1 & 10,5 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 當る   & ataru & treffen & 1 & 10,3 \\ 
%\hline
\rowcolor[rgb]{0.937,0.937,0.937} wa + Verb & &  & & 11  & 10,8 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 起こる  & okoru & sich ereignen & 4 & 11,9 \\ 
\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 伏蔵為る & fukuzō suru & sich verborgen halten & 1 & 10,9 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 有る得る & arueru  & möglich sein & 1 & 10,8 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 局為る  & kyokusuru & begrenzen  & 1 & 10,8 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 及ぶ   & oyobu & sich erstrecken  & 2 & 10,7 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 避ける  & sakeru  & (ver)meiden  & 1 & 10,5 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 関する  & kansuru & betreffen  & 1 & 10,2 \\ 
%\hline
\rowcolor[rgb]{0.937,0.937,0.937} Adn & &  & & 1 & 10,6 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 然したる & sashitaru & nicht sonderlich & 1 & 10,9 \\ 
\arrayrulecolor{black}%\hline
\rowcolor[rgb]{0.937,0.937,0.937} no + Pronomen & &  & & 7 & 7,1  \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 門 & monkado & Tor    & 3 & 12,3 \\ 
\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 根源   & kongen  & Ursprung   & 1 & 10,4 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}\cline{1-1}\arrayrulecolor{black}\cdashline{2-6}
  & 身 & mi & Körper & 1 & 10,4 \\ 
%\hline
\rowcolor[rgb]{0.937,0.937,0.937} Kompositum    & &  & & 1 & 13,4 \\ 
\arrayrulecolor[rgb]{0.8,0.8,0.8}%\hline
  & 仏郎察  & futsu rō satsu & Frankreich & 1 & 13,4 \\

\end{longtable}

\end{document}

相关内容