关于如何在不使用 \phantom{-} 的情况下对齐负数和正数有什么建议吗?

关于如何在不使用 \phantom{-} 的情况下对齐负数和正数有什么建议吗?

你们中有人对如何在不使用 \phantom{-} 的情况下对齐下表中的负数和正数有什么建议吗?

\documentclass[paper=a4, pagesize, fontsize=12pt]{scrartcl}



\usepackage{geometry}
\geometry{a4paper,left=25mm,right=25mm, top=25mm, bottom=25mm}
  \usepackage[utf8]{inputenc}  
  \usepackage[T1]{fontenc}       
  \usepackage[ngerman]{babel}    

 \usepackage{mathptmx}
\usepackage{float}

 \setkomafont{caption}{\rmfamily\bfseries\boldmath}
 \usepackage[font=small,labelfont=bf]{caption}

 
 \usepackage[nodisplayskipstretch]{setspace}
 \setstretch{1.3}

  \setkomafont{captionlabel}{\small\sffamily\bfseries} % kleinere Beschriftungen
 
 \renewcommand{\arraystretch}{1}     

      
  \begin{table}[H]
    \centering
    \caption{Infit und Outfit Indices für UEBE, SOUE, ERDR, UNZU und UEFO}
    \label{tab:infit-outfit}
    \setlength{\tabcolsep}{0pt}
    \footnotesize{
        \begin{tabular*}{0.75\textwidth}{
                @{\extracolsep{\fill}}% fill the space between columns
                l % one left aligned column
                *{5}{c}
            }
            \toprule
            Item    & \multicolumn{5}{c}{uPCM} \\
            
            \cmidrule{2-6} % \cmidrule{7-11}
            & {outfit MSQ}&{t} & {infit MSQ}& {t} & {p}\\ \toprule 
            \emph{UEBE} &&&&&\\ 
            \addlinespace
            TICS 1&1.55&4.98&1.53& 5.27& <.001\\
            TICS 4&1.07&0.74&1.03& 0.31&.21\\ 
            TICS 17&0.65&-4.28&0.67& -4.20&.99\\
            TICS 27&1.50&4.57& 1.42&4.34&<.001\\ 
            TICS 38&1.74&-3.21& 0.71&-3.70&.99\\
            TICS 44&0.57&-5.51& 0.59&-5.45&.99\\
            TICS 50&0.61&-5.10& 0.62&-5.07&.99\\ 
            TICS 54&0.59& -5.14& 0.59&-5.42&.99\\ 
            \midrule 
            \emph{SOUE} &&&&&\\ 
            \addlinespace
            TICS 7 &1.12&1.34&1.12&1.46&.08\\
            TICS 19 &0.78&-2.58&0.77&-2.82&.99\\
            TICS 28&0.72&-3.42&0.74&-3.21&.99\\ 
            TICS 39 &0.94&-3.83&0.68&-4.28&.99\\
            TICS 49&0.94&-0.60&0.95&-0.52&.71\\ 
            TICS 57 &0.87&-1.50&0.89&-1.34&.93\\ 
            \midrule 
            \emph{ERDR}&&&&&\\  
            \addlinespace
            TICS 8  &0.97&-0.29&0.96&-0.48&.60\\ 
            TICS 12 &1.04&0.48&1.05&0.53&.30\\ 
            TICS 14 &0.83&-2.00&0.84&-1.99&.98\\ 
            TICS 22 &0.90&-1.18&0.86&-1.67&.87\\ 
            TICS 23 &0.71&-3.63&0.68&-4.22&.99\\ 
            TICS 30 &0.95&-0.58&0.96&-0.42&.70\\ 
            TICS 32 &0.84&-1.87&0.88&-1.41&.97\\ 
            TICS 40 &0.86&-1.69&0.84&-2.02&.95\\ 
            TICS 43 &1.12&1.30&1.03&0.40&.09\\ \midrule
            \emph{UNZU} &&&&&\\ 
            \addlinespace
            TICS 5 &0.92&-0.97&0.92&-0.96&.81\\ 
            TICS 10 &0.84&-1.91&0.84&-1.93&.97\\ 
            TICS 13&0.74&-3.14&0.74&-3.23&.99\\
            TICS 21&0.75&-3.14&0.74&-3.23&.99\\
            TICS 37&1.14&1.26&1.13&1.31&.06\\
            TICS 41&1.09&0.95&1.06&0.68&.15\\
            TICS 48&1.01&0.14&0.99&-0.13&.43\\
            TICS 53 &0.67&-4.12&0.69&-3.92&.99\\ \midrule 
            
            \emph{UEFO} &&&&&\\ 
            \addlinespace
            TICS 3 &1.04&0.39&1.01&0.12&.32\\ 
            TICS 20 &0.84&-1.70&0.83&-1.74&.97\\ 
            TICS 24&0.83&-1.83&0.91&-1.00&.98\\
            TICS 35&0.67&-3.98&0.65&-4.08&.99\\
            TICS 47&0.98&-0.20&0.93&-0.86&.56\\
            TICS 55&0.75&-2.85&0.73&-3.14&.99\\ 
            \bottomrule 
        \end{tabular*}
    }
    \scriptsize{
    \begin{tablenotes}
        \item Infit und Outfit Indices basieren auf Schätzungen separater eindimensionaler Partial Credit Modelle pro Subskala
        
        \item Der t-Wert in Spalte drei bezieht sich auf den Outfit, der t-Wert in Spalte 5 auf den Infit
        
        \item uPCM: unidimensionales Partial Credit Modell; UEBE: Arbeitsüberlastung; SOUE: Soziale Überlastung; ERDR: Erfolgsdruck;
        
        \item UNZU: Arbeitsunzufriedenheit; UEFO: Überforderung
  \end{tablenotes}} 

谢谢你,祝你一切顺利,莉莉

答案1

您可以使用S的列类型来执行此操作siunitx。我完成了您的代码,以便可以编译。

\documentclass[paper=a4, pagesize, fontsize=12pt]{scrartcl}

\usepackage{booktabs, threeparttable}
\usepackage{siunitx, array}

\usepackage{geometry}
\geometry{a4paper,left=25mm,right=25mm, top=25mm, bottom=25mm}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage[ngerman]{babel}

 \usepackage{mathptmx}
\usepackage{float}

 \setkomafont{caption}{\rmfamily\bfseries\boldmath}
 \usepackage[font=small,labelfont=bf]{caption}


 \usepackage[nodisplayskipstretch]{setspace}
 \setstretch{1.3}

  \setkomafont{captionlabel}{\small\sffamily\bfseries} % kleinere Beschriftungen

 \renewcommand{\arraystretch}{1}

\begin{document}

  \begin{table}[H]
    \centering
\begin{threeparttable}
    \caption{Infit und Outfit Indices für UEBE, SOUE, ERDR, UNZU und UEFO}
    \label{tab:infit-outfit}
    \setlength{\tabcolsep}{0pt}
    \footnotesize
        \begin{tabular*}{0.75\textwidth}{
                @{\extracolsep{\fill}}% fill the space between columns
                l % one left aligned column
                *{2}{S[table-format=1.2]S[table-format=-1.2]}S[table-format=0.3,table-space-text-pre=$<{}$]}
                       \toprule
            Item & \multicolumn{5}{c}{uPCM} \\

            \cmidrule{2-6} % \cmidrule{7-11}
            & {outfit MSQ}&{t} & {infit MSQ}& {t} & {p}\\ \toprule
            \emph{UEBE} &&&&&\\
            \addlinespace
            TICS 1&1.55&4.98&1.53& 5.27& {$<{}$}.001\\
            TICS 4&1.07&0.74&1.03& 0.31&.21\\
            TICS 17&0.65&-4.28&0.67& -4.20&.99\\
            TICS 27&1.50&4.57& 1.42&4.34&{$<{}$}.001\\
            TICS 38&1.74&-3.21& 0.71&-3.70&.99\\
            TICS 44&0.57&-5.51& 0.59&-5.45&.99\\
            TICS 50&0.61&-5.10& 0.62&-5.07&.99\\
            TICS 54&0.59& -5.14& 0.59&-5.42&.99\\
            \midrule
            \emph{SOUE} &&&&&\\
            \addlinespace
            TICS 7 &1.12&1.34&1.12&1.46&.08\\
            TICS 19 &0.78&-2.58&0.77&-2.82&.99\\
            TICS 28&0.72&-3.42&0.74&-3.21&.99\\
            TICS 39 &0.94&-3.83&0.68&-4.28&.99\\
            TICS 49&0.94&-0.60&0.95&-0.52&.71\\
            TICS 57 &0.87&-1.50&0.89&-1.34&.93\\
            \midrule
            \emph{ERDR}&&&&&\\
            \addlinespace
            TICS 8 &0.97&-0.29&0.96&-0.48&.60\\
            TICS 12 &1.04&0.48&1.05&0.53&.30\\
            TICS 14 &0.83&-2.00&0.84&-1.99&.98\\
            TICS 22 &0.90&-1.18&0.86&-1.67&.87\\
            TICS 23 &0.71&-3.63&0.68&-4.22&.99\\
            TICS 30 &0.95&-0.58&0.96&-0.42&.70\\
            TICS 32 &0.84&-1.87&0.88&-1.41&.97\\
            TICS 40 &0.86&-1.69&0.84&-2.02&.95\\
            TICS 43 &1.12&1.30&1.03&0.40&.09\\ \midrule
            \emph{UNZU} &&&&&\\
            \addlinespace
            TICS 5 &0.92&-0.97&0.92&-0.96&.81\\
            TICS 10 &0.84&-1.91&0.84&-1.93&.97\\
            TICS 13&0.74&-3.14&0.74&-3.23&.99\\
            TICS 21&0.75&-3.14&0.74&-3.23&.99\\
            TICS 37&1.14&1.26&1.13&1.31&.06\\
            TICS 41&1.09&0.95&1.06&0.68&.15\\
            TICS 48&1.01&0.14&0.99&-0.13&.43\\
            TICS 53 &0.67&-4.12&0.69&-3.92&.99\\ \midrule

            \emph{UEFO} &&&&&\\
            \addlinespace
            TICS 3 &1.04&0.39&1.01&0.12&.32\\
            TICS 20 &0.84&-1.70&0.83&-1.74&.97\\
            TICS 24&0.83&-1.83&0.91&-1.00&.98\\
            TICS 35&0.67&-3.98&0.65&-4.08&.99\\
            TICS 47&0.98&-0.20&0.93&-0.86&.56\\
            TICS 55&0.75&-2.85&0.73&-3.14&.99\\
            \bottomrule
        \end{tabular*}
       \scriptsize
    \begin{tablenotes}[flushleft]
        \item Infit und Outfit Indices basieren auf Schätzungen separater eindimensionaler Partial Credit Modelle pro Subskala

        \item Der t-Wert in Spalte drei bezieht sich auf den Outfit, der t-Wert in Spalte 5 auf den Infit

        \item uPCM: unidimensionales Partial Credit Modell; UEBE: Arbeitsüberlastung; SOUE: Soziale Überlastung; ERDR: Erfolgsdruck;

        \item UNZU: Arbeitsunzufriedenheit; UEFO: Überforderung
  \end{tablenotes}
\end{threeparttable}
\end{table}

  \end{document} 

编辑:正如@egreg 所指出的,使用H来放置此表并不安全:它可能会溢出底部边距。如果您确实需要将其插入到编写代码的确切位置,请使用,它将的xltabular功能带入,以便它可以跨页中断,并使用 替换,这在环境中不起作用(请注意,它的语法略有不同)。longtabletabularxthreeparttablelongtableThreePartTablethreeparttablex

在此处输入图片描述

相关内容