2

I need to number all lines for paper submission but no available answer until now covers this.

the closest one is this one How to number all lines in a draft? but there is no available code.

Lineno as package skips floats so it is not a solution.

I would need to number everything including title, authors, images, equations.

Anyone has code to share?

D.A.
  • 41
  • Do figures even have lines? The solution in https://tex.stackexchange.com/questions/16010/number-every-line-of-pages/16012#16012 simply added a line number every \baselineskip regardless of the text., which will probably do for an editor who wants every line numbered. – John Kormylo Sep 23 '21 at 22:38
  • What a peculiar requirement; is this one of the strange things that Word does? The more usual request is to give the total number of lines which is normally done by counting the number of lines on a typical page and multiply by the number of pages. – Peter Wilson Sep 24 '21 at 17:07
  • @Peter Wilson is a normal requirement for paper submission. i.e number all lines including figures. I usually use a specific template which has this but this journal wants another one which does not have line number included – D.A. Sep 24 '21 at 22:39
  • @JohnKormylo I have seen that but there is no description on how to make it sequential – D.A. Sep 24 '21 at 22:40
  • @D.A. Could you say which journal wants every line numbered? My first technical paper was published in the mid-1960s. Sine then I have had many other papers published in a variety of technical journals, been the editor of an IEEE technical journal, and have had technical books published. In over half a century I have never come across a requirement to number every line --- give a count of the number of lines yes, but not number each one. – Peter Wilson Sep 25 '21 at 17:37
  • @PeterWilson nature methods/ nature journals – D.A. Sep 26 '21 at 17:27
  • @D.A. Thank you for pointing me at Nature publications. I read https:/www.nature.com/for-authors/formatting-guide which said number text lines but nothing about number all lines (figures/tables, empty lines, ... Are you sure you are interpretating the guidelines correctly? – Peter Wilson Sep 27 '21 at 18:58
  • I published with Nat Methods already, and when submitting a word file it gets converted into a whole line situation. Looking at their default template https://support.nature.com/en/support/solutions/articles/6000250920-latex-template-package-for-article-book-submissions activating the lineno options labels everything. At the end I ended up using their provided one – D.A. Sep 28 '21 at 19:49

1 Answers1

1

This also numbers every \baselineskip. This is much easier than actually counting the lines of text, etc.

\documentclass[10pt]{article}
\usepackage{lipsum}
\usepackage{showframe}

\newcounter{linenumber}

\newcommand{\pagenumbers}{\begin{minipage}[b][\textheight][s]{3em} \advance\baselineskip by 0pt plus 1pt minus 1pt \dimen0=\textheight \loop\ifdim\dimen0>0pt \stepcounter{linenumber} \hbox to 3em{\hfill\thelinenumber} \advance\dimen0 by -\baselineskip \repeat \end{minipage}}%

\AddToHook{shipout/background}{\ifodd\value{page} \put({\dimexpr 1in+\oddsidemargin-4em},{\dimexpr -1in-\topmargin-\headheight-\headsep-\textheight}){\pagenumbers} \else \put({\dimexpr 1in+\evensidemargin-4em},{\dimexpr -1in-\topmargin-\headheight-\headsep-\textheight}){\pagenumbers} \fi}

\begin{document} \section*{Lorem Ipsum} \lipsum[1-10] \end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120