1

I'm getting an error on latex. ... The purpose was to create some tables on latex, but it is getting me some error which i don't really understand.Actually,one time I create this table on a latex file without problem, but when I copy it to anther file, It shows error:( ... Any hint for me please ? Thank you in advance :)

error: use of @array does not match its definition Argumant of @firstoftwo has an extra } use of @argtabular cr does not match its definition missing number treated as zero Illegal unit od measures (pt inserted) code:

\begin{table}[hbtp]
\centering{}\caption{A brief review of previous studies on the GVRP}
\noindent\resizebox{\textwidth}{!}{%%
\begin{tabular}{|>{\centering}m{2.7cm}|>{\centering}b{2.5cm}|>{\centering}p{2.5cm}|>{\centering}m{2.5cm}|c|}
\hline 
{\scriptsize{}Researchers} & {\scriptsize{}Customers\textquoteright{} Management Features} & {\scriptsize{}Stations Features} & {\scriptsize{}Vehicles Features} & {\scriptsize{}Distribution Management Features}\tabularnewline
\hline 
\hline 
{\scriptsize{}Conrad and Figliozzi 2011~\cite{key-10} } & {*} &  & {*} & \tabularnewline
\hline 
{\scriptsize{}Erdogan and Miler-Hooks 2012 ~\cite{key-4} } &  &  &  & \tabularnewline
\hline 
{\scriptsize{}Omidvar and Tavakkoli-Moghadam 2012~\cite{key-11} } & {*} &  & {*} & \tabularnewline
\hline 
{\scriptsize{}Schneider et al. 2014~\cite{key-12} } & {*} &  & {*} & \tabularnewline
\hline 
{\scriptsize{}Yang and Sun 2015~\cite{key-13} } &  & {*} & {*} & \tabularnewline
\hline 
{\scriptsize{}Felipe et al. ~~ ~~ 2014  ~\cite{key-14} } &  & {*} & {*} & \tabularnewline
\hline 
{\scriptsize{}Goeke and Schneider 2015~\cite{key-15}} & {*} &  & {*} & \tabularnewline
\hline 
{\scriptsize{}This research} &  &  &  & {*}\tabularnewline
\hline 
\end{tabular}}
\end{table}
  • Welcome, the snippet is not really useful, you should always post a compilable example to reproduce the exact error. Just to be completly sure, you did load package array? Without the package, the syntax used is not allowed. – Johannes_B Jul 16 '17 at 6:42
  • Apart from that, the generated table is just awful to look at. The choice of citekeys isn't very good and the way you are doing author and year is very bad. I recommend to read an introduction to LaTeX. – Johannes_B Jul 16 '17 at 6:44
  • thanks for you consideration. yes. I add the package "array" but the problem is not solved. maybe it is a problem with Elsevier template. when I add my table in it (i cannot change the format, but thanks for youe comment) , It shows the error : ( I decide to uploud every pakcage in template, maybe it works : ( – arghavan sharafi Jul 17 '17 at 8:25
3

The column types m and b are not defined in the LaTeX kernel. They are provided by package array, which needs to be loaded:

\usepackage{array}

Also:

  • The font size is much, much too small.
  • Too many lines, see the documentation of package booktabs.
  • \centering, \scriptsize, ... are commands without arguments. A simple space to end the command name if necessary will do, there is no need for a group ({}).
  • \textquoteright is not a apostrophe, the latter is just a simple '.
  • Tabular cells in latex form already a group, there is no need for an additional pair of braces here, e.g. & {*} && * &.
  • et al. 2014 has sentence space after the abbreviation al.. A normal space is set, if the space factor is reset by \@: et al.\@ 2014.

A suggestion:

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{ragged2e}
\usepackage{tabularx}
\newcommand*{\NarrowCell}{%
  \RaggedRight
  \hangafter=1
  \hangindent=1em\relax
}
\begin{document}
\begin{table}
  \centering
  \caption{A brief review of previous studies on the GVRP}
  \small % not smaller than \small
  \def\x#1{\begin{tabular}[b]{@{}c@{}}#1\end{tabular}}
  \begin{tabularx}{\linewidth}{>{\NarrowCell}Xcccc}
  \toprule
  Researchers
  & \x{Customers'\\ Management\\ Features}
  & \x{Stations\\ Features}
  & \x{Vehicles\\ Features}
  & \x{Distribution\\ Management\\ Features}
  \tabularnewline
  \midrule
  Conrad and Figliozzi 2011~\cite{key-10}
  & * &   & * & \tabularnewline
  \addlinespace
  Erdogan and Miler-Hooks 2012 ~\cite{key-4}
  &   &   &   & \tabularnewline
  \addlinespace
  Omidvar and Tavakkoli-Moghadam 2012~\cite{key-11}
  & * &   & * & \tabularnewline
  \addlinespace
  Schneider et al.\@ 2014~\cite{key-12}
  & * &   & * & \tabularnewline
  \addlinespace
  Yang and Sun 2015~\cite{key-13}
  &   & * & * & \tabularnewline
  \addlinespace
  Felipe et al.\@ 2014~\cite{key-14}
  &   & * & * & \tabularnewline
  \addlinespace
  Goeke and Schneider 2015~\cite{key-15}
  & * &   & * & \tabularnewline
  \addlinespace
  This research
  &   &   &   & * \tabularnewline
  \bottomrule
\end{tabularx}
\end{table}
\end{document}

Result

  • hello, thanks for your consideration. actually, I do not use latex. I am not able to use it. I use the lyx for creating my code. if i download the array package, I can correct my mistake yes??? moreover, about the size, the table go out of the page when I use another font.:( – arghavan sharafi Jul 17 '17 at 7:13
  • I add the package "array" , but the problem is not solved. it could perhaps be a problem with Elsevier template, could be???. when I add my table in it , It shows the error. I decide to upload every package in the template, maybe it works. – arghavan sharafi Jul 17 '17 at 8:27
  • It worksssssssssssss!!!!!!!!!!!!!!!! thank you so muchhhhhhhhhhhhhh my friend. – arghavan sharafi Jul 17 '17 at 13:49
  • excuse me...i have different error now. – arghavan sharafi Jul 17 '17 at 15:37
  • @arghavansharafi "different error" looks like a new question. This time with a minimal working example (MWE) (minimal, but complete), please. – Heiko Oberdiek Jul 17 '17 at 16:21

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.