1

I want to have a lateral numbering in my document ranging from 1 to 65 on each pages just like in the following picture I could find on the internet. You can see that the numbering is ranging from 1 to 65 on every page, that it does not match exactly the lines and it appears even where lines are empty. And it is also not affected by equations, tables or figures (I can add pictures on request).

If any of you has any idea about how to obtain this result it would be of great help.

enter image description here

Rmano
  • 40,848
  • 3
  • 64
  • 125
Seb
  • 35
  • @jessexknight the lineno package was of no use in my case. And the solution proposed by David Carlisle was too complicated for me to understand. – Seb Feb 01 '22 at 15:23

1 Answers1

2

If the numbers are independent from the lines, this is basically a background image. For example, a quick-and-dirty one using TikZ and eso-pic:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[remember picture, overlay]
    \foreach \i in {1,...,65}
        \node[font=\small, color=cyan, text width=3em, align=right] 
            at ([yshift=-4.1*\i mm]current page.north west) {\i};
\end{tikzpicture}%
}
\begin{document}
\lipsum
\end{document}

enter image description here

You can obviously refine it so that the 65 lines automatically fit the page height without resorting to the magic -4.1\i mm, or similar things...

If you want to live a gap, it's easy to start from another point:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[remember picture, overlay]
    \coordinate (start-numbers) at ([yshift=-2cm]current page.north west);
    \foreach \i in {1,...,65}
        \node[font=\small, color=cyan, text width=3em, align=right] 
            at ([yshift=-3.8*\i mm]start-numbers) {\i};
\end{tikzpicture}%
}
\begin{document}
\lipsum
\end{document}

enter image description here

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • Yes, this looks really close to what I am intending to do. In the particular case I am working with I have an header and I should start the ruler after the header. So, now I need to figure out how the nodes function with tikz. Thank you really much – Seb Feb 01 '22 at 15:12
  • Great! I just saw your answer, now I have everything I need, many thanks! – Seb Feb 02 '22 at 19:03