This code snippet provides a way to highlight lines in a listings environment. If you consider the following line, though:
\emphline{1-6} {7} {8-15} {potencia.f95}
You'll notice how the #1 and the #3 parameters could be deducted from #2. To do so, one would need to:
- know the total number of lines of the
potencia.f95file; - perform subtractions and additions in LaTeX
Would it be possible to do the above, translating the command into one which could be used as:
\emphline{7}{potencia.f95}
Or even, if one would like to highlight an entire section:
\emphline{7-12}{potencia.f95}