# Refer to line number in note

I am using the standard article class, package lineno for numbering the lines and package todonotes to add notes and create a list of "todos" (\listoftodos). Solutions involving other packages are also accepted.

• Please add a minimal working example (MWE) that is a compilable code, starting with \documentclass{...} and ending with \end{document}. Mar 9 '17 at 20:29
• @CarLaTeX Thank you! Next time I will add a MWE. Mar 9 '17 at 22:50

Directly from package lineno documentation, p. 12:

lineno.sty allows to refer to a line number with \ref{<label>}. The label is set by \linelabel{<label>}, anywhere in a paragraph that gets line numbers.

Here is an example:

\documentclass{article}
\usepackage{lineno}
\usepackage{todonotes}
\usepackage{mwe}% just for testing purpose

\begin{document}

\linenumbers

\blindtext % this command only print some casual text

Labelled line.\linelabel{lne:label1}\todo{This is a todonote at line \lineref{lne:label1}.}

\blindtext

Another labelled line.\linelabel{lne:label2}\todo{This is another todonote at line \lineref{lne:label2}.}

\blindtext

\listoftodos[Notes]
\end{document}