Debian Codegraph @

texmf-dist/doc/latex/cntperchap/cntperchap_example.tex

raw
1 %% Example file for cntperchap.sty
2 %%
3 %% License: LaTeX Project Public License version 1.3
4 %% Copyright (2015) Dr. Christian Hupfer
5 %% Author: Christian Hupfer [email protected]
6 %%
7 %% This work may be distributed and/or modified under the
8 %% conditions of the LaTeX Project Public License, either version 1.3
9 %% of this license or (at your option) any later version.
10 %% The latest version of this license is in
11 %% http://www.latex-project.org/lppl.txt
12 %% and version 1.3 or later is part of all distributions of LaTeX
13 %% version 2005/12/01 or later.
14 %%
15 %% This work has the LPPL maintenance status `maintained'.
16 %%
17 %% This work consists of all files listed in README
18 %%
19 %%%%
20
21
22 \documentclass[verbose]{scrbook}
23
24
25 \usepackage{tcolorbox}
26 \usepackage{cntperchap}
27
28 \usepackage{amsthm}
29 \usepackage{blindtext}
30 \usepackage{pgffor}
31
32
33
34 % Register the most important counters
35 \RegisterCounters{equation,figure,table,section,subsection,subsubsection,paragraph,subparagraph,enumi,enumii,enumiii,enumiv}
36
37 % generate the counter automatically by using 'autodefine=true' otherwise the registration would fail
38 % Define some theorem for using a non-standard-counter
39 \newtheorem{theorem}{theorem}
40
41 \newtheorem{lemma}{lemma}
42 \RegisterCounter{lemma}
43
44
45 % To show/number the lower levels too
46 \setcounter{secnumdepth}{5}
47
48 \begin{document}
49 \begin{tcolorbox}[title={Document statistics for demonstration},colbacktitle=red,coltitle=black]
50 There are \numberofstoredcounters\ counters tracked.
51
52 \Fullstatistics
53 \end{tcolorbox}
54
55 \tableofcontents
56 \listoffigures
57 \listoftables
58
59
60 \chapter{First}
61 \ShowStatistics[1]
62
63 \begin{enumerate}
64 \item Groucho
65 \item Zeppo
66 \item Harpo
67 \item Chico
68 \end{enumerate}
69
70 \begin{equation}
71 c^2 = a^2 + b^2
72 \end{equation}
73
74 but
75
76 \ShowStatistics[4]
77 \section{First}
78
79
80 \begin{enumerate}
81 \item This
82 \item \begin{enumerate}
83 \item is
84 \begin{enumerate}
85 \item a
86 \begin{enumerate}
87 \item useless
88 \end{enumerate}
89 \end{enumerate}
90 \end{enumerate}
91 \item List \theenumiv
92 \end{enumerate}
93
94
95
96
97 \begin{table}
98 \caption{faketable}
99 \caption{other faketable}
100
101 \end{table}
102 \section{Second}
103
104 \chapter{Second}
105 \ShowStatistics
106
107 \section{First}
108 \section{Second}
109 \section{Third}
110 \section{Fourth}
111
112
113
114 % Now a really large chapter
115 \chapter*{Third}
116 \ShowStatistics
117
118 \foreach \x in {1,...,5} {%
119 \section{Section \x~in chapter \thechapter}
120 }
121 \chapter{Fourth}
122 \ShowStatistics[3]
123
124 \begin{figure}
125 \caption{fake figure}
126 \caption{other fakefigure 1}
127 \caption{other fakefigure 2}
128 \caption{other fakefigure 3}
129 \caption{other fakefigure 4}
130
131 \end{figure}
132
133
134
135
136 \section*{A single section}
137
138 \begin{theorem}
139 \blindtext
140 \end{theorem}
141 \subsection{A small subsection}
142 \subsubsection{An even smaller subsubsection}
143
144 \foreach \x in {1,...,10} {%
145 \begin{equation}
146 E = mc^2
147 \end{equation}
148 }
149
150
151 \end{document}