I'm writing a document with a lot of listings ini it. I need to index the listing with the following format: "Listing a.b" with: a the chapter (arabic) and b the order of occurence in that chapter (arabic).
I have tried
\AtBeginDocument{\renewcommand\thelstlisting{\arabic{chapter}.\arabic{section}}}
But this creates a the chapter (arabic) and b the section of that chapter (arabic).
I have done similar thing for tables succesfully (in cls file), using:
\AtBeginDocument{ \renewcommand \thetable{\ifnum \c@chapter>\z@ \@arabic\c@chapter.\fi \@arabic\c@table} }