4

I need to add line number in the latex {revtex4-1} generated pdf file. I am using the userpakage \usepackage{lineno} and \linenumbers after \begin{document}. It's showing the line number but very close to the text file.

I want the line number in the extreme left of the page. Can someone please help.

2
  • Welcome to TeX - LaTeX! Can you add a complete minimal document showing the problem. May 3, 2018 at 9:52
  • You can try something like \setlength\linenumbersep{1cm} to adjust the space between the line numbers and the text. May 3, 2018 at 9:55

1 Answer 1

3

Change \linenumbersep to be 1in plus \oddsidemargin, but then subtract the width of the box reserved for the numbers, that is, \linenumberwidth.

\documentclass{revtex4-1}

\usepackage{lineno}

\usepackage{lipsum}

\linenumbers

\AtBeginDocument{%
  \setlength{\linenumbersep}{\dimexpr\oddsidemargin+1in-\linenumberwidth\relax}%
}

\begin{document}

\lipsum[1-20]

\end{document}

enter image description here

1
  • Thanks a lot egreg. It's really work the exact way I wanted. Thanks again.
    – Shubhankar
    May 4, 2018 at 10:39

You must log in to answer this question.

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