\begin{longtable}{|lllllllll|}
% [ht]
\caption{Create } \\
%\label{step 3}
\hline
\multicolumn{3}{|l|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endfirsthead
\multicolumn{6}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\multicolumn{3}{|l|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endhead
\hline \multicolumn{6}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
% \begin{tabular} {lllllll}[ht]\\
% \hline \multicolumn{3}{|l|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}} \\ \hline
\multicolumn{7}{|l|}{\textbf{Begin}}\\ \hline
\multicolumn{7}{|l|}{\textbf{Initial}}\\ \hline
\parbox[|c|]{2cm}{
\includegraphics[scale=0.40,height=8 cm,width=10 cm]{initialfgist.jpg}} \\ \hline
\end{longtable}
图片的右侧和顶部边框没有显示出来。请告诉我我做错了什么?
答案1
\parbox[|c|]{2cm}{
\includegraphics[scale=0.40,height=8 cm,width=10 cm]
这指定了 2 厘米宽的盒子中 10 厘米宽的图像,因此预计会出现叠印。至少它会指定,如果是\parbox{2cm}
语法 \parbox[|c|]
错误(尽管 latex 不会报告这种错误),则可选参数只能是c
,t
或b
。
你只是想指定一scale
,和width
并且您根本height
不想要。\parbox
答案2
包cellspace
在这里:它定义了单元格顶部和底部的最小垂直间距,其中说明符以字母为前缀S
(或者C
如果您使用siunitx
)。我还简化了您的代码并纠正了错误的地方:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{graphicx}
\usepackage{array, longtable}
\usepackage{cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\begin{document}
\begin{longtable}{|*{7}{Sl}|}
\caption{Create } \\
%\label{step 3}
\hline
\multicolumn{3}{|Sl|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endfirsthead
\multicolumn{6}{Sc}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\multicolumn{3}{|Sl|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endhead
\hline \multicolumn{7}{Sr}{\textit{Continued on next page}} \\
\endfoot
\hline
\multicolumn{7}{|Sl|}{\textbf{Begin}}\\
\hline
\multicolumn{7}{|Sl|}{\textbf{Initial}}\\
\hline
\includegraphics[scale=0.40]{initialfgist.jpg} & & & & & & \\
\hline
\end{longtable}
\end{document}