1

(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?

jub0bs
  • 58,916
julio
  • 11
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. What you're asking for can be done if you use an lstlisting algorithm. 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
  • related: http://tex.stackexchange.com/questions/31349/how-to-align-comments-with-lstlistings – jub0bs Aug 01 '14 at 13:08

0 Answers0