在横向页面上挤压表格

在横向页面上挤压表格

我试图将宽大的长表格横向压缩到多页上。由于表格比横向 A4 宽,所以两侧被切掉。此外,我收到以下错误消息:

! 未定义的控制序列。\Gm@detectdriver ...@setdriver {vtex}\fi \ifxetex \Gm@setdriver {xetex} \fi ...

这是我的代码。如果能提供任何关于如何解决这个问题的提示,我将不胜感激。

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{lscape}

\begin{document}
\begin{landscape}
\begin{longtable}{@{}r*{12}{S[table-format=3.2(3),
                            table-space-text-post = $^{+}$,
                            table-align-text-post = false]
                          S[table-format=1.2]
                          S[table-format=2.2]
                          S[table-format=1.3]}
                                      @{}}
\caption{SEM3}
\endfirsthead
\endhead
& \multicolumn{4}{c}{A \& N}& \multicolumn{4}{c}{A, N \& EM}& \multicolumn{4}{c}{A, N \& EM \& control}\tabularnewline  
\cmidrule(l){2-5}
\cmidrule(l){6-9}
\cmidrule(l){10-13}
& \multicolumn{1}{c}{Estimate}& \multicolumn{1}{c}{Std. Err.}& \multicolumn{1}{c}{z}& \multicolumn{1}{c}{p}& \multicolumn{1}{c}{Estimate}& \multicolumn{1}{c}{Std. Err.}& \multicolumn{1}{c}{z}& \multicolumn{1}{c}{p}& \multicolumn{1}{c}{Estimate}& \multicolumn{1}{c}{Std. Err.}& \multicolumn{1}{c}{z}& \multicolumn{1}{c}{p}\tabularnewline\hline
& \multicolumn{9}{c}{\underline{Factor Loadings}}\tabularnewline \multicolumn{1}{l}{\underline{ABU}}\tabularnewline
NoSKMSM& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \tabularnewline
KSMChrMX& 0.71& 0.03& 22.62& .000& 0.73& 0.04& 20.38& .000& 0.73& 0.04& 19.89& .000\tabularnewline
KSMSevMx& 0.69& 0.03& 25.22& .000& 0.69& 0.03& 23.08& .000& 0.69& 0.03& 22.51& .000\tabularnewline
 \multicolumn{1}{l}{\underline{NEG}}\tabularnewline
NoSNeg& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \tabularnewline
NegChrMX& 0.96& 0.04& 22.49& .000& 0.98& 0.04& 22.23& .000& 1.01& 0.05& 21.37& .000\tabularnewline
NegSevMx& 1.10& 0.06& 17.35& .000& 1.13& 0.07& 17.03& .000& 1.15& 0.07& 16.73& .000\tabularnewline
 \multicolumn{1}{l}{\underline{INT}}\tabularnewline
D.VORH& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \tabularnewline
A.VORH& 0.82& 0.19& 4.39& .000& 0.72& 0.18& 4.00& .000& 0.74& 0.19& 3.98& .000\tabularnewline
AINTMAX& 1.62& 0.44& 3.66& .000& 1.62& 0.46& 3.55& .000& 1.60& 0.47& 3.38& .001\tabularnewline
 \multicolumn{1}{l}{\underline{EXT}}\tabularnewline
C.VORH& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \tabularnewline
O.VORH& 0.72& 0.13& 5.49& .000& 0.65& 0.13& 5.11& .000& 0.60& 0.12& 5.00& .000\tabularnewline
ADHS.MAX& 0.69& 0.13& 5.09& .000& 0.69& 0.13& 5.13& .000& 0.65& 0.12& 5.25& .000\tabularnewline
 \multicolumn{1}{l}{\underline{EM}}\tabularnewline
NoSEMnew& & & & & 1.00$^+$& & & & 1.00$^+$& & & \tabularnewline
EMChrMX& & & & & 0.67& 0.06& 11.84& .000& 0.69& 0.06& 11.78& .000\tabularnewline
EMSevMX& & & & & 0.76& 0.07& 10.88& .000& 0.77& 0.07& 10.76& .000\tabularnewline
& \multicolumn{9}{c}{\underline{Regression Slopes}}\tabularnewline \multicolumn{1}{l}{\underline{INT}}\tabularnewline
ABU& 0.52& 0.21& 2.52& .012& 0.25& 0.18& 1.36& .174& 0.32& 0.19& 1.69& .090\tabularnewline
NEG& 0.21& 0.18& 1.20& .231& -0.17& 0.22& -0.78& .438& -0.30& 0.24& -1.23& .218\tabularnewline
EM& & & & & 0.48& 0.17& 2.83& .005& 0.46& 0.17& 2.64& .008\tabularnewline
a& & & & & & & & & -0.02& 0.01& -1.59& .111\tabularnewline
s& & & & & & & & & 0.01& 0.07& 0.21& .836\tabularnewline
KM.Bild& & & & & & & & & -0.04& 0.04& -1.05& .296\tabularnewline
 \multicolumn{1}{l}{\underline{EXT}}\tabularnewline
ABU& 1.12& 0.27& 4.20& .000& 0.74& 0.29& 2.55& .011& 0.69& 0.30& 2.27& .023\tabularnewline
NEG& 0.85& 0.27& 3.17& .002& 0.35& 0.32& 1.12& .263& 0.08& 0.33& 0.23& .822\tabularnewline
EM& & & & & 0.66& 0.21& 3.16& .002& 0.56& 0.23& 2.47& .014\tabularnewline
a& & & & & & & & & 0.03& 0.02& 1.64& .102\tabularnewline
s& & & & & & & & & -0.46& 0.13& -3.42& .001\tabularnewline
KM.Bild& & & & & & & & & -0.17& 0.07& -2.50& .013\tabularnewline
& \multicolumn{9}{c}{\underline{Intercepts}}\tabularnewline
NoSKMSM& 0.08& 0.02& 4.22& .000& 0.08& 0.02& 4.22& .000& 0.08& 0.02& 4.22& .000\tabularnewline
KSMChrMX& 0.05& 0.02& 3.43& .001& 0.05& 0.02& 3.43& .001& 0.06& 0.02& 3.43& .001\tabularnewline
KSMSevMx& 0.05& 0.01& 3.78& .000& 0.05& 0.01& 3.79& .000& 0.05& 0.01& 3.80& .000\tabularnewline
NoSNeg& 0.10& 0.02& 6.32& .000& 0.10& 0.02& 6.33& .000& 0.10& 0.02& 6.15& .000\tabularnewline
NegChrMX& 0.10& 0.02& 4.87& .000& 0.10& 0.02& 4.87& .000& 0.10& 0.02& 4.72& .000\tabularnewline
NegSevMx& 0.13& 0.03& 5.14& .000& 0.13& 0.03& 5.14& .000& 0.13& 0.03& 4.95& .000\tabularnewline
D.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \tabularnewline
A.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \tabularnewline
AINTMAX& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \tabularnewline
C.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \tabularnewline
O.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \tabularnewline
ADHS.MAX& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \tabularnewline
NoSEMnew& & & & & 0.21& 0.04& 6.04& .000& 0.21& 0.04& 5.97& .000\tabularnewline
EMChrMX& & & & & 0.14& 0.02& 6.03& .000& 0.14& 0.02& 5.85& .000\tabularnewline
EMSevMX& & & & & 0.16& 0.02& 7.06& .000& 0.16& 0.02& 6.94& .000\tabularnewline
a& & & & & & & & & 8.68& 0.12& 73.34& .000\tabularnewline
s& & & & & & & & & 1.46& 0.02& 78.50& .000\tabularnewline
KM.Bild& & & & & & & & & 3.22& 0.04& 72.55& .000\tabularnewline
& \multicolumn{9}{c}{\underline{Latent Variances}}\tabularnewline
ABU& 0.04& 0.00& 14.35& .000& 0.04& 0.00& 13.40& .000& 0.04& 0.00& 12.92& .000\tabularnewline
NEG& 0.04& 0.00& 14.44& .000& 0.04& 0.00& 14.17& .000& 0.04& 0.00& 13.84& .000\tabularnewline
INT& 0.29& 0.10& 3.07& .002& 0.30& 0.10& 3.02& .003& 0.29& 0.10& 2.88& .004\tabularnewline
EXT& 0.59& 0.14& 4.12& .000& 0.59& 0.15& 4.04& .000& 0.56& 0.14& 3.88& .000\tabularnewline
EM& & & & & 0.12& 0.02& 6.40& .000& 0.12& 0.02& 6.38& .000\tabularnewline
& \multicolumn{9}{c}{\underline{Latent Covariances}}\tabularnewline
ABU w/NEG& 0.02& 0.00& 13.11& .000& 0.02& 0.00& 12.61& .000& 0.02& 0.00& 12.14& .000\tabularnewline
INT w/EXT& 0.16& 0.05& 2.97& .003& 0.14& 0.05& 2.67& .008& 0.15& 0.06& 2.59& .010\tabularnewline
ABU w/EM& & & & & 0.04& 0.00& 9.39& .000& 0.04& 0.00& 9.28& .000\tabularnewline
NEG w/EM& & & & & 0.05& 0.00& 9.56& .000& 0.05& 0.00& 9.47& .000\tabularnewline
& \multicolumn{9}{c}{\underline{Fit Indices}}\tabularnewline
$\chi^{2}(\mathrm{df})$& 67.42& & & & 75.22& & & & 133.77& & & \tabularnewline
CFI& 0.99& & & & 1.00& & & & 1.00& & & \tabularnewline
RMSEA& 0.03& & & & 0.01& & & & 0.02& & & \tabularnewline
SRMR& 0.06& & & & 0.05& & & & 0.11& & & \tabularnewline
Scaled $\chi^{2}(\mathrm{df})$& 96.70(45)& & & .000& 135.52(71)& & & .000& 226.51(104)& & & .000\tabularnewline
\bottomrule
\multicolumn{13}{l}{BOML10$^+$Fixed parameter}
\end{longtable}
\end{landscape}
\end{document}

答案1

您的代码似乎创建了1+12*4=49[!] 列,但实际上只1+3*4=13需要列。

还请注意,我会加载pdflscape包而不是lscape包。我也不会使用下划线来强调。相反,使用斜体或者大胆的

longtable下面的截图只显示了跨越两页以上的前几行。

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage[margin=2.5cm]{geometry}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{pdflscape}

\begin{document}
\begin{landscape}
\begin{longtable}{@{} 
        r 
        *{3}{S[table-format=2.2,
                table-space-text-post = $^{+}$,
                table-align-text-post = false]
              S[table-format=1.2]
              S[table-format=2.2]
              S[table-format=1.3]}
            @{}}
            
%%% headers and footers

\caption{SEM3}\\
\toprule
& \multicolumn{4}{c}{A \& N}
& \multicolumn{4}{c}{A, N \& EM}
& \multicolumn{4}{c@{}}{A, N, EM \& control} \\  
\cmidrule(lr){2-5}\cmidrule(lr){6-9}\cmidrule(l){10-13}
& {Coeff.} & {Std.\ Err.} & {$z$} & {$p$}
& {Coeff.} & {Std.\ Err.} & {$z$} & {$p$}
& {Coeff.} & {Std.\ Err.} & {$z$} & {$p$} \\
\midrule
\endfirsthead

\multicolumn{13}{@{}l}{Table \thetable, cont'd}\\
\addlinespace
\toprule
& \multicolumn{4}{c}{A \& N}
& \multicolumn{4}{c}{A, N \& EM}
& \multicolumn{4}{c@{}}{A, N \& EM \& control} \\  
\cmidrule(lr){2-5}\cmidrule(lr){6-9}\cmidrule(l){10-13}
& {Coeff.} & {Std.\ Err.} & {$z$} & {$p$}
& {Coeff.} & {Std.\ Err.} & {$z$} & {$p$}
& {Coeff.} & {Std.\ Err.} & {$z$} & {$p$} \\
\midrule
\endhead

\midrule
\multicolumn{13}{r@{}}{\footnotesize (cont'd on following page)}\\
\endfoot

\bottomrule
\addlinespace
\multicolumn{13}{@{}l}{BOML10$^+$ Fixed parameter}
\endlastfoot

%%% body of longtable

\addlinespace
& \multicolumn{12}{c}{\textbf{Factor Loadings}}\\ 
\multicolumn{1}{@{}l}{\textbf{ABU}}\\
NoSKMSM& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \\
KSMChrMX& 0.71& 0.03& 22.62& .000& 0.73& 0.04& 20.38& .000& 0.73& 0.04& 19.89& .000\\
KSMSevMx& 0.69& 0.03& 25.22& .000& 0.69& 0.03& 23.08& .000& 0.69& 0.03& 22.51& .000\\
\multicolumn{1}{@{}l}{\textbf{NEG}}\\
NoSNeg& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \\
NegChrMX& 0.96& 0.04& 22.49& .000& 0.98& 0.04& 22.23& .000& 1.01& 0.05& 21.37& .000\\
NegSevMx& 1.10& 0.06& 17.35& .000& 1.13& 0.07& 17.03& .000& 1.15& 0.07& 16.73& .000\\
\multicolumn{1}{@{}l}{\textbf{INT}}\\
D.VORH& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \\
A.VORH& 0.82& 0.19& 4.39& .000& 0.72& 0.18& 4.00& .000& 0.74& 0.19& 3.98& .000\\
AINTMAX& 1.62& 0.44& 3.66& .000& 1.62& 0.46& 3.55& .000& 1.60& 0.47& 3.38& .001\\
\multicolumn{1}{@{}l}{\textbf{EXT}}\\
C.VORH& 1.00$^+$& & & & 1.00$^+$& & & & 1.00$^+$& & & \\
O.VORH& 0.72& 0.13& 5.49& .000& 0.65& 0.13& 5.11& .000& 0.60& 0.12& 5.00& .000\\
ADHS.MAX& 0.69& 0.13& 5.09& .000& 0.69& 0.13& 5.13& .000& 0.65& 0.12& 5.25& .000\\
\multicolumn{1}{@{}l}{\textbf{EM}}\\
NoSEMnew& & & & & 1.00$^+$& & & & 1.00$^+$& & & \\
EMChrMX& & & & & 0.67& 0.06& 11.84& .000& 0.69& 0.06& 11.78& .000\\
EMSevMX& & & & & 0.76& 0.07& 10.88& .000& 0.77& 0.07& 10.76& .000\\ 
\addlinespace
& \multicolumn{12}{c}{\textbf{Regression Slopes}}\\  
\multicolumn{1}{@{}l}{\textbf{INT}}\\
ABU& 0.52& 0.21& 2.52& .012& 0.25& 0.18& 1.36& .174& 0.32& 0.19& 1.69& .090\\
NEG& 0.21& 0.18& 1.20& .231& -0.17& 0.22& -0.78& .438& -0.30& 0.24& -1.23& .218\\
EM& & & & & 0.48& 0.17& 2.83& .005& 0.46& 0.17& 2.64& .008\\
a& & & & & & & & & -0.02& 0.01& -1.59& .111\\
s& & & & & & & & & 0.01& 0.07& 0.21& .836\\
KM.Bild& & & & & & & & & -0.04& 0.04& -1.05& .296\\
\multicolumn{1}{@{}l}{\textbf{EXT}}\\
ABU& 1.12& 0.27& 4.20& .000& 0.74& 0.29& 2.55& .011& 0.69& 0.30& 2.27& .023\\
NEG& 0.85& 0.27& 3.17& .002& 0.35& 0.32& 1.12& .263& 0.08& 0.33& 0.23& .822\\
EM& & & & & 0.66& 0.21& 3.16& .002& 0.56& 0.23& 2.47& .014\\
a& & & & & & & & & 0.03& 0.02& 1.64& .102\\
s& & & & & & & & & -0.46& 0.13& -3.42& .001\\
KM.Bild& & & & & & & & & -0.17& 0.07& -2.50& .013\\
\addlinespace
& \multicolumn{12}{c}{\textbf{Intercepts}}\\
NoSKMSM& 0.08& 0.02& 4.22& .000& 0.08& 0.02& 4.22& .000& 0.08& 0.02& 4.22& .000\\
KSMChrMX& 0.05& 0.02& 3.43& .001& 0.05& 0.02& 3.43& .001& 0.06& 0.02& 3.43& .001\\
KSMSevMx& 0.05& 0.01& 3.78& .000& 0.05& 0.01& 3.79& .000& 0.05& 0.01& 3.80& .000\\
NoSNeg& 0.10& 0.02& 6.32& .000& 0.10& 0.02& 6.33& .000& 0.10& 0.02& 6.15& .000\\
NegChrMX& 0.10& 0.02& 4.87& .000& 0.10& 0.02& 4.87& .000& 0.10& 0.02& 4.72& .000\\
NegSevMx& 0.13& 0.03& 5.14& .000& 0.13& 0.03& 5.14& .000& 0.13& 0.03& 4.95& .000\\
D.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \\
A.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \\
AINTMAX& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \\
C.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \\
O.VORH& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \\
ADHS.MAX& 0.00$^+$& & & & 0.00$^+$& & & & 0.00$^+$& & & \\
NoSEMnew& & & & & 0.21& 0.04& 6.04& .000& 0.21& 0.04& 5.97& .000\\
EMChrMX& & & & & 0.14& 0.02& 6.03& .000& 0.14& 0.02& 5.85& .000\\
EMSevMX& & & & & 0.16& 0.02& 7.06& .000& 0.16& 0.02& 6.94& .000\\
a& & & & & & & & & 8.68& 0.12& 73.34& .000\\
s& & & & & & & & & 1.46& 0.02& 78.50& .000\\
KM.Bild& & & & & & & & & 3.22& 0.04& 72.55& .000\\
\addlinespace
& \multicolumn{12}{c}{\textbf{Latent Variances}}\\
ABU& 0.04& 0.00& 14.35& .000& 0.04& 0.00& 13.40& .000& 0.04& 0.00& 12.92& .000\\
NEG& 0.04& 0.00& 14.44& .000& 0.04& 0.00& 14.17& .000& 0.04& 0.00& 13.84& .000\\
INT& 0.29& 0.10& 3.07& .002& 0.30& 0.10& 3.02& .003& 0.29& 0.10& 2.88& .004\\
EXT& 0.59& 0.14& 4.12& .000& 0.59& 0.15& 4.04& .000& 0.56& 0.14& 3.88& .000\\
EM& & & & & 0.12& 0.02& 6.40& .000& 0.12& 0.02& 6.38& .000\\
\addlinespace
& \multicolumn{12}{c}{\textbf{Latent Covariances}}\\*
ABU w/NEG& 0.02& 0.00& 13.11& .000& 0.02& 0.00& 12.61& .000& 0.02& 0.00& 12.14& .000\\
INT w/EXT& 0.16& 0.05& 2.97& .003& 0.14& 0.05& 2.67& .008& 0.15& 0.06& 2.59& .010\\
ABU w/EM& & & & & 0.04& 0.00& 9.39& .000& 0.04& 0.00& 9.28& .000\\
NEG w/EM& & & & & 0.05& 0.00& 9.56& .000& 0.05& 0.00& 9.47& .000\\
\addlinespace
& \multicolumn{12}{c}{\textbf{Fit Indices}}\\
$\chi^{2}$ & {67.42} & & & & {75.22} & & & & {133.77} & & & \\
CFI&   0.99& & & & 1.00& & & & 1.00& & & \\
RMSEA& 0.03& & & & 0.01& & & & 0.02& & & \\
SRMR&  0.06& & & & 0.05& & & & 0.11& & & \\
Scaled $\chi^{2}$ 
& {96.70} & & & .000& {135.52} & & & .000 & {226.51}& & & .000  \\
(df) & {(45)} & & & & {(71)} & & & & {(104)} \\
\end{longtable}
\end{landscape}
\end{document}

相关内容