# Need to add line numbers extreme left of the page

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.

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

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}


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