1

I have observed that in latex, the line number count of a single-column document starts from the title, but the line number count of a double-column document starts from the main text. I hope that the line number of a double-column document can also start from the title. Is it, if so, how to modify it?

\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}

enter image description here

\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}

enter image description here

1
  • by the way, since I have a large number of latex files that need to do the same, I want this process to be automated.
    – happy
    Commented Dec 30, 2021 at 6:21

1 Answer 1

1

A workable, though alas not entirely automatic, solution: Insert the instruction

\addtocounter{linenumber}{6} % or whatever number is appropriate

immediately after \maketitle. A caveat: This won't display line numbers for contents of the \title, \author, and \date macros. I trust your readers will manage.

If the twocolumn document class option is in effect, I'd load the lineno package with the option switch, in order to get line numbers displayed to the right of the right-hand columns (and, obviously, to the left of the left-hand columns) on each page.

enter image description here

\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}
2
  • Thanks for your answer, but I have a large number of such files to deal with, so this solution may not be suitable
    – happy
    Commented Dec 30, 2021 at 2:44
  • No, it is worth keeping.
    – happy
    Commented Dec 30, 2021 at 2:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .