为什么 sidewaystable 被推到下一页?

为什么 sidewaystable 被推到下一页?

我有以下代码 - 见下文。我希望 sidewaystable 位于同一页上,紧跟在“查看表格...”之后。在我看来,它足够小,可以容纳,但我不明白为什么它会将其推到下一页?...

\clearpage

\section{Annex}

\subsection{Title}

See table 2 and 3.

\begin{sidewaystable}[h]%[htbp]
%  \centering
  \caption{Caption}
    \begin{tabular}{rrrrrrrrrrrrrr}
    \multicolumn{1}{l}{Year} & \multicolumn{1}{l}{\makecell{Part of \\  year}} & \multicolumn{1}{l}{$\mu_X$} & \multicolumn{1}{l}{\textbf{$\sigma_X$}} & \multicolumn{1}{l}{$\kappa_X$} &\multicolumn{1}{l}{\makecell{Mean of\\historic\\$X_t$}} & \multicolumn{1}{l}{\makecell{Mean of\\simulated\\$X_t$}} & \multicolumn{1}{l}{\makecell{Mean of\\historic\\$S_{X_t}$}} & \multicolumn{1}{l}{\makecell{Mean of\\simulated\\$S_{X_t}$}} & \multicolumn{1}{l}{\makecell{SD of\\historic\\$S_{X_t}$}} & \multicolumn{1}{l}{\makecell{SD of\\simulated\\$S_{X_t}$}} & \multicolumn{1}{l}{\makecell{R2 of\\simulated\\$S_{X_t}$}} & \multicolumn{1}{l}{$\rho$} \\
    2008  & 1     & 0.55  & 193.30 & 182.00 & 0.00  & 0.14  & 60.87 & 61.01 & 14.19 & 12.35 & 69.90\% & 0.00\% \\
    2008  & 2     & -0.25 & 247.58 & 184.00 & 0.00  & -0.21 & 70.59 & 70.38 & 20.22 & 17.35 & 75.49\% & 3.04\%  \\
    2009  & 1     & 0.39  & 144.65 & 181.00 & 0.00  & 0.10  & 39.83 & 39.93 & 12.59 & 10.70 & 77.42\% & 2.92\% \\
    2009  & 2     & -0.25 & 192.90 & 184.00 & 0.00  & -0.06 & 37.89 & 37.83 & 11.03 & 7.40  & 47.67\% & 11.94\% \\
    2010  & 1     & 0.37  & 119.09 & 181.00 & 0.00  & 0.05  & 41.27 & 41.32 & 7.58  & 6.48  & 62.99\% & 11.69\%\\
    2010  & 2     & -0.19 & 114.65 & 184.00 & 0.00  & -0.15 & 47.65 & 47.50 & 8.79  & 7.08  & 66.86\% & 11.66\% \\
    2011  & 1     & 0.23  & 131.84 & 181.00 & 0.00  & 0.02  & 52.73 & 52.75 & 8.17  & 6.33  & 49.46\% & 15.30\% \\
    2011  & 2     & 0.03  & 112.46 & 184.00 & 0.00  & 0.01  & 49.54 & 49.55 & 8.18  & 6.43  & 64.14\% & 18.47\% \\
    2012  & 1     & 0.29  & 174.61 & 182.00 & 0.00  & 0.12  & 42.75 & 42.87 & 11.70 & 9.44  & 62.24\% & 34.16\% \\
    2012  & 2     & -0.26 & 206.15 & 184.00 & 0.00  & -0.07 & 42.45 & 42.38 & 13.87 & 9.48  & 51.14\% & 13.61\% \\
    2013  & 1     & 0.40  & 161.27 & 181.00 & 0.00  & 0.11  & 37.40 & 37.52 & 11.98 & 10.26 & 68.31\% & 20.99\% \\
    2013  & 2     & -0.06 & 168.71 & 184.00 & 0.00  & 0.01  & 38.15 & 38.16 & 11.00 & 8.20  & 57.18\% & 21.68\% \\
    2014  & 1     & 0.26  & 132.00 & 181.00 & 0.00  & 0.04  & 32.36 & 32.41 & 8.64  & 6.80  & 61.98\% & 3.48\% \\
    2014  & 2     & -0.04 & 123.57 & 184.00 & 0.00  & 0.01  & 33.16 & 33.16 & 8.83  & 6.59  & 56.44\% & 15.19\% \\
    2015  & 1     & 0.21  & 136.74 & 181.00 & 0.00  & 0.08  & 30.22 & 30.29 & 8.96  & 6.84  & 56.76\% & 1.00\% \\
    2015  & 2     & -0.01 & 130.51 & 184.00 & 0.00  & -0.06 & 33.01 & 32.95 & 8.73  & 6.64  & 56.55\% & 16.29\% \\
    2016  & 1     & 0.09  & 113.21 & 182.00 & 0.00  & 0.06  & 24.98 & 25.04 & 7.25  & 5.50  & 54.83\% & 14.31\% \\
    2016  & 2     & -0.06 & 119.54 & 145.00 & 0.00  & 0.02  & 31.59 & 31.34 & 7.68  & 5.69  & 41.06\% & 14.50\% \\
    \end{tabular}%
  \label{tab:addlabel}%
\end{sidewaystable}%

答案1

以下是对环境和便捷参数的破解sideways。我还使用以下内容改进了表格siunitx

\documentclass[12pt]{article}
\usepackage{rotating}
\usepackage[font=footnotesize]{caption}
\usepackage{booktabs, makecell, caption}
\usepackage{siunitx}
\usepackage[showframe, a4paper]{geometry}
\begin{document}

\clearpage

\section{Annex}
%
\subsection{Title}

See table 2 and 3.
\vfill
\begin{sideways}%
  \centering
  \sisetup{table-format=2.2, table-number-alignment=center}%
  \setlength{\tabcolsep}{4pt}
  \footnotesize%
  \rlap{\begin{minipage}{\textheight}
      \vspace*{2cm}
      \captionof{table}{Caption}%
      \begin{tabular}{ccS[table-format=-1.2]*{2}{S[table-format=3.2]}cS[table-format=-1.2]*{6 }{S}}%
        Year & Sem. & {\thead{$\mu_X$}} & {\boldmath$\sigma_X$} & \boldmath{$\kappa_X$} &
        {\makecell{Mean of \\historic\\$X_t$}} &{\makecell{Mean of\\simulated\\$X_t$}} & {\makecell{Mean of\\historic\\$S_{X_t}$}} &{\makecell{Mean of\\simulated\\$S_{X_t}$}} & {\makecell{SD of\\historic\\$S_{X_t}$}} & {\makecell{SD of\\simulated\\$S_{X_t}$}} & {\makecell{R2 of\\simulated\\$S_{X_t}$ (\%)}} & {$\rho$ (\%)} \\
        \addlinespace
        2008 & 1 & 0.55 & 193.30 & 182.00 & 0.00 & 0.14 & 60.87 & 61.01 & 14.19 & 12.35 & 69.90 & 0.00 \\
        2008 & 2 & -0.25 & 247.58 & 184.00 & 0.00 & -0.21 & 70.59 & 70.38 & 20.22 & 17.35 & 75.49 & 3.04 \\
        2009 & 1 & 0.39 & 144.65 & 181.00 & 0.00 & 0.10 & 39.83 & 39.93 & 12.59 & 10.70 & 77.42 & 2.92 \\
        2009 & 2 & -0.25 & 192.90 & 184.00 & 0.00 & -0.06 & 37.89 & 37.83 & 11.03 & 7.40 & 47.67 & 11.94 \\
        2010 & 1 & 0.37 & 119.09 & 181.00 & 0.00 & 0.05 & 41.27 & 41.32 & 7.58 & 6.48 & 62.99 & 11.69 \\
        2010 & 2 & -0.19 & 114.65 & 184.00 & 0.00 & -0.15 & 47.65 & 47.50 & 8.79 & 7.08 & 66.86 & 11.66 \\
        2011 & 1 & 0.23 & 131.84 & 181.00 & 0.00 & 0.02 & 52.73 & 52.75 & 8.17 & 6.33 & 49.46 & 15.30 \\
        2011 & 2 & 0.03 & 112.46 & 184.00 & 0.00 & 0.01 & 49.54 & 49.55 & 8.18 & 6.43 & 64.14 & 18.47 \\
        2012 & 1 & 0.29 & 174.61 & 182.00 & 0.00 & 0.12 & 42.75 & 42.87 & 11.70 & 9.44 & 62.24 & 34.16 \\
        2012 & 2 & -0.26 & 206.15 & 184.00 & 0.00 & -0.07 & 42.45 & 42.38 & 13.87 & 9.48 & 51.14 & 13.61 \\
        2013 & 1 & 0.40 & 161.27 & 181.00 & 0.00 & 0.11 & 37.40 & 37.52 & 11.98 & 10.26 & 68.31 & 20.99 \\
        2013 & 2 & -0.06 & 168.71 & 184.00 & 0.00 & 0.01 & 38.15 & 38.16 & 11.00 & 8.20 & 57.18 & 21.68 \\
        2014 & 1 & 0.26 & 132.00 & 181.00 & 0.00 & 0.04 & 32.36 & 32.41 & 8.64 & 6.80 & 61.98 & 3.48 \\
        2014 & 2 & -0.04 & 123.57 & 184.00 & 0.00 & 0.01 & 33.16 & 33.16 & 8.83 & 6.59 & 56.44 & 15.19 \\
        2015 & 1 & 0.21 & 136.74 & 181.00 & 0.00 & 0.08 & 30.22 & 30.29 & 8.96 & 6.84 & 56.76 & 1.00 \\
        2015 & 2 & -0.01 & 130.51 & 184.00 & 0.00 & -0.06 & 33.01 & 32.95 & 8.73 & 6.64 & 56.55 & 16.29 \\
        2016 & 1 & 0.09 & 113.21 & 182.00 & 0.00 & 0.06 & 24.98 & 25.04 & 7.25 & 5.50 & 54.83 & 14.31 \\
        2016 & 2 & -0.06 & 119.54 & 145.00 & 0.00 & 0.02 & 31.59 & 31.34 & 7.68 & 5.69 & 41.06 & 14.50 \\
      \end{tabular}%
      \label{tab:addlabel}%
      \vfill\null
    \end{minipage}}
\end{sideways}%

\end{document} 

在此处输入图片描述

相关内容