blob: d9a62863692e97f36b80203470d4570e6a30f51b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
%% LaTeX package xcntperchap - version 0.5 (2018/01/05 -- 22:04:12)
%% Driver examples file for xcntperchap.sty
%%
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2016 -- 2018 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%%
%% This work has the LPPL maintenance status `author-maintained`
%%
%%
%% LaTeX package xcntperchap - version 0.2 (2016/06/07 -- 09/05/23)
%% Driver file for xcntperchap.sty
%%
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2016 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%%
%% This work has the LPPL maintenance status `author-maintained`
%%
%%
\documentclass{book}
\usepackage{xcntperchap}
\usepackage{placeins}
\setcounter{secnumdepth}{5}
\RegisterCounters{chapter}{section,subsection,figure}
\RegisterCounters{section}{subsection,subsubsection,figure}
\begin{document}
\tableofcontents
\cleardoublepage
\markboth{}{}
\begingroup
\parindent=0em
Chapter 1 has \ObtainTrackedValueExp[1]{chapter}{section} sections and \ObtainTrackedValueExp[1]{chapter}{subsection} subsections
Chapter 1 has \ObtainTrackedValueExp[1]{chapter}{figure} figures
Chapter 2 has \ObtainTrackedValueExp[2]{chapter}{section} sections and \ObtainTrackedValueExp[2]{chapter}{subsection} subsections
Chapter 2 has \ObtainTrackedValueExp[2]{chapter}{figure} figures
Section 1 has \ObtainTrackedValueExp[1]{section}{subsection} subsections and \ObtainTrackedValueExp[1]{section}{subsubsection} subsubsections
Section 5 has \ObtainTrackedValueExp[5]{section}{subsection} subsections and \ObtainTrackedValueExp[5]{section}{subsubsection} subsubsections
Section 8 has \ObtainTrackedValueExp[8]{section}{subsection} subsections and \ObtainTrackedValueExp[8]{section}{subsubsection} subsubsections
\endgroup
\chapter{Foo}
\section{First section}
\subsection{My first subsection}
\subsubsection{First subsub}
\subsubsection{Second subsub}
\subsection{other subsection}
\subsubsection{First subsub}
\subsubsection{Second subsub}
\section{Second section}
\subsection{My first subsection}
\subsection{other subsection}
\section{Third section}
\subsection{other subsection}
\subsection{other subsection}
\subsection{other subsection}
\section{Fourth section}
\subsection{other subsection}
\subsection{other subsection}
\subsection{other subsection}
\begin{figure}
\caption{Foofigure}
\end{figure}
\FloatBarrier
\chapter{Foo bar chapter}
\section{A section}
\subsection{ A figure stuff}
\begin{figure}
\caption{Foofigure}
\end{figure}
\begin{figure}
\caption{Foofigure}
\end{figure}
\begin{figure}
\caption{Foofigure}
\end{figure}
\begin{figure}
\caption{Foofigure}
\end{figure}
\begin{figure}
\caption{Foofigure}
\end{figure}
\begin{figure}
\caption{Foofigure}
\end{figure}
\begin{figure}
\caption{Foofigure}
\end{figure}
\section{Foo}
\section{Second section}
\subsection{My first subsection}
\subsection{other subsection}
\subsection{My first subsection}
\subsection{other subsection}
\subsection{My first subsection}
\subsection{other subsection}
\subsection{My first subsection}
\subsection{other subsection}
\section{Third section}
\subsection{My first subsection}
\subsection{other subsection}
\subsection{My first subsection}
\subsection{other subsection}
\subsection{My first subsection}
\subsection{other subsection}
\subsection{My first subsection}
\subsection{other subsection}
\section{The last one}
\subsection{Foo}
\end{document}
|