关于sidewaystable的几个问题

关于sidewaystable的几个问题

所以我一直在为这个表格而苦恼,首先,标题对于 toprule 来说太长了,我无法让它在第一行显示“表格 x”,然后在第二行显示标题文本。其次,我想缩小它,因为它有点太大了。第三,我想要一种方法来在下方添加信息\bottomrule。这是我的包和表格-

\usepackage{eqnarray}
\usepackage{amsmath}
%\usepackage{showframe}
\usepackage{breqn}
\usepackage{natbib}
\usepackage{rotating}
\usepackage{booktabs}

\begin{document}



\setcounter{table}{2}
\begin{sidewaystable}[h]
        \caption{Unextrapolated prices of American put options $(K = \$ 100, T = 3.0{\kern 1pt} \ \text{years}, \sigma  = 0.2, r = 0.08)$}
        \centering
        \begin{tabular}{@{}ccccccccc}
        \toprule
        $(S_0, \delta)$ & True & H2 & H4 & H6 & EP1 & EP2 & EP3\\
        \toprule
        (80, 0.12)& 25.6577& 25.3230& 25.5499& 25.6087& 25.6404& 25.6543 & 25.6564\\
        (90, 0.12)& 20.0832& 19.8723& 20.0010& 20.0429& 20.0679& 20.0805 & 20.0821\\
        (100, 0.12)& 15.4981& 15.3623& 15.4412& 15.4688& 15.4867& 15.4964& 15.4976\\
        (110, 0.12)& 11.8032& 11.7170& 11.7655& 11.7827& 11.7949& 11.8017& 11.8026\\
        (120, 0.12)& 8.8856& 8.8324& 8.8612& 8.8718& 8.8799& 8.8844& 8.8850\\
        (80, 0.08)& 22.2050& 21.5703& 22.2163& 22.2967& 22.1650& 22.1916& 22.1983\\
        (90, 0.08)& 16.2071& 15.9365& 16.2288& 16.2538& 16.1473& 16.1882& 16.1977\\
        (100, 0.08)& 11.7037& 11.5394& 11.6880& 11.7147& 11.6417& 11.6840& 11.6938\\
        (110, 0.08)& 8.3671& 8.2370& 8.3353& 8.3623& 8.3122& 8.3488& 8.3574\\
        (120, 0.08)& 5.9299& 5.8224& 5.8971& 5.9192& 5.8857& 5.9142& 5.9214\\
        (80, 0.04)& 20.3500& 18.8206& 20.1777& 20.4122& 20.3379& 20.3447& 20.3469\\
        (90, 0.04)& 13.4968& 13.1947& 13.7667& 13.7612& 13.4459& 13.4781& 13.4866\\
        (100, 0.04)& 8.9438& 8.9527& 9.1426& 9.1053& 8.8747& 8.9197& 8.9308\\
        (110, 0.04)& 5.9119& 5.9368& 6.0075& 5.9956& 5.8435& 5.8876& 5.8985\\
        (120, 0.04)& 3.8975& 3.8829& 3.9342& 3.9389& 3.8394& 3.8761& 3.8854\\
        (80, 0.00)& 20.0000& 16.6525& 18.7463& 19.2411& 20.0000& 20.0000& 20.0000\\
        (90, 0.00)& 11.6974& 11.1602& 12.0365& 12.0819& 11.6729& 11.6878& 11.6919\\
        (100, 0.00)& 6.9320& 7.1356& 7.3556& 7.2640& 6.8832& 6.9145& 6.9225\\
        (110, 0.00)& 4.1550& 4.4050& 4.4077& 4.3392& 4.1020& 4.1362& 4.1447\\
        (120, 0.00)& 2.5102& 2.6586& 2.6376& 2.6079& 2.4646& 2.4938& 2.5010\\
        \bottomrule
        RMSE &  & 0.8593& 0.3260& 0.2239& 0.0437& 0.0151& 0.0081\\
        \hline
        CPU time &  & - & - & - & - & -  & - \\
        \bottomrule
        \end{tabular}
        \label{Unextrapolated}
\end{sidewaystable}
\end{Document}

在此处输入图片描述

答案1

这是一个解决方案,使用threeparttablecaption。我还添加了siunitx以确保小数点上的数字对齐。

\documentclass{article}

\usepackage{booktabs}
\usepackage{rotating, siunitx, caption, threeparttable}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}

\begin{document}
\setcounter{table}{2}
\begin{sidewaystable}[h]
\sisetup{table-format=2.4, table-number-alignment=center}
\captionsetup{format=hang, justification=centering}
\centering
\begin{threeparttable}[flushleft]
    \caption{Unextrapolated prices of American put options \\$(K = \$ 100, T = 3.0{\kern 1pt} \ \text{years}, \sigma = 0.2, r = 0.08)$}
    \begin{tabular}{@{}r*{7}{S}}
    \toprule
    \multicolumn{1}{c}{$(S_0, \delta)$} & {True} & {H2} & {H4} & {H6} & {EP1} & {EP2} & {EP3}\\
    \toprule
    (80, 0.12)& 25.6577& 25.3230& 25.5499& 25.6087& 25.6404& 25.6543 & 25.6564\\
    (90, 0.12)& 20.0832& 19.8723& 20.0010& 20.0429& 20.0679& 20.0805 & 20.0821\\
    (100, 0.12)& 15.4981& 15.3623& 15.4412& 15.4688& 15.4867& 15.4964& 15.4976\\
    (110, 0.12)& 11.8032& 11.7170& 11.7655& 11.7827& 11.7949& 11.8017& 11.8026\\
    (120, 0.12)& 8.8856& 8.8324& 8.8612& 8.8718& 8.8799& 8.8844& 8.8850\\
    (80, 0.08)& 22.2050& 21.5703& 22.2163& 22.2967& 22.1650& 22.1916& 22.1983\\
    (90, 0.08)& 16.2071& 15.9365& 16.2288& 16.2538& 16.1473& 16.1882& 16.1977\\
    (100, 0.08)& 11.7037& 11.5394& 11.6880& 11.7147& 11.6417& 11.6840& 11.6938\\
    (110, 0.08)& 8.3671& 8.2370& 8.3353& 8.3623& 8.3122& 8.3488& 8.3574\\
    (120, 0.08)& 5.9299& 5.8224& 5.8971& 5.9192& 5.8857& 5.9142& 5.9214\\
    (80, 0.04)& 20.3500& 18.8206& 20.1777& 20.4122& 20.3379& 20.3447& 20.3469\\
    (90, 0.04)& 13.4968& 13.1947& 13.7667& 13.7612& 13.4459& 13.4781& 13.4866\\
    (100, 0.04)& 8.9438& 8.9527& 9.1426& 9.1053& 8.8747& 8.9197& 8.9308\\
    (110, 0.04)& 5.9119& 5.9368& 6.0075& 5.9956& 5.8435& 5.8876& 5.8985\\
    (120, 0.04)& 3.8975& 3.8829& 3.9342& 3.9389& 3.8394& 3.8761& 3.8854\\
    (80, 0.00)& 20.0000& 16.6525& 18.7463& 19.2411& 20.0000& 20.0000& 20.0000\\
    (90, 0.00)& 11.6974& 11.1602& 12.0365& 12.0819& 11.6729& 11.6878& 11.6919\\
    (100, 0.00)& 6.9320& 7.1356& 7.3556& 7.2640& 6.8832& 6.9145& 6.9225\\
    (110, 0.00)& 4.1550& 4.4050& 4.4077& 4.3392& 4.1020& 4.1362& 4.1447\\
    (120, 0.00)& 2.5102& 2.6586& 2.6376& 2.6079& 2.4646& 2.4938& 2.5010\\
    \bottomrule
    RMSE & & 0.8593& 0.3260& 0.2239& 0.0437& 0.0151& 0.0081\\
    \hline
    CPU time & & {--- } &{---} & {---} & {---} & {---} & {---} \\
    \bottomrule
    \end{tabular}
    \begin{tablenotes}\footnotesize
     \item[] Some information
    \end{tablenotes}
            \label{Unextrapolated}
    \end{threeparttable}
    \end{sidewaystable}

\end{document} 

在此处输入图片描述

相关内容