Debian Codegraph @

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

raw
1 %% LaTeX package xcntperchap - version 0.5 (2018/01/05 -- 22:04:12)
2 %% Label 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{xcntperchap}
25 \usepackage{enumitem}
26
27
28
29 \RegisterCounters{section}{enumi}
30 \RegisterCounters{subsection}{enumi}
31
32 \begin{document}
33 \tableofcontents
34
35 \section{Section 1 -- with \ObtainTrackedValueExp{section}{enumi} items} \tracklabel{sectionlabel}
36 \begin{enumerate}[resume]
37 \item Item 1
38 \item Item 2
39 \item Item 3
40 \end{enumerate}
41
42 \subsection{Another subsection with \ObtainTrackedValueExp{subsection}{enumi} items}
43
44 \begin{enumerate}[resume]
45 \item Item 4
46 \item Item 5
47 \end{enumerate}
48
49
50 \section{Section 2 -- with \ObtainTrackedValueExp{section}{enumi} items}
51 \begin{enumerate}[resume]
52 \item Item 6
53 \item Item 7
54 \end{enumerate}
55
56 \subsection{Another subsection with \ObtainTrackedValueExp[2]{subsection}{enumi} Items } \tracklabel{subsec::somelabel}
57
58
59 However, you can use a label as well: \ObtainTrackedValueByLabel{subsec::somelabel}{enumi}{} Items
60
61 \begin{enumerate}[resume]
62 \item Item 8
63 \item Item 9
64 \item Item 10
65 \item Item 11
66 \item Item 12
67 \item Item 13
68 \end{enumerate}
69
70 \end{document}
71