von Catta » Mi 26. Apr 2017, 15:04
Hallo zusammen. Ich muss einige Daten (multicolumns + multirows) in longtabu verarbeiten. Mit einem anderen Beispiel ohne multirows hat es ganz ok funktioniert, aber hier komme ich nicht mehr weiter. Die Tabelle sieht schlimm aus, sie ist nicht auf Textbreite und der Abstand zwischen den multicolumns def1 und def2 ist nicht weit genug, so dass alles unübersichtlich ist. Je nach dem, wo der Seitenumbruch ist, rutscht die multirow (design1-3) aus der Tabellenumgebung raus (?). Außerdem habe ich versucht, die Inhalte der multicolumns (contrast, t, p) zu zentrieren, während die Zahlen aber rechtsbündig sind bzw. an der Dezimalstelle ausgerichtet (das habe ich auch mit siunitx ausprobiert).
\documentclass{article}
\usepackage{tabu, longtable}
\begin{document}
\small
\begin{longtabu} to \textwidth {X[l]X[l]X[r]X[r]X[r]X[r]X[r]X[r]}
\toprule
\toprule
& & \multicolumn{3}{c}{\textbf{def1}} & \multicolumn{3}{c}{\textbf{def2}} \\
& & contrast & t & p & contrast & t & p \\ \toprule
\endfirsthead
\toprule
& & \multicolumn{3}{c}{\textbf{def1}} & \multicolumn{3}{c}{\textbf{def2}} \\
& & contrast & t & p & contrast & t & p \\ \toprule
\endhead
\bottomrule
\multicolumn{8}{c}{continued on the next page} \\
\bottomrule
\endfoot
\bottomrule
\bottomrule
\endlastfoot
\multicolumn{8}{c}{\textbf{group1}} \\
\bottomrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design1}}} &
\multicolumn{1}{l}{pos1} & 15.05 & 1.06 & 0.145 & -3.41 & -0.28 & 0.610 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 9.20 & 0.65 & 0.258 & -4.02 & -0.32 & 0.627 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 32.92 & 2.30 & 0.011 & 4.87 & 0.40 & 0.344 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 6.46 & 0.69 & 0.247 & 3.94 & 0.45 & 0.327 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 10.99 & 0.87 & 0.191 & 0.41 & 0.03 & 0.486 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 36.70 & 2.20 & 0.014 & 30.20 & 1.94 & 0.026 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design2}}} &
\multicolumn{1}{l}{pos1} & 6.51 & 0.87 & 0.192 & -2.79 & -0.41 & 0.661 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 1.91 & 0.29 & 0.385 & -3.21 & -0.54 & 0.706 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 16.49 & 2.52 & 0.006 & 4.21 & 0.73 & 0.233 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 4.42 & 0.96 & 0.168 & 1.15 & 0.28 & 0.391 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 0.13 & 0.02 & 0.491 & -0.26 & -0.05 & 0.521 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 11.73 & 1.63 & 0.052 & 12.18 & 1.88 & 0.031 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design3}}} &
\multicolumn{1}{l}{pos1} & 17.02 & 1.18 & 0.119 & -5.75 & -0.46 & 0.678 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 11.08 & 0.77 & 0.220 & -3.85 & -0.30 & 0.618 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 35.82 & 2.41 & 0.008 & 6.00 & 0.48 & 0.316 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 9.59 & 0.96 & 0.170 & 1.78 & 0.19 & 0.423 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 9.25 & 0.70 & 0.243 & 0.86 & 0.07 & 0.472 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 34.91 & 1.99 & 0.024 & 32.28 & 2.04 & 0.021 \\
\bottomrule
\multicolumn{8}{c}{\textbf{group2}} \\
\bottomrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design1}}} &
\multicolumn{1}{l}{pos1} & 16.98 & 1.07 & 0.142 & -10.16 & -0.70 & 0.759 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 18.47 & 1.10 & 0.136 & 2.77 & 0.18 & 0.429 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 15.28 & 1.23 & 0.110 & 16.18 & 1.41 & 0.079 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 21.38 & 1.92 & 0.027 & -0.18 & -0.02 & 0.507 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 30.56 & 2.54 & 0.006 & 16.49 & 1.50 & 0.067 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 29.32 & 3.40 & 0.000 & -7.31 & -0.98 & 0.836 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design2}}} &
\multicolumn{1}{l}{pos1} & 5.45 & 0.71 & 0.239 & -3.97 & -0.56 & 0.712 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 9.89 & 1.48 & 0.070 & -0.84 & -0.14 & 0.554 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 7.32 & 1.38 & 0.084 & 4.53 & 0.93 & 0.176 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 10.15 & 2.04 & 0.021 & -0.86 & -0.19 & 0.575 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 11.09 & 2.20 & 0.014 & 3.13 & 0.67 & 0.250 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 9.31 & 1.88 & 0.030 & -3.42 & -0.75 & 0.774 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design3}}} &
\multicolumn{1}{l}{pos1} & 16.54 & 1.06 & 0.145 & -7.81 & -0.55 & 0.709 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 11.86 & 0.72 & 0.236 & -6.58 & -0.43 & 0.667 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 15.75 & 1.29 & 0.099 & 14.89 & 1.32 & 0.093 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 25.87 & 2.36 & 0.009 & -1.19 & -0.12 & 0.548 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 30.73 & 2.59 & 0.005 & 14.17 & 1.31 & 0.096 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 31.61 & 3.66 & 0.000 & -6.28 & -0.85 & 0.802 \\
\end{longtabu}
\end{document}
Hallo zusammen. Ich muss einige Daten (multicolumns + multirows) in longtabu verarbeiten. Mit einem anderen Beispiel ohne multirows hat es ganz ok funktioniert, aber hier komme ich nicht mehr weiter. Die Tabelle sieht schlimm aus, sie ist nicht auf Textbreite und der Abstand zwischen den multicolumns def1 und def2 ist nicht weit genug, so dass alles unübersichtlich ist. Je nach dem, wo der Seitenumbruch ist, rutscht die multirow (design1-3) aus der Tabellenumgebung raus (?). Außerdem habe ich versucht, die Inhalte der multicolumns (contrast, t, p) zu zentrieren, während die Zahlen aber rechtsbündig sind bzw. an der Dezimalstelle ausgerichtet (das habe ich auch mit siunitx ausprobiert).
[code]\documentclass{article}
\usepackage{tabu, longtable}
\begin{document}
\small
\begin{longtabu} to \textwidth {X[l]X[l]X[r]X[r]X[r]X[r]X[r]X[r]}
\toprule
\toprule
& & \multicolumn{3}{c}{\textbf{def1}} & \multicolumn{3}{c}{\textbf{def2}} \\
& & contrast & t & p & contrast & t & p \\ \toprule
\endfirsthead
\toprule
& & \multicolumn{3}{c}{\textbf{def1}} & \multicolumn{3}{c}{\textbf{def2}} \\
& & contrast & t & p & contrast & t & p \\ \toprule
\endhead
\bottomrule
\multicolumn{8}{c}{continued on the next page} \\
\bottomrule
\endfoot
\bottomrule
\bottomrule
\endlastfoot
\multicolumn{8}{c}{\textbf{group1}} \\
\bottomrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design1}}} &
\multicolumn{1}{l}{pos1} & 15.05 & 1.06 & 0.145 & -3.41 & -0.28 & 0.610 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 9.20 & 0.65 & 0.258 & -4.02 & -0.32 & 0.627 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 32.92 & 2.30 & 0.011 & 4.87 & 0.40 & 0.344 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 6.46 & 0.69 & 0.247 & 3.94 & 0.45 & 0.327 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 10.99 & 0.87 & 0.191 & 0.41 & 0.03 & 0.486 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 36.70 & 2.20 & 0.014 & 30.20 & 1.94 & 0.026 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design2}}} &
\multicolumn{1}{l}{pos1} & 6.51 & 0.87 & 0.192 & -2.79 & -0.41 & 0.661 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 1.91 & 0.29 & 0.385 & -3.21 & -0.54 & 0.706 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 16.49 & 2.52 & 0.006 & 4.21 & 0.73 & 0.233 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 4.42 & 0.96 & 0.168 & 1.15 & 0.28 & 0.391 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 0.13 & 0.02 & 0.491 & -0.26 & -0.05 & 0.521 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 11.73 & 1.63 & 0.052 & 12.18 & 1.88 & 0.031 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design3}}} &
\multicolumn{1}{l}{pos1} & 17.02 & 1.18 & 0.119 & -5.75 & -0.46 & 0.678 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 11.08 & 0.77 & 0.220 & -3.85 & -0.30 & 0.618 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 35.82 & 2.41 & 0.008 & 6.00 & 0.48 & 0.316 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 9.59 & 0.96 & 0.170 & 1.78 & 0.19 & 0.423 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 9.25 & 0.70 & 0.243 & 0.86 & 0.07 & 0.472 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 34.91 & 1.99 & 0.024 & 32.28 & 2.04 & 0.021 \\
\bottomrule
\multicolumn{8}{c}{\textbf{group2}} \\
\bottomrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design1}}} &
\multicolumn{1}{l}{pos1} & 16.98 & 1.07 & 0.142 & -10.16 & -0.70 & 0.759 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 18.47 & 1.10 & 0.136 & 2.77 & 0.18 & 0.429 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 15.28 & 1.23 & 0.110 & 16.18 & 1.41 & 0.079 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 21.38 & 1.92 & 0.027 & -0.18 & -0.02 & 0.507 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 30.56 & 2.54 & 0.006 & 16.49 & 1.50 & 0.067 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 29.32 & 3.40 & 0.000 & -7.31 & -0.98 & 0.836 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design2}}} &
\multicolumn{1}{l}{pos1} & 5.45 & 0.71 & 0.239 & -3.97 & -0.56 & 0.712 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 9.89 & 1.48 & 0.070 & -0.84 & -0.14 & 0.554 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 7.32 & 1.38 & 0.084 & 4.53 & 0.93 & 0.176 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 10.15 & 2.04 & 0.021 & -0.86 & -0.19 & 0.575 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 11.09 & 2.20 & 0.014 & 3.13 & 0.67 & 0.250 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 9.31 & 1.88 & 0.030 & -3.42 & -0.75 & 0.774 \\
\midrule
\multicolumn{1}{l}{\multirow{6}{*}{\textbf{design3}}} &
\multicolumn{1}{l}{pos1} & 16.54 & 1.06 & 0.145 & -7.81 & -0.55 & 0.709 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos2} & 11.86 & 0.72 & 0.236 & -6.58 & -0.43 & 0.667 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos3} & 15.75 & 1.29 & 0.099 & 14.89 & 1.32 & 0.093 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos4} & 25.87 & 2.36 & 0.009 & -1.19 & -0.12 & 0.548 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos5} & 30.73 & 2.59 & 0.005 & 14.17 & 1.31 & 0.096 \\
\multicolumn{1}{l}{} &
\multicolumn{1}{l}{pos6} & 31.61 & 3.66 & 0.000 & -6.28 & -0.85 & 0.802 \\
\end{longtabu}
\end{document}[/code]