Латексный стол не появляется там, где я его поставил, хотя места достаточно

Латексный стол не появляется там, где я его поставил, хотя места достаточно

У меня следующая проблема: я хочу вставить таблицу в приложение к своей статье. Я использовал команду /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среду, поэтому я сохранил его в коде.)

Связанный контент