如何调整双栏文档的行数从标题开始?

如何调整双栏文档的行数从标题开始?

我观察到在 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}

相关内容