我在 latex 上遇到错误。... 目的是在 latex 上创建一些表格,但是它给我带来了一些我无法理解的错误。实际上,有一次我在 latex 文件上创建了这个表格,没有问题,但是当我将它复制到另一个文件时,它显示错误:( ... 请给我任何提示?提前谢谢 :)
错误:@array 的使用与其定义不匹配@firstoftwo 的参数有一个额外的} @argtabular cr 的使用与其定义不匹配缺少的数字被视为零非法单位 od 测量(插入 pt)代码:
\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}
答案1
列类型m
和b
未在 LaTeX 内核中定义。它们由包提供array
,需要加载:
\usepackage{array}
还:
- 字体大小为很多,很多太小。
- 行太多,请参阅包的文档
booktabs
。 \centering
、\scriptsize
、 ... 是没有参数的命令。如果需要,只需用空格结束命令名称即可,无需使用组 ({}
)。\textquoteright
是不是撇号,后者只是一个简单的'
。- 乳胶中的表格单元已经形成一个组,这里不需要额外的括号,例如
& {*} &
→& * &
。 et al. 2014
缩写后有句子空间。如果空间因子被重置为: ,al.
则设置正常空间。\@
et al.\@ 2014
一条建议:
\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}