2

I'm trying to reduce the line spacing for the rotated table cells in order to reduce the width of the table and to make it look nicer. Also the cell "Material" looks kind of crammed.

This is what it looks like now:

enter image description here

Here's my MWE

\documentclass[11pt, a4paper]{scrbook}

\usepackage[left=27.5mm,right=16mm,top=30mm,bottom=30mm]{geometry}
\usepackage[english,main=ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{makecell}

\usepackage{rotating}
\setlength{\tabcolsep}{2.5pt}
\setlength\rotheadsize{2.65cm}


\begin{document}

\begin{table}
\centering
\begin{tabular}{@{}llcccccccccc@{}}
\toprule
\multicolumn{2}{l}{\textbf{Zustand}} & \multicolumn{6}{c}{fest} & \multicolumn{4}{c}{flüssig} \\
\cmidrule(lr){3-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{Form}} & \multicolumn{4}{c}{Pulver} & Strang & Folie & \multicolumn{4}{c}{Flüssigkeit} \\
\cmidrule(lr){3-6} \cmidrule(lr){7-7} \cmidrule(lr){8-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{Bindung}} & \multicolumn{3}{c}{Verschmelzen} & Binden & Verschmelzen & Verkleben & Aushärten & \multicolumn{3}{c}{UV-licht} \\
\midrule
\multicolumn{2}{l}{\textbf{Verfahren}} &
\rotcell{Selektives lasersintern} & \rotcell{Selektives Laserschmelzen} & \rotcell{Elektronenstrahlschmelzen} & \rotcell{3D Drucken} & \rotcell{Fused \\ Deposition Modelling} & \rotcell{Laminated \\ Object Manufacturing} & \rotcell{Multi-Jet Modelling} & \rotcell{Stereolithographie} & \rotcell{Poly-Jet Modelling} & \rotcell{Digital Light Processing} \\
\midrule
\multicolumn{2}{l}{\textbf{Abkürzung}} & SLS & SLM & EBM & 3DP & FDM & LOM & MJM & SLA & PJM & DLP \\
\midrule
\multirow[c]{3}{*}{\rotatebox{90}{\textbf{Material}}} & Kunststoff & x &  &  & x & x & x & x & x & x & x \\
\cmidrule(l){2-12}
& Metall &  & x & x & x &  & x &  &  &  & x \\
\cmidrule(l){2-12}
& Keramik &  & x & x & x &  & x &  & x &  & x \\
\bottomrule
\end{tabular}
\end{table}

\end{document}
1
  • See updated answer with addition example which give a nicer tabular.
    – Sveinung
    Feb 24 '20 at 9:50
2

Here is another attempt. Instead of \rotcell, I define a command that uses nested tabular with reduced \arraystretch and fontsize \small (based on an answer by @Heiko Oberdiek). There is no overfull hbox warning when I compile.

In example 2 (which is better), I set \tabcolsep to 0pt, use tabular* with a @{\extrarowcol{\fill}} to evenly distribute the distance between columns (based on an answer by @Mico) In addition, I removed the (lr) adjustment on \cmidrules) to line up the rules.

If you prefer a tabular that do not fill the whole \linewidth, you can use a preamble of:

\begin{tabular*}{0.85\linewidth}{@{\extracolsep{\fill}}ll!{\hspace{6pt}}cccccccccc}

Still without overfull hbox.

In both tabulars, I added 1 pt space between the three last rows, moved the \multirow cell to the last row and raised it with a negative number to have better alignment.

Ecample 1 - tabular

enter image description here

\documentclass[11pt, a4paper]{scrbook}

\usepackage[left=27.5mm,right=16mm,top=30mm,bottom=30mm]{geometry}
\usepackage[english,main=ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{makecell}

\usepackage{rotating}
\setlength{\tabcolsep}{2.5pt}
\setlength\rotheadsize{2.65cm}

% Multi-line left-aligned text with manual line breaks.
% The base line of the whole is at the top row.
\newcommand*{\rhead}[1]{%
\begingroup
    \begin{sideways}
    \renewcommand*{\arraystretch}{0.7}%
    \small\begin{tabular}[b]{@{}l@{}}#1\end{tabular}%
  \end{sideways}
  \endgroup
}

\begin{document}

\begin{table}
\centering
\begin{tabular}{@{}llcccccccccc@{}}
\toprule
\multicolumn{2}{l}{\textbf{Zustand}} & \multicolumn{6}{c}{\small fest} & \multicolumn{4}{c}{\small flüssig} \\
\cmidrule(lr){3-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{Form}} & \multicolumn{4}{c}{\small Pulver} & \small Strang & \small Folie & \multicolumn{4}{c}{\small Flüssigkeit} \\
\cmidrule(lr){3-6} \cmidrule(lr){7-7} \cmidrule(lr){8-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{\small Bindung}} & \multicolumn{3}{c}{\small Verschmelzen} & \small Binden & \small Verschmelzen & \small Verkleben & \small Aushärten & \multicolumn{3}{c}{\small UV-licht} \\
\midrule
\multicolumn{2}{l}{\textbf{Verfahren}} &
\rhead{Selektives\\ lasersintern} & \rhead{Selektives\\ Laserschmelzen} & \rhead{Elektronen-\\strahlschmelzen} & \rhead{3D Drucken} & \rhead{Fused  Deposition\\ Modelling} & \rhead{Laminated Object\\ Manufacturing} & \rhead{Multi-Jet Modelling} & \rhead{Stereolithographie} & \rhead{Poly-Jet Modelling} & \rhead{Digital Light\\ Processing} \\
\midrule
\multicolumn{2}{l}{\textbf{Abkürzung}} & SLS & SLM & EBM & 3DP & FDM & LOM & MJM & SLA & PJM & DLP \\
\midrule\addlinespace[1pt]
& Kunststoff & x &  &  & x & x & x & x & x & x & x \\\addlinespace[1pt]
\cmidrule{2-12}
& Metall &  & x & x & x &  & x &  &  &  & x \\\addlinespace[1pt]
\cmidrule{2-12}
\multirow{-3.6}{*}{\rhead{\bfseries Material}} & Keramik &  & x & x & x &  & x &  & x &  & x \\
\bottomrule
\end{tabular}
\end{table}

\end{document}

Example 2 - tabular* and \extracolsep

enter image description here

\documentclass[11pt, a4paper]{scrbook}

\usepackage[left=27.5mm,right=16mm,top=30mm,bottom=30mm]{geometry}
\usepackage[english,main=ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{makecell}

\usepackage{rotating}
\setlength{\tabcolsep}{0pt}
\setlength\rotheadsize{2.65cm}

% Multi-line left-aligned text with manual line breaks.
% The base line of the whole is at the top row.
\newcommand*{\rhead}[1]{%
\begingroup
    \begin{sideways}
    \renewcommand*{\arraystretch}{0.85}%
    \small\begin{tabular}[b]{@{}l@{}}#1\end{tabular}%
  \end{sideways}
  \endgroup
}

\begin{document}

\begin{table}
\centering
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}llcccccccccc}
\toprule
\multicolumn{2}{l}{\textbf{Zustand}} & \multicolumn{6}{c}{\small fest} & \multicolumn{4}{c}{\small flüssig} \\
\cmidrule(lr){3-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{Form}} & \multicolumn{4}{c}{\small Pulver} & \small Strang & \small Folie & \multicolumn{4}{c}{\small Flüssigkeit} \\
\cmidrule{3-6} \cmidrule{7-7} \cmidrule{8-8} \cmidrule{9-12}
\multicolumn{2}{l}{\textbf{\small Bindung}} & \multicolumn{3}{c}{\small Verschmelzen} & \small Binden & \small Verschmelzen & \small Verkleben & \small Aushärten & \multicolumn{3}{c}{\small UV-licht} \\
\midrule
\multicolumn{2}{l}{\textbf{Verfahren}} &
\rhead{Selektives\\ lasersintern} & \rhead{Selektives\\ Laserschmelzen} & \rhead{Elektronen-\\strahlschmelzen} & \rhead{3D Drucken} & \rhead{Fused  Deposition\\ Modelling} & \rhead{Laminated Object\\ Manufacturing} & \rhead{Multi-Jet\\ Modelling} & \rhead{Stereolitho-\\graphie} & \rhead{Poly-Jet\\ Modelling} & \rhead{Digital Light\\ Processing} \\
\midrule
\multicolumn{2}{l}{\textbf{Abkürzung}} & SLS & SLM & EBM & 3DP & FDM & LOM & MJM & SLA & PJM & DLP \\
\midrule\addlinespace[1pt]
& Kunststoff & x &  &  & x & x & x & x & x & x & x \\\addlinespace[1pt]
\cmidrule{2-12}
& Metall &  & x & x & x &  & x &  &  &  & x \\\addlinespace[1pt]
\cmidrule{2-12}
\multirow{-3.6}{*}{\rhead{\bfseries Material}} & Keramik &  & x & x & x &  & x &  & x &  & x \\
\bottomrule
\end{tabular*}
\end{table}

\end{document}
1
  • @Mico Your idea to use \tabcolsep{0pt} plus \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} is brilliant. :)
    – Sveinung
    Feb 24 '20 at 10:04
2

You can use a negative argument for \addlinespace:

\documentclass[11pt, a4paper]{scrbook}

\usepackage[left=27.5mm,right=16mm, vmargin=30mm]{geometry}
\usepackage[english, main=ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{makecell}

\usepackage{rotating}
\setlength{\tabcolsep}{2.5pt}
\setlength\rotheadsize{2.65cm}

\begin{document}

\begin{table}
\centering
\begin{tabular}{@{}ll*{10}{c}@{}}
\toprule
\multicolumn{2}{l}{\textbf{Zustand}} & \multicolumn{6}{c}{fest} & \multicolumn{4}{c}{flüssig} \\
\cmidrule(lr){3-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{Form}} & \multicolumn{4}{c}{Pulver} & Strang & Folie & \multicolumn{4}{c}{Flüssigkeit} \\
\cmidrule(lr){3-6} \cmidrule(lr){7-7} \cmidrule(lr){8-8} \cmidrule(lr){9-12}
\multicolumn{2}{l}{\textbf{Bindung}} & \multicolumn{3}{c}{Verschmelzen} & Binden & Verschmelzen & Verkleben & Aushärten & \multicolumn{3}{c}{UV-licht} \\
\midrule
\addlinespace[-\belowrulesep]
\multicolumn{2}{l}{\textbf{Verfahren}} &
\rotcell{Selektives lasersintern} & \rotcell{Selektives Laserschmelzen} & \rotcell{Elektronenstrahlschmelzen} & \rotcell{3D Drucken} & \rotcell{Fused \\ Deposition Modelling} & \rotcell{Laminated \\ Object Manufacturing} & \rotcell{Multi-Jet Modelling} & \rotcell{Stereolithographie} & \rotcell{Poly-Jet Modelling} & \rotcell{Digital Light Processing} \\
\addlinespace[-\aboverulesep]
\midrule
\multicolumn{2}{l}{\textbf{Abkürzung}} & SLS & SLM & EBM & 3DP & FDM & LOM & MJM & SLA & PJM & DLP \\
\midrule
\multirow[c]{4}{*}{\rotatebox{90}{\textbf{Material}}} & Kunststoff & x & & & x & x & x & x & x & x & x \\
\cmidrule(l){2-12}
& Metall & & x & x & x & & x & & & & x \\
\cmidrule(l){2-12}
& Keramik & & x & x & x & & x & & x & & x \\
\bottomrule
\end{tabular}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.