我以为这应该相当简单。但是,对于直接放在表格中的文本,不会显示行号。
奇怪的是,当使用生成文本时lipsum
,会显示行号。
这是 MWE,应该是不言自明的:
\documentclass{article}
\usepackage{lineno}
\linenumbers
\usepackage{array}
\usepackage{longtable}
\usepackage{lipsum}
\begin{document}
\section{Simple Text}
\lipsum[1]
\section{Direct Text in Table}
Line numbers will \textit{not} be shown in the texts in the following table:
\begin{longtable}{l>{\raggedright\internallinenumbers}p{0.20\textwidth}}
A&Line numbers are not shown for this text, we need to solve
this\tabularnewline
\end{longtable}
\section{Text in Table Using \texttt{lipsum}}
Line numbers will be shown in the texts in the following table:
\begin{longtable}{l>{\raggedright\internallinenumbers}p{0.75\textwidth}}
A&\lipsum[2]
\end{longtable}
\section{Simple Text Again}
\lipsum[3]
\end{document}
(如果相关的话,我的文本将使用csvsimple
或来输入。)datatool