(I'm new to LaTeX.)
I'd like to annotate each line of a (Java) listing (typeset with listings) to specify the computation time associated with it.
However, I can't simply edit the file and add the annotations in the code itself, because those annotations contain special characters that get my IDE really upset.
Therefore, I have to add those annotations in LaTeX, somehow. Hence my question: how can I add a comment at the end of a line in a listing?
\documentclass{...}and ending with\end{document}. What you're asking for can be done if you use anlstlistingalgorithm. However, that might be dfficult/impossible if you're inserting code that resides in an external file (using\lstinputlisting). – jub0bs Jul 31 '14 at 15:16