我该如何结合 tabularx、sidewaystable 和 longtable?我无法在这个论坛中找到针对此特定问题的解决方案。
\documentclass[a4paper,bibliography=totoc,toc=listof,chapterentrydots=on,captions=tableheading,headings=small]{scrbook}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{tabulary}
\usepackage{pdflscape}
\usepackage{lscape}
\usepackage{longtable}
\usepackage[figuresright]{rotating}
\usepackage[babel]{csquotes}
\usepackage[language=autobib,
backend=biber,
citetracker=true,
autolang=other,
style=authoryear-comp,
maxcitenames=2,maxbibnames=99,
uniquename=false,uniquelist=true,
isbn=false,doi=false,
]{biblatex}
\begin{document}
\begin{sidewaystable}[hbt]
%\begin{landscape}
%\begin{longtable}
%\centering
%\scriptsize
\renewcommand{\arraystretch}{2}
\caption[Caption]{\textbf{Caption}}
\label{label}
\begin{tabularx}{\textwidth}{XXXX}
%\begin{tabularx}{\textwidth}{p{0.15\textwidth}Xp{.175\textwidth}p{.15\textwidth}}
\toprule
\textbf{1} & \textbf{2} & \textbf{3} & \textbf{4}\\
\midrule
Author1
& In the beginning God created the heaven and the earth. 2 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. 3 And God said, Let there be light: and there was light. 4 And God saw the light, that it was good: and God divided the light from the darkness. 5 And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day. 6 And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.
& -
& -
\\
Author2
& And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so. 8 And God called the firmament Heaven. And the evening and the morning were the second day. 9 And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so. 10 And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good.
& -
\\
Author3
& -
& -
& -
\\
Author4
& -
& -
& -
\\
Author5
& -
& -
& -
\\
\bottomrule
\end{tabularx}
%\end{longtable}
%\end{landscape}
\end{sidewaystable}
\end{document}
答案1
嗯,第一步是删除代码中大量的无关内容。我们的想法是创建一个最小的工作示例;也就是说,这个示例可以演示您的问题,而不需要任何与该问题无关的内容。例如,所有对biblatex
您的问题完全没有影响的内容。
下一步是阅读所有文档。例如,您声明表格的第一行不重复。为此,您需要\endhead
;前面的材料将在表格的所有页面上重复。
然后,你确实想看看前面的页面和后面的页面的大小,这样你就可以确定你的横向页面确实是横向的。所以让我们使用\usepackage{lipsum}
为我们提供一些前后背景信息longtable
。
以下是我想到的(假设你乐意假装tabularx
以下是我想出的办法(假设您乐意按照评论中的建议
\documentclass[a4paper,bibliography=totoc,toc=listof,chapterentrydots=on,captions=tableheading,headings=small]{scrbook}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{lscape}
\usepackage{longtable}
\usepackage{lipsum}
\begin{document}
\lipsum
\begin{landscape}
\begin{longtable}[tbp]{p{0.15\textwidth}p{0.55\textwidth}p{.15\textwidth}p{.15\textwidth}}
\toprule
\textbf{1} & \textbf{2} & \textbf{3} & \textbf{4}\\
\midrule
\endhead
Author1 & In the beginning God created the heaven
and the earth. 2 And the earth was without form, and void;
and darkness was upon the face of the deep. And the Spirit
of God moved upon the face of the waters. 3 And God said,
Let there be light: and there was light. 4 And God saw the
light, that it was good: and God divided the light from the
darkness. 5 And God called the light Day, and the darkness
he called Night. And the evening and the morning were the
first day. 6 And God said, Let there be a firmament in the
midst of the waters, and let it divide the waters from the
waters. & - & - \\
Author2 & And God made the firmament, and divided
the waters which were under the firmament from the waters
which were above the firmament: and it was so. 8 And God
called the firmament Heaven. And the evening and the morning
were the second day. 9 And God said, Let the waters under
the heaven be gathered together unto one place, and let the
dry land appear: and it was so. 10 And God called the dry
land Earth; and the gathering together of the waters called
he Seas: and God saw that it was good. & - \\
Author2 & And God made the firmament, and divided
the waters which were under the firmament from the waters
which were above the firmament: and it was so. 8 And God
called the firmament Heaven. And the evening and the morning
were the second day. 9 And God said, Let the waters under
the heaven be gathered together unto one place, and let the
dry land appear: and it was so. 10 And God called the dry
land Earth; and the gathering together of the waters called
he Seas: and God saw that it was good. & - \\
Author2 & And God made the firmament, and divided
the waters which were under the firmament from the waters
which were above the firmament: and it was so. 8 And God
called the firmament Heaven. And the evening and the morning
were the second day. 9 And God said, Let the waters under
the heaven be gathered together unto one place, and let the
dry land appear: and it was so. 10 And God called the dry
land Earth; and the gathering together of the waters called
he Seas: and God saw that it was good. & - \\
Author3 & - & - & - \\
Author4 & - & - & - \\
Author5 & - & - & - \\
\bottomrule
\caption{A Caption}
\end{longtable}
\end{landscape}
\lipsum
\end{document}
这会给你类似这样的结果:
我思考就是你要找的。
答案2
\documentclass[a4paper,bibliography=totoc,toc=listof,chapterentrydots=on,captions=tableheading,headings=small]{scrbook}
\usepackage{booktabs}
\usepackage{ltablex}
\usepackage{pdflscape}
\usepackage[babel]{csquotes}
\begin{document}
\begin{landscape}
renewcommand{\arraystretch}{2}
\begin{tabularx}{\textwidth}{lXll}
\caption[Caption]{\textbf{Caption}\label{label}}\\\toprule
\textbf{1} & \textbf{2} & \textbf{3} & \textbf{4}\\\midrule
Author1
& In the beginning God created the heaven and the earth. 2 And the earth was
without form, and void; and darkness was upon the face of the deep. And the
Spirit of God moved upon the face of the waters. 3 And God said, Let there be
light: and there was light. 4 And God saw the light, that it was good: and God
divided the light from the darkness. 5 And God called the light Day, and the
darkness he called Night. And the evening and the morning were the first day.
6 And God said, Let there be a firmament in the midst of the waters, and let
it divide the waters from the waters.
& -
& -
\\
Author2
& And God made the firmament, and divided the waters which were under the
firmament from the waters which were above the firmament: and it was so. 8 And
God called the firmament Heaven. And the evening and the morning were the
second day. 9 And God said, Let the waters under the heaven be gathered
together unto one place, and let the dry land appear: and it was so. 10 And
God called the dry land Earth; and the gathering together of the waters called
he Seas: and God saw that it was good.
& -
\\
Author3
& -
& -
& -
\\
Author4
& -
& -
& -
\\
Author5
& -
& -
& -
\\\bottomrule
\end{tabularx}
\end{landscape}
\end{document}