I'm trying to set up a longtable header using multirow elements (all within a landscape
environment) in order to place units below the column labels, and despite everything I've tried, I cannot get it to work.
Originally, I had found a question on here that provided me with a template (I cannot find it for the life of me now), but it failed to work properly. I sought the package documentation, thinking the issue was with the *
option, and it offered the following insight:
text
is the actual text of the construct. If the width was set explicitly, the text will be set in a \parbox of that width; you can use \\ to force linebreaks where you like.
The documentation also seems to suggest that the =
option within \multirow
also sets a \parbox
(and would thus allow for the use of \\
within the text body, but it fails to change the state of the error messages.
Here is the MWE:
\documentclass[10pt,titlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{xstring}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{multirow}
\begin{document}
\begin{landscape}
\begin{longtable}[c]{lllrrrrrrrrr}
% Set up caption and label
\caption{An example of badness}
\label{tab:table}
% First page head
\hline
\multirow{2}{=}{\textbf{A}} & \multirow{2}{=}{\textbf{B}} & \multirow{2}{=}{\textbf{C}}
& \multirow{2}{=}{\textbf{D} \\ [kg]} & \multirow{2}{=}{\textbf{E} \\ [kg]} & \multirow{2}{=}{\textbf{F} \\ [kg]}
& \multirow{2}{=}{\textbf{G} \\ [kg]} & \multirow{2}{=}{\textbf{H} \\ [kg]} & \multirow{2}{=}{$\mathbf{\alpha}$ \\ [\%]}
& \multirow{2}{=}{$\mathbf{\beta}$ \\ [\%]} & \multirow{2}{=}{$\mathbf{\gamma}$ \\ [s]} & \multirow{2}{=}{$\mathbf{\Delta}$ \\ [m/s]} \\
\hline
\endfirsthead
\hline
\multirow{2}{=}{\textbf{A}} & \multirow{2}{=}{\textbf{B}} & \multirow{2}{=}{\textbf{C}}
& \multirow{2}{=}{\textbf{D} \\ [kg]} & \multirow{2}{=}{\textbf{E} \\ [kg]} & \multirow{2}{=}{\textbf{F} \\ [kg]}
& \multirow{2}{=}{\textbf{G} \\ [kg]} & \multirow{2}{=}{\textbf{H} \\ [kg]} & \multirow{2}{=}{$\mathbf{\alpha}$ \\ [\%]}
& \multirow{2}{=}{$\mathbf{\beta}$ \\ [\%]} & \multirow{2}{=}{$\mathbf{\gamma}$ \\ [s]} & \multirow{2}{=}{$\mathbf{\Delta}$ \\ [m/s]} \\
\hline
\endhead
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
A & B & C & D & E & F & G & H & I & 1 & 2 & 3 \\
\hline
\end{longtable}
\end{landscape}
\end{document}
It basically causes LaTeX to vomit any number of error messages, as shown below. While I'm mostly clueless to many of the "programmatic" aspects of LaTeX, I can tell that many of these errors seem generic.
Misplaced \noalign. \hline
Misplaced \omit. \multirow
Extra alignment tab has been changed to \cr. \multirow
Missing number, treated as zero. & \multirow{2}{=}{\textbf{D} \\ [kg]}
Illegal unit of measure (pt inserted). & \multirow{2}{=}{\textbf{D} \\ [kg]}
Missing number, treated as zero. ... & \multirow{2}{=}{\textbf{E} \\ [kg]}
Illegal unit of measure (pt inserted). ... & \multirow{2}{=}{\textbf{E} \\ [kg]}
Missing number, treated as zero. ... & \multirow{2}{=}{\textbf{F} \\ [kg]}
Illegal unit of measure (pt inserted). ... & \multirow{2}{=}{\textbf{F} \\ [kg]}
Missing number, treated as zero. & \multirow{2}{=}{\textbf{G} \\ [kg]}
Illegal unit of measure (pt inserted). & \multirow{2}{=}{\textbf{G} \\ [kg]}
Missing number, treated as zero. ... & \multirow{2}{=}{\textbf{H} \\ [kg]}
Illegal unit of measure (pt inserted). ... & \multirow{2}{=}{\textbf{H} \\ [kg]}
Illegal unit of measure (pt inserted). ...\multirow{2}{=}{$\mathbf{\alpha}$ \\ [\%]}
Illegal unit of measure (pt inserted). ... \multirow{2}{=}{$\mathbf{\beta}$ \\ [\%]}
Missing number, treated as zero. ... \multirow{2}{=}{$\mathbf{\gamma}$ \\ [s]}
Illegal unit of measure (pt inserted). ... \multirow{2}{=}{$\mathbf{\gamma}$ \\ [s]}
Missing number, treated as zero. ...multirow{2}{=}{$\mathbf{\Delta}$ \\ [m/s]}
Illegal unit of measure (pt inserted). ...multirow{2}{=}{$\mathbf{\Delta}$ \\ [m/s]}
Missing number, treated as zero. & \multirow{2}{=}{\textbf{D} \\ [kg]}
Illegal unit of measure (pt inserted). & \multirow{2}{=}{\textbf{D} \\ [kg]}
Missing number, treated as zero. ... & \multirow{2}{=}{\textbf{E} \\ [kg]}
Illegal unit of measure (pt inserted). ... & \multirow{2}{=}{\textbf{E} \\ [kg]}
Missing number, treated as zero. ... & \multirow{2}{=}{\textbf{F} \\ [kg]}
Illegal unit of measure (pt inserted). ... & \multirow{2}{=}{\textbf{F} \\ [kg]}
Missing number, treated as zero. & \multirow{2}{=}{\textbf{G} \\ [kg]}
Illegal unit of measure (pt inserted). & \multirow{2}{=}{\textbf{G} \\ [kg]}
Missing number, treated as zero. ... & \multirow{2}{=}{\textbf{H} \\ [kg]}
Illegal unit of measure (pt inserted). ... & \multirow{2}{=}{\textbf{H} \\ [kg]}
Illegal unit of measure (pt inserted). ...\multirow{2}{=}{$\mathbf{\alpha}$ \\ [\%]}
Illegal unit of measure (pt inserted). ... \multirow{2}{=}{$\mathbf{\beta}$ \\ [\%]}
Missing number, treated as zero. ... \multirow{2}{=}{$\mathbf{\gamma}$ \\ [s]}
Illegal unit of measure (pt inserted). ... \multirow{2}{=}{$\mathbf{\gamma}$ \\ [s]}
Missing number, treated as zero. ...multirow{2}{=}{$\mathbf{\Delta}$ \\ [m/s]}
Illegal unit of measure (pt inserted). ...multirow{2}{=}{$\mathbf{\Delta}$ \\ [m/s]}
No file texstudio_tEAINe.aux.
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (37.0pt too high) detected
Overfull \vbox (37.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \hbox (6265.24237pt too wide) in alignment
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (37.0pt too high) detected
Overfull \vbox (37.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \vbox (12.0pt too high) detected
Overfull \hbox (6265.24237pt too wide) in alignment
Overfull \hbox (6265.24237pt too wide) in alignment
Label(s) may have changed. Rerun to get cross-references right.
I'm amenable to any solution which gets this table properly working (i.e. a longtable with per-page headers in landscape format). During some of my homework for this question, I found some solutions such as this one using \thead
with line breaks that would seem to address the issue, but after a night of debugging one approach I'm wary of trying another without some assistance first.
Thanks for any help anyone can provide.