Die Latex-Tabelle wird nicht dort angezeigt, wo ich sie platziert habe, obwohl genügend Platz vorhanden ist

Die Latex-Tabelle wird nicht dort angezeigt, wo ich sie platziert habe, obwohl genügend Platz vorhanden ist

Ich habe folgendes Problem: Ich möchte in den Anhang meiner Arbeit eine Tabelle einfügen. Mit dem Befehl /newpage habe ich den Abschnitt des Anhangs, in dem die Tabelle erscheinen soll, auf einer neuen Seite begonnen. Die Tabelle ist zwar nicht so groß, aber Latex verschiebt sie irgendwie auf eine neue Seite, so dass sie nicht dort erscheint, wo ich sie haben möchte. Ich bitte höflich um etwas Hilfe, damit die Tabelle direkt nach der Überschrift des Unterabschnitts erscheint und nicht auf der nächsten Seite.

Dies ist ein grundlegender Code für mein Dokument:


\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

Und die Anhangsdatei sieht wie folgt aus:

% 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

Und schließlich ist dies der Code für meine Tabelle:

\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}```

Antwort1

Bei der Umgebung sidewaystablehandelt es sich um eine Floating-Umgebung. Solche Floats werden von LaTeX typischerweise automatisch am oberen oder unteren Rand einer Seite platziert. Passt beides nicht, werden sie auf einer neuen Seite platziert.

Sie verwenden eine threepartstable, die Dinge wie Untertitel bereits gut handhabt, was jedoch zu Problemen führen kann, wenn sie nicht in einem Float platziert wird. Kurz gesagt, wenn Sie nicht möchten, dass sich Dinge wie ein Float verhalten, platzieren Sie sie nicht in einer Floating-Umgebung.

Daher würde ich vorschlagen, dass Sie Ihre Tabelle einfach in eine um 90 Grad gedrehte Box stellen:

\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}

Bildbeschreibung hier eingeben

(Im wahrscheinlichen Fall, dass Sie das graphicxPaket laden, müssen Sie das rotatingPaket nicht laden, damit das oben genannte funktioniert. Ich bin einfach davon ausgegangen, dass Sie das rotatingPaket laden, da dieses Paket die Umgebung bereitstellt sidewaystable, also habe ich es im Code belassen.)

verwandte Informationen