![显示表格中文本的行号](https://linux22.com/image/363014/%E6%98%BE%E7%A4%BA%E8%A1%A8%E6%A0%BC%E4%B8%AD%E6%96%87%E6%9C%AC%E7%9A%84%E8%A1%8C%E5%8F%B7.png)
我以为这应该相当简单。但是,对于直接放在表格中的文本,不会显示行号。
奇怪的是,当使用生成文本时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