1

I am new to latex and I am trying to use multirow but it does not seem to work! It is not merging the rows and it's giving me a text when I define an empty cell for the merge. I also get an undefined control sequence

Here is the code:

\begin{table}[htb]
    \centering
    \begin{tabular}{|c|c|l|}
    \hline
    \multicolumn{3}{|c|}{\rule{0pt}{14pt} \textbf{{\large Tactical Planning (SND)}}} \\ \hline
    \multirow{2}{|c|}{{}} & \textbf{Reference} & \qquad \qquad \textbf{Solution Approach} \\ \hline
                        & \multicolumn{2}{|c|} {\rule{0pt}{12pt} \textbf{{Dynamic SND with a variable network structure}}} \\ \hline
    Deterministic       & \cite{bai_optimisation_2018,crainic_modeling_2015,inghels_service_2016,li_design-balanced_2017} & Mixed-integer programming \\ \hline
    Stochastic & \cite{bai_stochastic_2014,hewitt_scheduled_2019,hoff_metaheuristic_2010,wang_stochastic_2019} & Two-stage stochastic programming \\ \hline
    & \multicolumn{2}{|c|}{\rule{0pt}{12pt} \textbf{{Dynamic SND with a given network structure}}} \\ \hline
    \multirow{2}{|c|}{Deterministic} & \cite{duan_freight_2019}& Mixed-integer nonlinear programming \\ \hline
                                    &\cite{heggen_intermodal_2019,sun_bi-objective_2019} & Mixed integer programming \\ \hline
    \multirow{3}{|c|}{Stochastic} &\cite{hui_airfreight_2014, meng_carrying_2015} & Two-stage stochastic programming \\ \hline
                                & \cite{hrusovsky_hybrid_2018,layeb_simulation-optimization_2018,zhang_synchromodal_2016} & Simualtion/simulation optimization \\ \hline
                                &\cite{demir_green_2016,sun_bi-objective_2019,zhao_chance-constrained_2018} & Mixed integer programming \\ \hline
    & \multicolumn{2}{|c|}{\rule{0pt}{12pt} \textbf{{Non-dynamic SND with a given network structure}}} \\ \hline
    Deterministic & \cite{katayama_combined_2019,tawfik_bilevel_2019,wang_hybrid_2019,zetina_profit-oriented_2019} & Mixed integer programming \\ \hline
    Stochastic & \cite{gao_uncertain_2016,rahmaniani_accelerating_2018,sun_stochastic_2017} & Two-stage stochastic programming\\ \hline
    \end{tabular}
    \caption{Tactical Planning Problems (SND) and Solution Methodologies}
    \label{tab:tacticalsnd}
\end{table}

This is the table I get enter image description here

and this is the table I would like to have (this was on MS word): enter image description here

FHZ
  • 3,939

2 Answers2

1

Like this?

    \documentclass{article}
    \usepackage{multirow}
    \usepackage{cite}
\begin{document}

\begin{table}[htb]
    \centering
    \begin{tabular}{|c|c|l|}
    \hline
    \multicolumn{3}{|c|}{\rule{0pt}{14pt} \textbf{{\large Tactical Planning (SND)}}} \\ \hline
    \multirow{2}{*}{{}} & \textbf{Reference} & \qquad \qquad \textbf{Solution Approach} \\ \hline
                        & \multicolumn{2}{|c|} {\rule{0pt}{12pt} \textbf{{Dynamic SND with a variable network structure}}} \\ \hline
    Deterministic & \cite{bai_optimisation_2018,crainic_modeling_2015,inghels_service_2016,li_design-balanced_2017} & Mixed-integer programming \\ \hline
    Stochastic & \cite{bai_stochastic_2014,hewitt_scheduled_2019,hoff_metaheuristic_2010,wang_stochastic_2019} & Two-stage stochastic programming \\ \hline
    & \multicolumn{2}{|c|}{\rule{0pt}{12pt} \textbf{{Dynamic SND with a given network structure}}} \\ \hline
    \multirow{2}{*}{Deterministic} & \cite{duan_freight_2019}& Mixed-integer nonlinear programming \\ \cline{2-3}
                                    &\cite{heggen_intermodal_2019,sun_bi-objective_2019} & Mixed integer programming \\ \hline
    \multirow{3}{*}{Stochastic} &\cite{hui_airfreight_2014, meng_carrying_2015} & Two-stage stochastic programming \\ \cline{2-3}
                                & \cite{hrusovsky_hybrid_2018,layeb_simulation-optimization_2018,zhang_synchromodal_2016} & Simualtion/simulation optimization \\ \cline{2-3}
                                &\cite{demir_green_2016,sun_bi-objective_2019,zhao_chance-constrained_2018} & Mixed integer programming \\ \hline
    & \multicolumn{2}{|c|}{\rule{0pt}{12pt} \textbf{{Non-dynamic SND with a given network structure}}} \\ \hline
    Deterministic & \cite{katayama_combined_2019,tawfik_bilevel_2019,wang_hybrid_2019,zetina_profit-oriented_2019} & Mixed integer programming \\ \hline
    Stochastic & \cite{gao_uncertain_2016,rahmaniani_accelerating_2018,sun_stochastic_2017} & Two-stage stochastic programming\\ \hline
    \end{tabular}
    \caption{Tactical Planning Problems (SND) and Solution Methodologies}
    \label{tab:tacticalsnd}
\end{table}

\end{document} 

enter image description here

Bernard
  • 271,350
1

Or like this:

enter image description here

With tabularray package is simple:

\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}

\begin{document} \begin{table}[htb] \centering \begin{tblr}{hlines, vlines, colspec = {ccl}, row{1-3} = {font=\bfseries, c, bg=gray9} } \SetCell[c=3]{font=\large\bfseries} Tactical Planning (SND) & & \ & Reference & Solution Approach \ \SetCell[c=3]{font=\bfseries} Dynamic SND with a variable network structure
& & \ Deterministic & \cite{bai_optimisation_2018,crainic_modeling_2015,inghels_service_2016,li_design-balanced_2017} & Mixed-integer programming \ Stochastic & \cite{bai_stochastic_2014,hewitt_scheduled_2019,hoff_metaheuristic_2010,wang_stochastic_2019} & Two-stage stochastic programming \
\SetCell[c=3]{font=\bfseries, bg=gray9} Dynamic SND with a given network structure & & \
\SetCell[r=2]{c} Deterministic & \cite{duan_freight_2019} & Mixed-integer nonlinear programming \
& \cite{heggen_intermodal_2019,sun_bi-objective_2019} & Mixed integer programming \
\SetCell[r=3]{c} Stochastic & \cite{hui_airfreight_2014, meng_carrying_2015} & Two-stage stochastic programming \
& \cite{hrusovsky_hybrid_2018,layeb_simulation-optimization_2018,zhang_synchromodal_2016} & Simualtion/simulation optimization \ &\cite{demir_green_2016,sun_bi-objective_2019,zhao_chance-constrained_2018} & Mixed integer programming \ \SetCell[c=3]{font=\bfseries, bg=gray9} Non-dynamic SND with a given network structure & & \ Deterministic & \cite{katayama_combined_2019,tawfik_bilevel_2019,wang_hybrid_2019,zetina_profit-oriented_2019} & Mixed integer programming \ Stochastic & \cite{gao_uncertain_2016,rahmaniani_accelerating_2018,sun_stochastic_2017} & Two-stage stochastic programming \ \end{tblr} \caption{Tactical Planning Problems (SND) and Solution Methodologies} \label{tab:tacticalsnd} \end{table} \end{document}

Zarko
  • 296,517