我无法将部分标题与表格放在同一页上。有什么办法可以解决这个问题吗?这是我的(简化的)代码:
\documentclass[a4paper, 12pt, twoside=true, openright, headsepline, pointlessnumbers]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,ngerman]{babel}
\usepackage[backend=bibtex,style=alphabetic]{biblatex}
\addbibresource{citavi_lit.bib}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{booktabs}
\begin{document}
\section{Test section}
\ref{tab:test} is a landscape longtable
\begin{landscape}
\begin{longtable}{lll}
\caption{test}\\
\label{tab:test}\\\toprule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
1 & 2 3 \\\bottomrule
\end{longtable}
\end{landscape}
\end{document}
答案1
您需要确保表格不太宽,以免没有空间放置节头,但如果有空间,您可以在空间中放置标题,如果您需要的话
\documentclass[a4paper, 12pt, twoside=true, openright, headsepline, pointlessnumbers]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,ngerman]{babel}
\usepackage[backend=bibtex,style=alphabetic]{biblatex}
\addbibresource{citavi_lit.bib}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{booktabs}
\begin{document}
\begin{landscape}
\begin{picture}(0,0)
\put(550,10){\rotatebox{-90}{\parbox{5cm}{\section{Test section}}}}
\end{picture}
\begin{longtable}{lll}
\caption{test}\\
\label{tab:test}\\\toprule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
\textbf{1} & \textbf{2} & \textbf{3} \\\midrule
1 & 2 3 \\\bottomrule
\end{longtable}
\ref{tab:test}
\end{landscape}
\end{document}