I've had several persistent issues with the lineno package and journal article templates (e.g., not numbering certain paragraphs). Is it possible to just add an "unaligned" column of line numbers on the side of the page?
Asked
Active
Viewed 1,236 times
1 Answers
2
The following example uses eso-pic to place a list of numbers (contained within a single-column tabular) on the left and/or right of the text block:
\documentclass{article}
\usepackage{lipsum,eso-pic,xcolor}
% Specify a verbatim list of numbers (or items) to be on the side of the text block
\newcommand{\numberlist}[1][r]{%
\begin{tabular}{#1}
\strut
1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7 \\ 8 \\ 9 \\ 10 \\
11 \\ 12 \\ 13 \\ 14 \\ 15 \\ 16 \\ 17 \\ 18 \\ 19 \\ 20 \\
21 \\ 22 \\ 23 \\ 24 \\ 25 \\ 26 \\ 27 \\ 28 \\ 29 \\ 20 \\
31 \\ 32 \\ 33 \\ 34 \\ 35 \\ 36 \\ 37 \\ 38 \\ 39 \\ 30 \\
41 \\ 42 \\ 43 \\ 44 \\ 45 \\ 46
\end{tabular}%
}
\newcommand{\numberlistfont}{%
\ttfamily\color{black!50}% Font/colour used for number list
}
% Add number list to the ForeGround of every page
\AddToShipoutPictureFG{%
% Start at the top left of the text block
\AtTextUpperLeft{%
\numberlistfont
% Numbers on left
\makebox[0pt][r]{\raisebox{-\height}{%
\numberlist[r]% Print numbers, right-aligned
}%
\hspace{50pt}% Space between left numbers and text block
}%
\hspace*{\textwidth}% Just to right side of text block
\hspace{3em}% Space between right numbers and text block
\makebox[0pt][l]{\raisebox{-\height}{%
\numberlist[l]% Print numbers, left-aligned
}}%
}%
}
\begin{document}
\sloppy\lipsum[1-50]\lipsum[1-50]
\end{document}
You can adjust the lengths and definitions based on the commented code.
Werner
- 603,163


vruler.stypackage... – MadyYuvi Jul 19 '19 at 14:58ImageMagick? – Student Jul 19 '19 at 17:25bashscript into a Windows.batfile is not a TeX question, and so off topic for the site. – Alan Munn Jul 19 '19 at 17:38