I'm using LaTeX with the listings package, and I number every fifth line of the code by having:
\lstset{
numbers=left,
stepnumber=5,
firstnumber=1,
numberfirstline=true
}
Now because of the numberfirstline=true in these settings, apart from the multiples of five the first line of each listing is numbered too, but I would like to have the last line of the code be numbered as well. So if I have a listing with 17 lines of code, the lines I would like to see numbered are 1 5 10 15 17.
Is there some way that I can make listings behave like this? I tried numberlastline=true, but that does not seem to exist.
Edit: I would prefer to use this with \lstinputlisting, and without having to modify the code that get imported that way.