1

There is error message found on overleaf as follows:

unclosed $ found at close group }

unclosed $ found at close group }

unexpected close group } after $

unexpected close group } after $

Here is the code:

\documentclass[journal]{IEEEtran}
\usepackage{caption}
\begin{document}

\begin{table}
\centering
   \caption{Computational time comparison for hybrid configuration}
\begin{tabular}{*{3}{|>{$}c<{$}}|}
 \hline
 \multirow{2}[t 3]*{\textbf{wafer flow}} 
   &  \multicolumn{2}{c|}{\textbf{computational time (seconds)}}\\
 \cline{2-3}
   & \textbf{MIP II model} & \textbf{Z sequence}  \\
 \hline
 $[2]$  & 198 & 0.11 \\
 \hline
 $[3]$  & 204 & 0.11 \\
 \hline
 $[1,2]$  & 375 & 0.12\\
 \hline
 $[1,3]$  & 367 & 0.13\\
 \hline
 $[1,2,1]$  & 756 & 0.13\\
 \hline
 $[1,2,2]$  & 861 & 0.14\\
 \hline
 $[1,3,1]$  & 732 & 0.13\\
 \hline
 $[1,2,1,1]$  & 1288 & 0.13\\
 \hline
 $[1,3,1,1]$  & 1314 & 0.13\\
 \hline
 $[1,2,1,2]$  & 1538 & 0.15\\
 \hline
 $[1,2,2,1]$  & 1450 & 0.14\\
 \hline
 $[1,2,2,2]$  & 1444 & 0.14\\
 \hline
 $[1,3,2,1]$  & 1387 & 0.15\\
 \hline
 $[1,2,1,1,1]$  & 2381 & 0.13\\
 \hline
\end{tabular}
\label{table_computational_time_hybrid} 
\end{table}

Can anyone let me know what needs to be revised for the line: \begin{tabular}{*{3}{|>{$}c<{$}}|} ?

Thank you.

1
  • 3
    To make your code compilable, the array and multirow packages must be loaded.
    – Mico
    Oct 2 at 5:29

2 Answers 2

2

To make the OP's code compilable, it's necessary to load the array and multirow packages as well.

The need for the array package arises because of the column type specification >{$}c<{$}, for automatic math mode. It's a bit mysterious as to why the column contents are supposed to be rendered in math mode. I wouldn't do it.

Do also consider giving the table a much more open "look" -- by omitting all vertical rules and using fewer, but well-spaced, horizontal lines. I'd also avoid the rather vulgar-looking boldfacing of the header rows.

enter image description here

\documentclass[journal]{IEEEtran}
\usepackage{booktabs,lipsum}
\begin{document}

\begin{table}
\centering
\caption{Computational time comparison for hybrid configuration}

\begin{tabular}{@{} ccc @{}}
 \toprule
 Wafer flow & \multicolumn{2}{c@{}}{Computational time (seconds)}\\
 \cmidrule(l){2-3}
 & MIP II model & Z sequence \\ 
 \midrule {}
 [2]        &  198 & 0.11\\ {} 
 [3]        &  204 & 0.11\\ {} 
 [1,2]      &  375 & 0.12\\ {}
 [1,3]      &  367 & 0.13\\ {} 
 [1,2,1]    &  756 & 0.13\\ \addlinespace {}
 [1,2,2]    &  861 & 0.14\\ {} 
 [1,3,1]    &  732 & 0.13\\ {} 
 [1,2,1,1]  & 1288 & 0.13\\ {}
 [1,3,1,1]  & 1314 & 0.13\\ {}
 [1,2,1,2]  & 1538 & 0.15\\ \addlinespace {} 
 [1,2,2,1]  & 1450 & 0.14\\ {}
 [1,2,2,2]  & 1444 & 0.14\\ {}
 [1,3,2,1]  & 1387 & 0.15\\ {}
 [1,2,1,1,1]& 2381 & 0.13\\
 \bottomrule
\end{tabular}
\label{table_computational_time_hybrid} 
\end{table}

\lipsum % filler text
\end{document}
0

First let's fix the main problems.

  1. caption is incompatible with IEEEtran

  2. You need array in order to use >{...}

  3. You need multirow for \multirow.

  4. \label should be just after \caption (or inside the argument thereof), the best place for maintenance.

  5. use siunitx features for tabular data

Now your table would look

\begin{tabular}{| c | S[table-format=4.0] | S[table-format=1.2] |}
 \hline
 \multirow{2}[t 3]*{\textbf{wafer flow}}
   &  \multicolumn{2}{c|}{\textbf{computational time (seconds)}}\\
 \cline{2-3}
   & \textbf{MIP II model} & \textbf{Z sequence}  \\
 \hline
 $[2]$  & 198 & 0.11 \\
 \hline
 $[3]$  & 204 & 0.11 \\
 \hline
 $[1,2]$  & 375 & 0.12\\
 \hline
 $[1,3]$  & 367 & 0.13\\
 \hline
 $[1,2,1]$  & 756 & 0.13\\
 \hline
 $[1,2,2]$  & 861 & 0.14\\
 \hline
 $[1,3,1]$  & 732 & 0.13\\
 \hline
 $[1,2,1,1]$  & 1288 & 0.13\\
 \hline
 $[1,3,1,1]$  & 1314 & 0.13\\
 \hline
 $[1,2,1,2]$  & 1538 & 0.15\\
 \hline
 $[1,2,2,1]$  & 1450 & 0.14\\
 \hline
 $[1,2,2,2]$  & 1444 & 0.14\\
 \hline
 $[1,3,2,1]$  & 1387 & 0.15\\
 \hline
 $[1,2,1,1,1]$  & 2381 & 0.13\\
 \hline
\end{tabular}

and the output would be

enter image description here

If I leave caption I get

enter image description here

which is definitely not what IEEE seems to want. On the other hand, they seem happy when math is typeset in Computer Modern and text in Times 😱, so I also suggest to fix this issue.

enter image description here

However, this doesn't look good at all. First of all, the boldface headers clearly conflict with the caption style (small caps) and the vertical rules are really bad.

Final version

\documentclass[journal]{IEEEtran}
\usepackage{newtxtext,newtxmath}
%\usepackage{caption} % <--- not compatible with IEEEtran
\usepackage{array}% <--- for the >{...}x<{...} syntax
%\usepackage{multirow}% <--- for \multirow (but you never need it)
\usepackage{siunitx}% <--- for tabular data
\usepackage{booktabs}% <--- for better tables

\begin{document}

\begin{table}
\centering

\caption{Computational time comparison for hybrid configuration}
\label{table_computational_time_hybrid} 

\begin{tabular}{ @{} c S[table-format=4.0] S[table-format=1.2] @{} }
\toprule
Wafer flow & \multicolumn{2}{c@{}}{Computational time (s)} \\
\cmidrule{2-3}
& {MIP II model} & {Z sequence} \\
\midrule
 $[2]$  & 198 & 0.11 \\
 $[3]$  & 204 & 0.11 \\
 $[1,2]$  & 375 & 0.12\\
 $[1,3]$  & 367 & 0.13\\
 $[1,2,1]$  & 756 & 0.13\\
 $[1,2,2]$  & 861 & 0.14\\
 $[1,3,1]$  & 732 & 0.13\\
 $[1,2,1,1]$  & 1288 & 0.13\\
 $[1,3,1,1]$  & 1314 & 0.13\\
 $[1,2,1,2]$  & 1538 & 0.15\\
 $[1,2,2,1]$  & 1450 & 0.14\\
 $[1,2,2,2]$  & 1444 & 0.14\\
 $[1,3,2,1]$  & 1387 & 0.15\\
 $[1,2,1,1,1]$  & 2381 & 0.13\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .