Debian Codegraph @

texmf-dist/doc/latex/xcntperchap/xcntperchap_basicusage.tex

raw
1 %% LaTeX package xcntperchap - version 0.5 (2018/01/05 -- 22:04:12)
2 %% Basic usage example file for xcntperchap.sty
3 %%
4 %%
5 %% -------------------------------------------------------------------------------------------
6 %% Copyright (c) 2017 -- 2018 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
7 %% -------------------------------------------------------------------------------------------
8 %%
9 %% This work may be distributed and/or modified under the
10 %% conditions of the LaTeX Project Public License, either version 1.3
11 %% of this license or (at your option) any later version.
12 %% The latest version of this license is in
13 %% http://www.latex-project.org/lppl.txt
14 %% and version 1.3 or later is part of all distributions of LaTeX
15 %% version 2005/12/01 or later.
16 %%
17 %%
18 %% This work has the LPPL maintenance status `author-maintained`
19 %%
20 %%
21
22 \documentclass{article}
23
24 \usepackage{enumitem}
25 \usepackage{xcntperchap}
26
27
28
29 \RegisterCounters{section}{enumi}
30 \RegisterCounters{subsection}{enumi}
31
32
33
34 \begin{document}
35 \tableofcontents
36
37 \section{Section 1 -- with \ObtainTrackedValueExp{section}{enumi} items}
38 \begin{enumerate}[resume]
39 \item Item 1
40 \item Item 2
41 \item Item 3
42 \end{enumerate}
43
44 \subsection{Another subsection with \ObtainTrackedValueExp{subsection}{enumi} items}
45
46 \begin{enumerate}[resume]
47 \item Item 4
48 \item Item 5
49 \end{enumerate}
50
51
52 \section{Section 2 -- with \ObtainTrackedValueExp{section}{enumi} items}
53 \begin{enumerate}[resume]
54 \item Item 6
55 \item Item 7
56 \end{enumerate}
57
58 \subsection{Another subsection with \ObtainTrackedValueExp[2]{subsection}{enumi} Items } % Second total subsection to be used.
59
60 \begin{enumerate}[resume]
61 \item Item 8
62 \item Item 9
63 \item Item 10
64 \item Item 11
65 \item Item 12
66 \item Item 13
67 \end{enumerate}
68
69 \end{document}