0

I would appreciate if you could help me out resolving the issue with compiling the following code which is to draw a table:

\documentclass[preprint, authoryear]{elsarticle}

\journal{Journal of Transportation Research, Part E}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\usepackage{tikz}
\usepackage{lettrine}
\allowdisplaybreaks
\usepackage[export]{adjustbox}
\usepackage{ragged2e}
\usepackage{subfig}
\usepackage{float}
\usepackage{booktabs}
\usepackage{makecell, multirow}
\usepackage{tabularx}
%\usepackage{array}


\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\usepackage{url}
\urlstyle{same}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}

%% `Elsevier LaTeX' style
\bibliographystyle{elsarticle-harv}
%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\section{Introduction}\label{sec: intro}
Text text Text textText textText textText textText textText text
Text textText textText textText textText text Text textText textText textText textText textText textText textText textText textText textText textText textText textText text

Text text Text textText textText textText textText textText text
Text textText textText textText textText text Text textText textText textText textText textText textText textText textText textText textText textText textText textText text

\begin{table}[htb]
\caption{Computational Results: Case II, Comparative Results}
\label{label{tab: Case II, Comp}
\centering
    \begin{tabular}{S[table-format=1.2]
                    S[table-format=1.2]
                    S[table-format=1.2]
                *{2}S[table-format=1.5]
                    S[table-format=1.2]}
    \toprule
    {\multirow{2}{*}{\makecell{Model\\ Variant}}}
    & {\multirow{2}{*}{\makecell{AVG.\\ Time $(s)$}}}
    & {\multirow{2}{*}{\makecell{Cost\\ ($\$1E6$)}}}
    & \multicolumn{2}{c}{\makecell{Risk (persons $1E6$)}}
    & {\multirow{2}{*}{\makecell{No. of\\ Z}}} \\   
    \cmidrule{4-5}
    {}& {} & {} & {A} & {B} & {} \\
    \midrule
    {$P_{1}$} & 100 & 100 & 100 & 100 & 100\\
    {$P_{2}$} & 6.11 & 95.06 & 101.02 & 100 & 88.64\\
    \bottomrule
    \end{tabular}
\end{table}
\end{document}
4
  • 1
    You forgot to close the brackets in \label{label{tab: Case II, Comp}. Place the required }.
    – Cragfelt
    May 23, 2018 at 1:30
  • 4
    @Cragfelt I guess you wanted to say the OP should not nest labels, i.e. just use \label{tab: Case II, Comp} instead of \label{label{tab: Case II, Comp}, right?
    – user121799
    May 23, 2018 at 3:31
  • @marmot No, I did not mean that. My comment explains by itself.
    – Cragfelt
    May 23, 2018 at 15:27
  • Is not mandatory that the labels must look like secure passwords with both upper and lowercase characters, signs of punctuation, spaces and curly braces. A short key easy to remember usually is less problematic.
    – Fran
    May 24, 2018 at 21:01

0

You must log in to answer this question.

Browse other questions tagged .