3

I want to add comments to a manuscript and refer to the line number I am commenting about. Is it possible to do that?

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}. – CarLaTeX Mar 9 '17 at 20:29
  • @CarLaTeX Thank you! Next time I will add a MWE. – toliveira Mar 9 '17 at 22:50
4

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}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.