使用 siunitx 语法对表格中的小数点进行对齐时,数学语法不起作用

使用 siunitx 语法对表格中的小数点进行对齐时,数学语法不起作用

我遇到了以下问题:数学语法不适用于表格中第二行的标签 h=1、h=3、h=6。我该如何修复?

这是我的代码。谢谢

答案1

这是表格的一部分。我tabularx在最后一列使用了自动换行符,threeparttablex用于表格注释的格式,添加了一些sisetup选项并删除了不必要的\multicolumn命令以及空行。现在由您来调整表格的其余部分。

在此处输入图片描述

\documentclass{article}
\usepackage{geometry}
\usepackage{pdflscape}
\usepackage{booktabs}\usepackage{siunitx}
\usepackage{multirow}
\newcommand*{\SuperScriptSameStyle}[1]{% 
\ensuremath{% 
\mathchoice {{}^{\displaystyle #1}}% 
{{}^{\textstyle #1}}% 
{{}^{\scriptstyle #1}}% 
{{}^{\scriptscriptstyle #1}}%
 }% 
 } 
\newcommand*{\oneS}{\SuperScriptSameStyle{*}} 
\newcommand*{\twoS}{\SuperScriptSameStyle{**}} 
\newcommand*{\threeS}{\SuperScriptSameStyle{*{*}*}}
\usepackage{tabularx}
\usepackage[flushleft, para, referable]{threeparttablex}
\setTableNoteFont{\itshape}
\begin{document}

\begin{landscape}
\begin{table}[htbp]
\begin{threeparttable}
\centering
\sisetup{
    table-align-text-pre     = false,
    table-align-text-post    = false,
    input-open-uncertainty   = ,
    input-close-uncertainty  = ,
    table-space-text-post    = \threeS,
    table-space-text-pre     = {(},
    parse-numbers = false,
}


\caption{RMSFE for $h=1, h=3$ and $h=6$ Step-Ahead Forecasts of $\Delta UR_{t}$}
 \begin{tabularx}{\linewidth}{ll*{3}{S[table-format=2.4]}X}
 \toprule
       &       & \multicolumn{3}{c}{RMSFE} &  \\
\cmidrule{3-5}  
       &       & \multicolumn{3}{c}{Forecast Horizon} &  \\
 Variable & Model & {$h=1$}   &  {$h=3$}   & {$h=6$}   &  Details \\
 \midrule
 $\Delta UR_{t}$ & AR$(BIC)$ & 0.1750 & 0.1996 & 0.2346 &  $h$-step ahead forecasts with AR model in $\Delta UR_{t}$, lags determined by $BIC$ \\
       &       &       &       &       &  \\ \addlinespace
 $\Delta UR_{t}$, $\Delta G1_{t}$ & VAR$(BIC)$ & 0.1613\oneS & 0.1606\oneS & 0.1816\twoS &  \multirow[t]{2}{=}{$\Delta UR_{t}$ $h$-step-ahead forecasts with VAR model in $\Delta UR_{t}$ and $\Delta G1_{t}$, lags determined by $BIC$} \\
       &       & [1.8387] & [1.8416] & [2.0047] &   \\

 \bottomrule
 \end{tabularx}%
 \begin{tablenotes}
 \note Critical values of the DM test: $10\% = 1.64, 5\% =1.96$ and $1\% = 2.34$. \newline DM test statistics are given in the brackets, asteriks indicate significance at: \oneS 10\%, \twoS 5\% and \threeS 1\%
 \end{tablenotes}
 \end{threeparttable}
\end{table}%
\end{landscape}

\end{document}

相关内容