我观察到在 latex 中,单栏文档的行号是从标题开始算的,而双栏文档的行号是从正文开始算的。我希望双栏文档的行号也能从标题开始算,是吗,如果是的话,该如何修改?
\documentclass{article}
\usepackage{lipsum}
\usepackage{lineno}
\linenumbers
\begin{document}
\title{The Triangulation of Titling Data in Non-Linear Gaussian Fashion via $\rho$ Series\thanks{No procrastination}}
\date{2017\\ December}
\author{John Doe\\ Magic Department\thanks{I am no longer a member of this department}, Richard Miles University
\and Richard Row, \LaTeX\ Academy}
\maketitle
\lipsum
\end{document}
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{lineno}
\linenumbers
\begin{document}
\title{The Triangulation of Titling Data in Non-Linear Gaussian Fashion via $\rho$ Series\thanks{No procrastination}}
\date{2017\\ December}
\author{John Doe\\ Magic Department\thanks{I am no longer a member of this department}, Richard Miles University
\and Richard Row, \LaTeX\ Academy}
\maketitle
\lipsum
\end{document}
答案1
一个可行的解决方案,虽然不是完全自动化的:插入指令
\addtocounter{linenumber}{6} % or whatever number is appropriate
紧接着\maketitle
。需要注意的是:这不会显示\title
、\author
和\date
宏内容的行号。我相信您的读者会理解。
如果twocolumn
文档类选项有效,我会使用lineno
选项加载包switch
,以便在每页的右侧列的右侧(显然,在左侧列的左侧)显示行号。
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\makeatletter
\if@twocolumn
\usepackage[switch]{lineno} % load with 'switch' option
\addtocounter{linenumber}{6} % increment line number as needed
\else
\usepackage{lineno}
\fi
\makeatother
\linenumbers
\begin{document}
\title{The triangulation of titling data in \\
nonlinear Gaussian fashion via $\rho$ series%
\thanks{No procrastination}}
\author{John Doe\\ Magic Department, Richard Miles University%
\thanks{I am no longer a member of this department}
\and Richard Row\\ \LaTeX\ Academy}
\date{2017\\ December}
\maketitle
\lipsum[1-50]
\end{document}