我想在纵向页面中插入一个横向表格,但表格不能浮动。因为,如果它保持浮动,它会落入另一个页面。我使用了附加链接中的代码:
\documentclass[a4paper,12pt,oneside]{report}
\usepackage{fullpage} % megalitara margin gia tex
\usepackage{algorithm} % gia tis listes graph and diagram
\usepackage{amsmath,eqparbox,xparse} %equations in curled brackets are centered
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{indentfirst}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{threeparttable}
\usepackage{lscape}
\usepackage{scalefnt}
\usepackage{graphicx}
\usepackage{float}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{afterpage}
\begin{document}
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
\afterpage{%
\clearpage% Flush earlier floats (otherwise order might not be correct)
\thispagestyle{empty}% empty page style (?)
\begin{landscape}% Landscape page
\begin{table}
\centering % Center table
\resizebox{1.5\textwidth}{!}{
\begin{threeparttable}
\begin{tabular}{llll}
A & B & C & D \\
\end{tabular}
\begin{tablenotes}[para,flushleft]
\small
\item Notes:
\end{tablenotes}
\end{threeparttable}
}
\end{table}
\end{landscape}
\clearpage% Flush page
}
\end{document}
但表格在另一个页面中丢失。然后,我尝试添加 \begin{table}[H] ...\end{table},但这只会使表格进一步丢失并留下空白页。
答案1
如果您不想让表格材料浮动,请不要使用table
浮动对象。相反,将threeparttable
环境嵌入指令中\rotatebox{90}{...}
,并将整个内容放在center
环境中。
当然,如果您不需要标题,则应该省略\captionof
说明。
\documentclass[a4paper,12pt,oneside]{report}
\usepackage{fullpage} % megalitara margin gia tex
\usepackage{algorithm} % gia tis listes graph and diagram
%\usepackage{amsmath} % is loaded by "mathtools" package
\usepackage{eqparbox,xparse}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{indentfirst}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{threeparttable}
\usepackage{lscape}
\usepackage{scalefnt}
%\usepackage{graphicx} % is loaded by "rotating" package
\usepackage{float}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage[skip=0.333\baselineskip]{caption} % <-- new
\begin{document}
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blahh
\begin{center}
\rotatebox{90}{%
\begin{threeparttable}
\captionof{table}{ble ble ble}
\begin{tabular}{@{} *{7}{l} @{}}
\toprule
A & B & C & D\tnote{*} & E & F & G \\
\bottomrule
\end{tabular}
\smallskip\footnotesize
\begin{tablenotes}[para,flushleft]
Notes:
\item[*] bli bli bli
\end{tablenotes}
\end{threeparttable}
}% end of scope of \rotatebox directive
\end{center}
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
blah blahh
\end{document}