Users,
my counter usually gets incremented by 1, when I use \stepcounter{mycounter}
But surprisingly, it gets incremented by 2, when I use it together with listings:
\lstinputlisting[
title={\stepcounter{mycounter}\arabic{mycounter},
firstline=1, lastline=10, firstnumber=1
]{mytextfile.txt}
What's wrong about that?
And how can I achieve the counter to be incremented by one?