SaraFormula
SaraFormula

Reputation: 71

Add line numbers to Rmarkdown text and have it restart on each page

I am knitting my markdown file and I have included the following in my header, which produces line numbers in my text. How can I make the numbering reset at the beginning of each new page?

header-includes:

Upvotes: 2

Views: 1729

Answers (1)

The lineno package has an option to restart the line number automatically for each page:

\usepackage[pagewise]{lineno}

Minimal working example:

\documentclass{article}

\usepackage[pagewise]{lineno}
\linenumbers
\usepackage{lipsum}


\begin{document}
\lipsum
\end{document}

Upvotes: 3

Related Questions