If I have 2 sections and 1 subsection, with 4 listings in each, then I would like the caption and references to do the following: (same with tables and figures)
Code: Select all
Section 1:
Listing 1.1
Listing 1.2
Listing 1.3
Listing 1.4
Section 2:
Listing 2.1
Listing 2.2
Listing 2.3
Listing 2.4
Subsection 2.1:
Listing 2.1.1 (label={listing211})
Listing 2.1.2
Listing 2.1.3
Listing 2.1.4
And when I make a \ref{listing211}
I would like to it to appear as 2.1.1
Code: Select all
\lstinputlisting[firstline=34,lastline=36,firstnumber=34,caption={TCP variabler},
label={lst:variabler}]{server.cpp}