2.问题:
- 如何将“续表”和 \caption 文本左对齐?在这种情况下 \raggedright 不起作用。
- 如何删除枚举器前的空行?
源代码:
\documentclass{article}
\usepackage{longtable}
\usepackage{array}
\title{A longtable example}
\begin{document}
\begin{longtable}{| >{\raggedright}p{0.20\linewidth}
| >{\raggedright}p{0.28\linewidth}
| >{\raggedright}p{0.28\linewidth}
| >{\raggedright\arraybackslash}p{0.12\linewidth}|}
\caption{A sample long table.} \label{tab:long} \\
First column & First column & First column & First column \\
\endfirsthead
\multicolumn{3}{c}%
{{ \raggedleft \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{|c|}{{First column}} & \multicolumn{1}{c|}{{Second column}} & \multicolumn{1}{c|}{{Third column}} & \multicolumn{1}{c|}{{Third column}} \\ \hline
\endhead
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
Login-1 & \begin{enumerate}
\item[1)] step1;
\item[2)] step2;
\end{enumerate}
& Doing something & yes \\
\hline
\end{longtable}
\end{document}
答案1
\multicolumn{3}{c}%
{{ \raggedleft \tablename\ \thetable{} -- continued from previous page}} \\
列c
是一个水平框,\mbox
因此段落设置\raggedleft
无效,你大概想要
\multicolumn{3}{r}%
{\tablename\ \thetable{} -- continued from previous page} \\
获得齐平的右侧入口。