下面的代码给出了以下错误:! Paragraph ended before \multicolumn was complete.
我试了好几次,但还是找不到我做错的地方。完全相同的表格在 MikTeX 中运行良好,但我现在正在使用 TeXmaker,它不起作用。是否有一个特殊的包需要我导入?
\begin{tabular}{ccc}
\includegraphics[scale=.2]{J48PerClass.eps} &
\includegraphics[scale=.2]{PARTCM.eps} &
\includegraphics[scale=.2]{SVMCM.eps} \\
\small{(a) J48} & \small{(b) PART} & \small{(c) SVM} \\
\includegraphics[scale=.2]{J48PCM.eps} &
\includegraphics[scale=.2]{PARTPCM.eps} &
\includegraphics[scale=.2]{MLPCM.eps} \\
\small{(d) J48 pruned} & \small{(e) PART pruned} & \small{(f) MLP} \\
\includegraphics[scale=.2]{NBCM.eps}& \multicolumn{2}{c}{
\raisebox{2.2cm}{\footnotesize{
\begin{tabular} {|l|l|}
\hline
a = SQL injection &l = Static \\
b = Denial of Service &m = Other attack\\
c = Spam on Wiki &n = Password cracking on Wiki \\
d = Spam on Blog &o = Spam on Wiki \\
e = Password cracking on Blog &p = Wiki \\
f = Other vulnerability scan &q = Blog \& Wiki \\
g = DFind &r = Blog \\
h = Other fingerprinting &s = Spam on Blog \\
i = (XSS) Cross site scripting & \\
j = (RFI) Remote file inclusion & \\
k = Static \& Blog \& & \\
\ \ \ \ \ Wiki & \\ \hline
\end{tabular}
}}}
\\
\small{(g) NB} & & \\
\end{tabular}
答案1
下面这行
\includegraphics[scale=.2]{NBCM.eps}& \multicolumn{2}{c}{
产生错误,因为后面跟着一个空行,这对于 TeX 来说意味着一个新段落。
答案2
尽管环境中通常允许有空行tabular
,但它们不在\multicolumn
.
你也有一些虚假的空间,我用标记<-- here
和保护行尾%
\begin{tabular}{ccc}
\includegraphics[scale=.2]{J48PerClass.eps} &
\includegraphics[scale=.2]{PARTCM.eps} &
\includegraphics[scale=.2]{SVMCM.eps} \\
\small{(a) J48} & \small{(b) PART} & \small{(c) SVM} \\
\includegraphics[scale=.2]{J48PCM.eps} &
\includegraphics[scale=.2]{PARTPCM.eps} &
\includegraphics[scale=.2]{MLPCM.eps} \\
\small{(d) J48 pruned} & \small{(e) PART pruned} & \small{(f) MLP} \\
\includegraphics[scale=.2]{NBCM.eps}& \multicolumn{2}{c}{% <-- here
\raisebox{2.2cm}{\footnotesize{% <-- here
\begin{tabular} {|l|l|}
\hline
a = SQL injection &l = Static \\
b = Denial of Service &m = Other attack\\
c = Spam on Wiki &n = Password cracking on Wiki \\
d = Spam on Blog &o = Spam on Wiki \\
e = Password cracking on Blog &p = Wiki \\
f = Other vulnerability scan &q = Blog \& Wiki \\
g = DFind &r = Blog \\
h = Other fingerprinting &s = Spam on Blog \\
i = (XSS) Cross site scripting & \\
j = (RFI) Remote file inclusion & \\
k = Static \& Blog \& & \\
\ \ \ \ \ Wiki & \\ \hline
\end{tabular}% <-- here
}}}
\\
\small{(g) NB} & & \\
\end{tabular}