儘管有足夠的空間,乳膠桌沒有出現在我放置的地方

儘管有足夠的空間,乳膠桌沒有出現在我放置的地方

我有以下問題:我想在論文的附錄中插入一個表格。我使用命令 /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環境,所以我將其保留在代碼中。

相關內容