3

I am just writing on my thesis and built a table lately to show my data. When proofreading I found a formatting mistake in that table. The table shows means and letters in superscript to show significance. This works fine except for one column were space is put between number and letter.

To show my problem here a picture and an example (sry for the long example but its kind of hard to reproduce...)

\documentclass[
12pt,
parskip,
parsep=0pt,
DIV=15]{scrbook}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{rotating}
\sisetup{
round-mode=places,
round-precision={2},
output-decimal-marker={,},
separate-uncertainty=true,
multi-part-units=single,
range-phrase={\,bis\,}
}
\begin{document}
\begin{sidewaystable}[htbp]
    \caption{Statistische Auswertung der Bodenbearbeitung mit Grubber und      Pflug, nach Auswertung der Daten des CAN-BUS.}
    \label{Tab3.1}
    \fontsize{10pt}{15pt}\selectfont
    \fontfamily{lmr}
    \begin{center}
        \begin{tabular}{lSSSSSS}
            \toprule
            {} & \textbf{Tastradtiefe [\si{cm}]} & \textbf{Drehzahl [\si{min^{-1}}]} & \textbf{Auslastung [\si{\%}]} & \textbf{Zugkraft [\si{\kN}]} & \textbf{Schlupf [\si{\%}]} & \textbf{Fl\"ache [\si{ha.h^{-1}}]} \\
            \midrule
            \addlinespace
            \textbf{Verdichtung$^1$} &  &  &  &  &  & \\
            0-P5 & {-}21.74$^a$ & 1543$^a$ & 61.90$^b$ & 36.91$^b$ & 3.45$^b$ & 2.23$^d$ \\
            FG-P2 & {-}21.74$^a$ & 1554$^a$ & 63.20$^a$ & 38.72$^a$ & 4.04$^a$ & 2.21$^a$ \\
            3M-P3 & {-}21.28$^a$ & 1556$^a$ & 63.95$^a$ & 39.94$^a$ & 4.27$^a$ & 2.20$^b$ \\
            FL-P4 & {-}21.64$^a$ & 1551$^a$ & 63.36$^a$ & 39.89$^a$ & 3.45$^b$ & 2.22$^c$ \\
            \addlinespace
            \addlinespace
            \textbf{Lockerung$^2$} &  &  &  &  &  & \\
            B00 & {-} & {-} & {-} & {-} & {-} & {-} \\
            G10 & {-}12.92$^a$ & 1516$^b$ & 50.45$^f$ & 23.98$^e$ & 0.45$^e$ & 2.43$^a$ \\
            G15 & {-}18.10$^b$ & 1472$^{cd}$ & 56.41$^e$ & 32.33$^d$ & 1.77$^d$ & 2.41$^a$ \\
            G20 & {-}21.12$^c$ & 1530$^b$ & 60.52$^d$ & 42.12$^c$ & 2.82$^c$ & 2.38$^b$ \\
            G25 & {-}25.54$^d$ & 1452$^d$ & 68.03$^b$ & 54.15$^b$ & 4.72$^b$ & 2.33$^c$ \\
            G30 & {-}30.32$^e$ & 1840$^a$ & 78.14$^a$ & 69.02$^a$ & 8.80$^a$ & 2.20$^d$ \\
            P25 & {-} & 1496$^{bc}$ & 65.08$^c$ & 9.11$^f$ & 4.95$^b$ & 1.53$^e$ \\
            \addlinespace
            \addlinespace
            \midrule
            \textbf{Anova$^{3,4}$} &  &  &  &  &  & \\
            \underline{V}erdichtung & {} & {} & {***} & {***} & {***} & {*} \\
            \underline{L}ockerung & {***} & {***} & {***} & {***} & {***} & {***} \\
            \underline{V}x\underline{L} & {} & {} & {*} & {***} & {.} & {} \\
            \bottomrule
        \end{tabular}
    \end{center}
    \usekomafont{caption}
    {\textsuperscript{1} Faktorstufen Verdichtung: 0-P5 - Parzelle 5 Unverdichtet / FG-P2 - Parzelle 2 Fahrgassen / 3M-P3 - Parzelle 3 Dreimeterstreifen / FL-P4 - Parzelle 4 Flächenverdichtung.\\
    \textsuperscript{2} Faktorstufen Lockerung: B00 - keine Bearbeitung / G10 - Grubber 0,10 Meter / G15 - Grubber 0,15 Meter / G20 - Grubber 0,20 Meter / G25 - Grubber 0,25 Meter / G30 - Grubber     0,30 Meter / P25 - Pflug 0,25 Meter.\\
    \textsuperscript{3} Statistische Auswertung nach Faktoren Verdichtung (V) und Lockerung (L), sowie deren Wechselwirkung (V x L).\\
    \textsuperscript{4} Signifikanzcodes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1.}
    \normalfont
\end{sidewaystable}
\end{document}

picture

What I tried: - add decimals to the second column - change tabular from S to c, which works but numbers are not aligned - replace math-environment with \textsuperscript - writing numbers with siunitx arguments, what I should have done initially and apperently does get rid of the space but does not align at decimal - and switching on/off every argument I added like fontsize, fontfamily

I mean this is not the biggest problem on earth but it seems odd to my why this happens. Any Ideas what my mistake is?? Thanks in advance ;)

1 Answer 1

9

With a few adjustments your table can fit without rotation and in the normal font size.

Note that for best results, the S column should have a specification of the format (number of digits in the integral and decimal part and possible minus sign).

\documentclass[
  12pt,
  parskip,
  parsep=0pt,
  DIV=15
]{scrbook}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{rotating}

\sisetup{
  round-mode=places,
  round-precision={2},
  output-decimal-marker={,},
  separate-uncertainty=true,
  multi-part-units=single,
  range-phrase={\,bis\,}
}

\begin{document}

\begin{table}[htbp]
\centering

\caption{Statistische Auswertung der Bodenbearbeitung mit Grubber 
  und  Pflug, nach Auswertung der Daten des CAN-BUS.}
\label{Tab3.1}

\sisetup{
  table-align-text-post=true,
  table-space-text-post=\textsuperscript{cd},
}

\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  l
  S[table-format=-2.2]
  S[table-format=4.0]
  S[table-format=2.2]
  S[table-format=2.2]
  S[table-format=1.2]
  S[table-format=1.2]
  @{}
}
\toprule
  & \textbf{Tastradtiefe}
  & \textbf{Drehzahl}
  & \textbf{Auslastung}
  & \textbf{Zugkraft}
  & \textbf{Schlupf} 
  & \textbf{Fl\"ache} \\
  & {(\si{cm})}
  & {(\si{min^{-1}})}
  & {(\si{\%})}
  & {(\si{\kN})}
  & {(\si{\%})}
  & {(\si{ha.h^{-1}})} \\
\midrule
\multicolumn{7}{@{}l}{\textbf{Verdichtung$^1$}} \\
0-P5  & -21.74$^a$ & 1543$^a$ & 61.90$^b$ & 36.91$^b$ & 3.45$^b$ & 2.23$^d$ \\
FG-P2 & -21.74$^a$ & 1554$^a$ & 63.20$^a$ & 38.72$^a$ & 4.04$^a$ & 2.21$^a$ \\
3M-P3 & -21.28$^a$ & 1556$^a$ & 63.95$^a$ & 39.94$^a$ & 4.27$^a$ & 2.20$^b$ \\
FL-P4 & -21.64$^a$ & 1551$^a$ & 63.36$^a$ & 39.89$^a$ & 3.45$^b$ & 2.22$^c$ \\
\addlinespace
\multicolumn{7}{@{}l}{\textbf{Lockerung$^2$}} \\
B00 & {--} & {--} & {--} & {--} & {--} & {--} \\
G10 & -12.92$^a$ & 1516$^b$ & 50.45$^f$ & 23.98$^e$ & 0.45$^e$ & 2.43$^a$ \\
G15 & -18.10$^b$ & 1472$^{cd}$ & 56.41$^e$ & 32.33$^d$ & 1.77$^d$ & 2.41$^a$ \\
G20 & -21.12$^c$ & 1530$^b$ & 60.52$^d$ & 42.12$^c$ & 2.82$^c$ & 2.38$^b$ \\
G25 & -25.54$^d$ & 1452$^d$ & 68.03$^b$ & 54.15$^b$ & 4.72$^b$ & 2.33$^c$ \\
G30 & -30.32$^e$ & 1840$^a$ & 78.14$^a$ & 69.02$^a$ & 8.80$^a$ & 2.20$^d$ \\
P25 & {--}        & 1496$^{bc}$ & 65.08$^c$ & 9.11$^f$ & 4.95$^b$ & 1.53$^e$ \\
\addlinespace
\midrule
\multicolumn{7}{@{}l}{\textbf{Anova$^{3,4}$}} \\
\underline{V}erdichtung & {} & {} & {***} & {***} & {***} & {*} \\
\underline{L}ockerung & {***} & {***} & {***} & {***} & {***} & {***} \\
\underline{V}x\underline{L} & {} & {} & {*} & {***} & {.} & {} \\
\midrule[\heavyrulewidth]
\end{tabular*}

\begin{minipage}{\textwidth}
\usekomafont{caption}
\textsuperscript{1} Faktorstufen Verdichtung: 0-P5 - Parzelle 5 Unverdichtet / FG-P2 - Parzelle 2 Fahrgassen / 3M-P3 - Parzelle 3 Dreimeterstreifen / FL-P4 - Parzelle 4 Flächenverdichtung.\\
\textsuperscript{2} Faktorstufen Lockerung: B00 - keine Bearbeitung / G10 - Grubber 0,10 Meter / G15 - Grubber 0,15 Meter / G20 - Grubber 0,20 Meter / G25 - Grubber 0,25 Meter / G30 - Grubber 0,30 Meter / P25 - Pflug 0,25 Meter.\\
\textsuperscript{3} Statistische Auswertung nach Faktoren Verdichtung (V) und Lockerung (L), sowie deren Wechselwirkung (V x L).\\
\textsuperscript{4} Signifikanzcodes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1.
\end{minipage}

\end{table}
\end{document}

enter image description here

2
  • +1: This was much more than LaTeX help :) May 14, 2018 at 18:12
  • Hey, Thanks a lot I really did not know the specification for S. Until now it always worked, ya reading the manual would have helped...
    – Markus_J
    May 18, 2018 at 8:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .