2

In my preamble, I declared:

...    
\usepackage{cite}
\usepackage{color}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{float}
\usepackage{array}
\usepackage{makecell}
\usepackage{multirow}

\newcolumntype{c}[1]{>{\centering\arraybackslash}p{#1}}
\captionsetup{justification=centering}

\renewcommand\theadalign{cc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
%\renewcommand\cellgape{\Gape[4pt]}

\newcommand{\todo}[1]{\textcolor{red}{#1}}
\newcommand{\new}[1]{\textcolor{blue}{#1}}
...

and in a tex file, I'm creating a table such as:

\begin{table*}
\centering
\begin{tabular}{|c{13mm}|c{23mm}|c{15mm}|c{15mm}|c{15mm}|c{15mm}|c{15mm}|c{15mm}|c{15mm}|}
    \hline
    \multirow{2}{*}{Functionality} & \multirow{2}{*}{Message Field Type} & \multicolumn{6}{c{90mm}|}{\# of bits assigned to each field (‘b’ = message body, ‘h’ = message header, ‘v’ = variable size)} & \multirow{2}{*}{XXX} \\ 
    \cline{3-8}
    & & 1 & 1 & 1 & 1 & 1 & 1 & \\
    \hline
    1  & \makecell{Service\\ Type} & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    \hline
    2  &  Target Address  & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    \hline
    3  &  Version Info. & 1 & 1 & 1 & 1 & 1 & 1 & 1  \\
    \hline
    4  &  Return Code & 1 & 1 & 1 & 1 & 1 & 1 & 1  \\
    \hline
    5  &  Message Type (op-code) & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    \hline
\end{tabular}
\caption{Semantics of Adaptation Probability Tree Nodes with Different Depths}
\label{table:adapt-prob-tree-semantics}
\end{table*}

I declared \usepackage{makecell} in preamble, but when I use \makecell{} in the table, I've got an error message:

Undefined control sequence. \GenericError  ...                        

                                                   #4  \errhelp \@err@     ... l.10     1  & \makecell{Service\\ Type}
                                     & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\

Anybody knows why I get this error message?

4
  • that error message does not say that \makecell is undefined, it just suggests a syntax error probably misuse of \\ It would be easier to test if you fixed your example above so that people could run it and debug the error. – David Carlisle Jan 5 '18 at 8:51
  • Thx for your answer. But even without using \\` , I mean even though I used \makecell{Service Type}, I still get the undefined control sequence error. That's why I thought \makecell is recognized as undefined by the Tex system (currently I'm using overleaf). – Heesuk C. Son Jan 5 '18 at 9:11
  • You declared a column type c which interferes with the standard column type c for centered columns. Change your custom column type to for example C or any other letter that is not associated with a standard column type and the error should disappear. – leandriis Jan 5 '18 at 9:16
  • @leandriis Your suggestion worked for me, thx!! – Heesuk C. Son Jan 5 '18 at 15:47
1

The error message you observe originates in your definition of the new column type c that interferes with the already declared standard, horizontally centered colum type that has the same name. So changing the custom colum type to for example C or any other letter that is not associated with a standard column type removes the error.

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.