使用 siunitx 重叠括号

使用 siunitx 重叠括号

我正在尝试生成一个带有标准化 beta、显著性星号以及标准误差 (SE) 的长表。我希望数字以 2 的精度(小数点后的数字)进行舍入。在我的输入中,我在括号中写了 SE。现在我尝试使用 siunitx 包对这些数字进行舍入,不幸的是,这会导致括号与数字产生奇怪的重叠。这是我的工作示例:

\documentclass[10pt,ngerman,english]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{multirow,booktabs,setspace,caption}
\usepackage{tikz}
\usepackage{soul}
\usepackage{caption}
\usepackage{tabularx}
\usepackage{threeparttable}
\usepackage{float}

\pagestyle{empty}

\DeclareCaptionLabelSeparator*{spaced}{\\[2ex]}
\captionsetup[table]{textfont=it,format=plain,justification=justified,
  singlelinecheck=false,labelsep=spaced,skip=0pt}
\captionsetup[figure]{labelsep=period,labelfont=it,justification=justified,
  singlelinecheck=false,font=doublespacing}
  
\begin{document}

\sisetup{detect-mode,
        tight-spacing           = true,
        group-digits            = false,
        input-signs             = + -,
        input-open-uncertainty  = ,
        input-close-uncertainty = ,
        round-mode              = places,
        table-number-alignment  = center,
        round-precision         = 2,
        add-integer-zero        = false}
    
\captionsetup{width=.75\textwidth}
\begin{longtable}{l*{6}{S[table-format=0.3]}}
            
%%% headers and footers
\caption{This is my caption}\\
\toprule
& \multicolumn{2}{c}{Model 1} & 
  \multicolumn{2}{c}{Model 2} & 
  \multicolumn{2}{c}{Model 3} \\ 

\cmidrule(l){2-7}

&\multicolumn{2}{c}{\textit{Stand.Coeff.(SE)}} & 
 \multicolumn{2}{c}{\textit{Stand.Coeff.(SE)}} & 
 \multicolumn{2}{c}{\textit{Stand.Coeff.(SE)}} \\ 
\midrule
\endfirsthead

\multicolumn{7}{l@{}}{\footnotesize (cont'd on following page)}\\
\endfoot

\bottomrule
\multicolumn{7}{@{}l}{$^+$ Fixed parameter}
\endlastfoot\\

%%% body of longtable
&\multicolumn{6}{c}{\textbf{Factor Loadings}}\\
  \multicolumn{7}{l}{\textbf{CONSTRUCT 1}}\\
     \hspace {.25cm}Variable 1              & .610*** & (.091) & .570*** & (.093) & .590*** &(.102)\\
     \hspace {.25cm}Variable 2              & .610*** & (.091) & .570*** & (.093) & .590*** &(.102)\\
     \hspace {.25cm}Variable 3              & .610*** & (.091) & .570*** & (.093) & .590*** &(.102)\\
     
\end{longtable}
\end{document}

在此处输入图片描述

提前致谢。

答案1

大部分都是题外话,但无论如何......我会按照以下方式编写您的表格:

\documentclass[10pt,ngerman,english]{article}
\usepackage{geometry}
\usepackage{siunitx}
\usepackage{booktabs, longtable, multirow, tabularx, threeparttable}
\usepackage{caption}
\captionsetup[table]{skip=1ex,
                     labelsep=newline,  
                     textfont=it, justification=justified,
                     singlelinecheck=false}
\captionsetup[figure]{labelsep=period, labelfont=it,justification=justified,
                      singlelinecheck=false,
                      font=doublespacing}% why?
\NewExpandableDocumentCommand\mcc{O{1}m}{\multicolumn{#1}{c}{#2}}
\NewExpandableDocumentCommand\mcl{O{1}m}{\multicolumn{#1}{l}{#2}}
\NewExpandableDocumentCommand\mcr{O{1}m}{\multicolumn{#1}{r}{#2}}

\pagestyle{empty}
\begin{document}

\sisetup{add-integer-zero        = false,
         input-signs             = + -,
         input-open-uncertainty  = ,
         input-close-uncertainty = ,
         round-mode              = places,
         round-precision         = 2,
         table-format            = 0.2,
        }

\begin{longtable}{ll*{3}{@{\qquad}
                         S[table-space-text-post=***]
                         S[table-space-text-pre=(,
                           table-space-text-post=)]}
                 }
\captionsetup{margin=22mm} % <---- set manually after three compilation
%%% headers and footers
\caption{This is my caption}
\label{tab:longtable}                                                       \\
    \toprule
    && \mcc[6]{\emph{Standard Coefficients (SE)}}                           \\ 
    \cmidrule(l){3-8}  
    && \mcc[2]{Model 1}
            &  \mcc[2]{Model 2}
                    &   \mcc[2]{Model 3}                                    \\
    \cmidrule(l){3-4}
    \cmidrule(l){5-6}
    \cmidrule(l){7-8}
\endfirsthead
\caption[]{This is my caption}                                              \\
    \toprule
    && \mcc[6]{\emph{Standard Coefficients (SE)}}                           \\
    \cmidrule(l){3-8}
    && \mcc[2]{Model 1}
            &  \mcc[2]{Model 2}
                    &   \mcc[2]{Model 3}                                    \\
    \cmidrule(l){3-4}
    \cmidrule(l){5-6}
    \cmidrule(l){7-8}
    \bottomrule
\endhead
    \bottomrule
    \mcl[8]{$^+$ Fixed parameter}                                           \\
    \mcr[8]{\footnotesize (cont'd on following page)}                       \\
\endfoot
    \midrule[\heavyrulewidth]
    \mcl[8]{$^+$ Fixed parameter}                                           \\
\endlastfoot
%%% body of longtable
    && \mcc[6]{\textbf{Factor Loadings}}                                    \\
    \midrule
\mcl[8]{\textbf{CONSTRUCT 1}}                                               \\
    & Variable 1 & .610*** & (.091) & .570*** & (.093) & .590*** & (.102)   \\
    & Variable 2 & .610*** & (.091) & .570*** & (.093) & .590*** & (.102)   \\
    & Variable 3 & .610*** & (.091) & .570*** & (.093) & .590*** & (.102)   \\
\end{longtable}
\end{document}

在此处输入图片描述

相关内容