尽管有足够的空间,但 Latex Table 并未出现在我放置的位置

尽管有足够的空间,但 Latex Table 并未出现在我放置的位置

我遇到了以下问题:我想在论文的附录中插入一个表格。我使用命令 /newpage 开始附录的部分,我希望表格出现在新页面上。表格不是很大,但 Latex 不知何故将其移到了新页面,因此它不会出现在我希望它出现的位置。我恳请您帮助,以便表格直接出现在子部分的标题之后,而不是出现在下一页。

这是我的文档的一些基本代码:


\documentclass[12pt,a4paper,titlepage]{article} % give the document type
\input{01_layout} %the command 'include' loads the corresponding file, alternatively, this file can be inserted here.

% ========================================================================================================

%List of graphics;

\graphicspath{{graphics/}} % this is the path for graphics (insert your graphics in this folder)
\makeindex
% ========================================================================================================
\begin{document} % start of the document
.
.
.
.
\newpage
\include{appendix} % include the appendix file
\newpage

附录文件如下:

% Appendix
\newpage
\begin{appendix}
\section{Appendix}
.
.
.
.

\newpage
\subsection{Empirical Results}
\label{emp_res_app}
\subsubsection{In-Sample Correlations}
\label{samp_corr_app}
\input{tables/corr_table}
\end{appendix}
\newpage

最后,这是我的表格的代码:

\begin{sidewaystable}[!htbp] 
\centering 
\begin{threeparttable} 
\caption{Cross-Sectional Correlations} \label{corr_table} 
\setlength\tabcolsep{1.5pt} 
\begin{tabular}{lccccccccccc} 
\toprule \toprule 
{} & $Earn$ & $d^{+}$ & $d^{-}$ & $BkEq$ & $TACC$ & $OCF$ & $SPI$ & $LEV$ & $PAYOUT$ & $PAYER$   \\ \midrule $Earn$ & 1.0*** & 0.55*** & -0.55*** & 0.61*** & -0.08*** & 0.72*** & -0.1*** & 0.04*** & 0.47*** & 0.38*** \\
 $d^{+}$ & 0.55*** & 1.0*** & -1.0*** & 0.33*** & 0.01* & 0.37*** & -0.02*** & 0.02*** & 0.25*** & 0.35*** \\
 $d^{-}$ & -0.55*** & -1.0*** & 1.0*** & -0.33*** & -0.01* & -0.37*** & 0.02*** & -0.02*** & -0.25*** & -0.35*** \\
 $BkEq$ & 0.61*** & 0.33*** & -0.33*** & 1.0*** & -0.38*** & 0.67*** & -0.1*** & 0.03*** & 0.44*** & 0.39*** \\
 $TACC$ & -0.08*** & 0.01* & -0.01* & -0.38*** & 1.0*** & -0.72*** & 0.06*** & -0.09*** & -0.25*** & -0.18*** \\
 $OCF$ & 0.72*** & 0.37*** & -0.37*** & 0.67*** & -0.72*** & 1.0*** & -0.11*** & 0.09*** & 0.49*** & 0.39*** \\
 $SPI$ & -0.1*** & -0.02*** & 0.02*** & -0.1*** & 0.06*** & -0.11*** & 1.0*** & -0.05*** & -0.06*** & -0.04*** \\
 $LEV$ & 0.04*** & 0.02*** & -0.02*** & 0.03*** & -0.09*** & 0.09*** & -0.05*** & 1.0*** & 0.07*** & 0.06*** \\
 $PAYOUT$ & 0.47*** & 0.25*** & -0.25*** & 0.44*** & -0.25*** & 0.49*** & -0.06*** & 0.07*** & 1.0*** & 0.64*** \\
 $PAYER$ & 0.38*** & 0.35*** & -0.35*** & 0.39*** & -0.18*** & 0.39*** & -0.04*** & 0.06*** & 0.64*** & 1.0*** \\
\bottomrule 
\end{tabular} 
\begin{tablenotes} \small \item \textbf{Table \ref{corr_table}} displays Pearson correlations for the entire sample, i.e. the pooled cross-section of firms from 1988 to 2021 including all variables of the forecast models for the conditional first and second moment of future earnings. However, in order to conserve space, all interacted variables as well as the industry dummies are omitted in this table.\end{tablenotes} 
\end{threeparttable} 
\end{sidewaystable}```

答案1

该环境sidewaystable是浮动环境。此类浮动通常由 LaTeX 自动定位在页面顶部或底部。如果两者都不适合,则将它们放置在新页面上。

您使用的threepartstable已经很好地处理了诸如标题之类的内容,如果不将其放置在浮动中,可能会导致一些问题。简而言之,如果您不想让内容表现得像浮动,请不要将它们放置在浮动环境中。

因此,我建议您将桌子放在旋转 90 度的盒子里:

\documentclass[12pt,a4paper,titlepage]{article} 
\usepackage[margin=25mm]{geometry} % with the default margins, the table would not fit
\usepackage{rotating}
\usepackage{threeparttable}
\usepackage{booktabs}

\begin{document}

\begin{appendix}
\section{Appendix}
\subsection{Empirical Results}
\label{emp_res_app}
\subsubsection{In-Sample Correlations}
\label{samp_corr_app}
{\centering\rotatebox{90}{%
\begin{threeparttable} 
\caption{Cross-Sectional Correlations} \label{corr_table} 
\setlength\tabcolsep{1.5pt} 
\begin{tabular}{lccccccccccc} 
\toprule \toprule 
{} & $Earn$ & $d^{+}$ & $d^{-}$ & $BkEq$ & $TACC$ & $OCF$ & $SPI$ & $LEV$ & $PAYOUT$ & $PAYER$   \\ \midrule $Earn$ & 1.0*** & 0.55*** & -0.55*** & 0.61*** & -0.08*** & 0.72*** & -0.1*** & 0.04*** & 0.47*** & 0.38*** \\
 $d^{+}$ & 0.55*** & 1.0*** & -1.0*** & 0.33*** & 0.01* & 0.37*** & -0.02*** & 0.02*** & 0.25*** & 0.35*** \\
 $d^{-}$ & -0.55*** & -1.0*** & 1.0*** & -0.33*** & -0.01* & -0.37*** & 0.02*** & -0.02*** & -0.25*** & -0.35*** \\
 $BkEq$ & 0.61*** & 0.33*** & -0.33*** & 1.0*** & -0.38*** & 0.67*** & -0.1*** & 0.03*** & 0.44*** & 0.39*** \\
 $TACC$ & -0.08*** & 0.01* & -0.01* & -0.38*** & 1.0*** & -0.72*** & 0.06*** & -0.09*** & -0.25*** & -0.18*** \\
 $OCF$ & 0.72*** & 0.37*** & -0.37*** & 0.67*** & -0.72*** & 1.0*** & -0.11*** & 0.09*** & 0.49*** & 0.39*** \\
 $SPI$ & -0.1*** & -0.02*** & 0.02*** & -0.1*** & 0.06*** & -0.11*** & 1.0*** & -0.05*** & -0.06*** & -0.04*** \\
 $LEV$ & 0.04*** & 0.02*** & -0.02*** & 0.03*** & -0.09*** & 0.09*** & -0.05*** & 1.0*** & 0.07*** & 0.06*** \\
 $PAYOUT$ & 0.47*** & 0.25*** & -0.25*** & 0.44*** & -0.25*** & 0.49*** & -0.06*** & 0.07*** & 1.0*** & 0.64*** \\
 $PAYER$ & 0.38*** & 0.35*** & -0.35*** & 0.39*** & -0.18*** & 0.39*** & -0.04*** & 0.06*** & 0.64*** & 1.0*** \\
\bottomrule 
\end{tabular} 
\begin{tablenotes} \small \item \textbf{Table \ref{corr_table}} displays Pearson correlations for the entire sample, i.e. the pooled cross-section of firms from 1988 to 2021 including all variables of the forecast models for the conditional first and second moment of future earnings. However, in order to conserve space, all interacted variables as well as the industry dummies are omitted in this table.\end{tablenotes} 
\end{threeparttable} 
}\par}

Bla bla
\end{appendix}

\end{document}

在此处输入图片描述

(在您加载包的情况下graphicx,您不需要加载rotating包即可使上述操作起作用。我只是假设您加载了rotating包,因为这个包提供了sidewaystable环境,所以我将它保留在代码中。)

相关内容