微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 onecolumn Longtable/Supertabular 之前平衡 Latex twocolumn 布局

如何解决在 onecolumn Longtable/Supertabular 之前平衡 Latex twocolumn 布局

我想在 Latex 的两列布局中放置一个 Longtable 或 Supertabular。表格对于单列来说太大了,所以对于表格,我切换到一列布局。这工作得很好,但表格前的两列不平衡,所以可能会出现巨大的差距。

一个例子:
如果左列被填满,表格随后开始,右列将留空,表格将在下一页开始。

我想把这个问题细分为两个问题:

  • 是否可以平衡表格前的两列?
  • Longtable 或 Supertabular 是否有可能在平衡列之后直接启动?因为如果表格很长并且无法容纳页面上的剩余空间,表格将从下一页开始。

示例代码

\documentclass[twocolumn]{scrbook}

\usepackage{lipsum}
\usepackage{longtable,booktabs}
\usepackage{supertabular}
\usepackage{luacode}

\title{Ein Testdokument}
\author{Its Me}
\date{5. Januar 2020}

\newcounter{rownumb}
\setcounter{rownumb}{1}
\newcommand{\tabline}{Test & \the\value{rownumb} & Description\addtocounter{rownumb}{1}\\}
\newcommand{\tablines}[1]{
  \luaexec{
    for i=1,#1,1 do
      tex.print(string.format("Test & \%d & Description \\\\",i))
    end
  }
}

\begin{document}
\maketitle
\tableofcontents

\chapter{Introduction}

\lipsum


\onecolumn
\begin{longtable}[]{lcr}
\caption{longtable}\tabularnewline
\toprule
First A & First B & First C \\
\midrule
\endfirsthead
\toprule
A & B & C \\
\midrule
\endhead
\tablines{50}
\bottomrule
\end{longtable}
\twocolumn


\lipsum

\begin{center}
\tablefirsthead{\hline First A & First B & First C \\ \hline}
\tablehead{\hline First A & First B & First C \\ \hline}
\tabletail{\hline}
\tablelasttail{\hline}
\topcaption{short supertabular}
\begin{supertabular}{lcr}
\tablines{10}
\end{supertabular}
\end{center}

\lipsum

\onecolumn
\tablefirsthead{\hline First A & First B & First C \\ \hline}
\tablehead{\hline First A & First B & First C \\ \hline}
\tabletail{\hline}
\tablelasttail{\hline}
\topcaption{long supertabular}
\begin{supertabular}{lcr}
\tablines{50}
\end{supertabular}
\twocolumn


\lipsum

\begin{table}
\centering
\begin{tabular}{lcr}
\hline First A & First B & First C \\ \hline
\tablines{10}
\hline
\end{tabular}
\end{table}

\lipsum

\end{document}

标签说明:
我会添加更多标签,如“表格”和“列平衡”,但我没有找到合适的标签,因为这是我的第一个问题,我无法添加不存在的标签。所以,如果有人觉得这很有意义,请添加更多标签

非常感谢和最好的问候

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。