I stumbeled over a way of formatting sourcecode in a book I am currently reading. It looks like this:
So basically we have a following structure:
- There are two columns. Left column contains the code, right contains the comments
- A comment can be assigned to a line or a block of code
- The background color is adjusted to the box of associated parts (gray box in the example)
- Line numbers for each line of code
Does anybody at least know a template which looks like this? So I would have a point where I could start of.
Currently I am using verbatim
lstlisting. But if there are any other packages, which are more suitable for that kind of formatting code, I would not mind using them either.