1

I am working on quite large document, then at a point I used the \begin{landscape} and created a table on landscaped page.

But then later, I kept getting Misplaced \omit. error. All answers similar to this question didn't fix the problem. Error message:

Misplaced \omit.

\multispan ->\omit 
                   \@multispan 
l.298 \chapter
              {Methodology}
I expect to see \omit only after tab marks or the \cr of
an alignment. Proceed, and I'll ignore this case.

The following MWE reproduce the problem:

\documentclass[a4paper, 10pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{floatrow}
\newfloatcommand{capbtabbox}{table}[][\FBwidth]
\usepackage{caption}
\usepackage{booktabs}
\usepackage{floatrow}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}
\usepackage{tabulary}
\usepackage{float}
\restylefloat{table}

\newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}

\title{Replicate problem}
\author{The Author }
\date{November 2019}

\begin{document}

\maketitle

\chapter{Introduction}
This is the first chapter....


\afterpage{
    \clearpage
    \thispagestyle{empty}
    \begin{landscape}
        \centering 
        \begin{table}
        \RawFloats
        \label{distance-duration}
        \begin{tabular}{lccccccr}
            \toprule
            \multicolumn{1}{m{1.7cm}}{\textbf{Author(s)}  }  & \multicolumn{1}{m{1.5cm}}{\textbf{modes detected} } & \textbf{Classifier used}  & \textbf{Features}   & \multicolumn{1}{m{1.5cm}}{\textbf{Population}  }  & \multicolumn{1}{m{2cm}}{\textbf{External Data used}  }  & \textbf{Period} & \textbf{Accuracy} \\
            \midrule


        Author 1 & 4 & DT & \multicolumn{1}{m{4cm}}{distance, velocity \& acceleration statistics} & 45 users [GeoLife] & No &6 months & 72.80\%\\
        \hline

    Author 2 &5 & Fuzzy engine &speed  \multicolumn{1}{m{4cm}}{acceleration statistics} &4,882 users &No &6.65 days & N/A\\
        \bottomrule
        \end{tabular}
         \hfill
        \end{table} 
        \captionof{table}{A summary of previous studies and methods employed \textit{(*N/A = Not available)}.} 
    \end{landscape}
    \clearpage
}

\end{document}
  • 1
    speed \multicolumn is wrong, \multicolumn must always be the first thing in a cell. – Ulrike Fischer Nov 6 '19 at 20:11
  • Why not use \begin{tabular}{lccm{4cm}cccr} directly and get rid of the repeated \multiroclumn{1} commands? I'd also recommend using \thead or \makecell from the makecell` package for the column headers instead of the \multicolumn command there. – leandriis Nov 6 '19 at 20:27
  • Please also explain the reason for combining table and \captionof. – leandriis Nov 6 '19 at 20:31
2

I'd suggest the following based on a combination of tabularx and makecell:

enter image description here

\documentclass[a4paper, 10pt]{report}

\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{afterpage}

\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize\bfseries}

\usepackage{tabularx}
\renewcommand\tabularxcolumn[1]{m{#1}}



\begin{document}

\afterpage{
    \clearpage
    \thispagestyle{empty}
    \begin{landscape}
        \centering 
        \begin{table}
        \caption{A summary of previous studies and methods employed \textit{(*N/A = Not available)}.} 
        \label{distance-duration}
        \begin{tabularx}{\linewidth}{lccXcccr}
            \toprule
            \thead{Author(s)}  & \thead{modes\\ detected} & \thead{Classifier used}  & \thead{Features}   & \thead{Population}  & \thead{External\\ Data used}  & \thead{Period} & \thead{Accuracy} \\
            \midrule
        Author 1 & 4 & DT & distance, velocity \& acceleration statistics & 45 users [GeoLife] & No &6 months & 72.80\%\\
        \midrule
    Author 2 &5 & Fuzzy engine &  speed acceleration statistics &4,882 users &No &6.65 days & N/A\\
        \bottomrule
        \end{tabularx}
         \hfill
        \end{table} 
    \end{landscape}
    \clearpage
}

\end{document}
0

Based on the first comment to my question (speed \multicolumn is wrong) I noticed that I mistakenly typed speed \multicolumn{1}{m{4cm}}{acceleration statistics} when I actually wanted to type \multicolumn{1}{m{4cm}}{ speed acceleration statistics}.

My fault, fixing this solves the problem.

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.