For numbering figures and tables with 1 depth level like this:
Figure 1.2
Table 3.13
I use the package:
\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{table}{section}
\numberwithin{equation}{section}
I wanted to get the same effect for code listings usepackage listings but the compiler says that chngcntr doesnt support listings. How can I accomplish this effect? I would appreciate all help.
\makeatletter \@addtoreset{CTR}{section} \makeatotherCTR is listings counter. Please add a minimal example – touhami Jun 23 '16 at 06:35listingsislstlistingand is reset by chapter by default – Jun 23 '16 at 12:21\thefigurefor listings?; Continuous v. per-chapter/section numbering of figures, tables, and other document elements Both of these list the suggested solution of\usepackage{chngcntr} \AtBeginDocument{\counterwithin{lstlisting}{<section>}}. – Werner Jun 23 '16 at 18:13