Debian Codegraph @

texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex

raw
1 %% LaTeX package xassoccnt - version 2.0 (2021/11/21 -- 12:14:58)
2 %% Example file for coupled counters file for xassoccnt.sty
3 %%
4 %%
5 %% -------------------------------------------------------------------------------------------
6 %% Copyright (c) 2016 -- 2021 by Dr. Christian Hupfer <>
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 `unmaintained`
19 %%
20 %%
21
22 \documentclass{article}
23
24 \usepackage{caption}
25 \usepackage{xassoccnt}
26 \usepackage{blindtext}
27
28
29 \usepackage{hyperref}
30
31 \DeclareCoupledCountersGroup{figuretablebundle}
32
33 \DeclareCoupledCounters[name=figuretablebundle,multiple=false]{figure,table}
34
35 \DeclareCoupledCounters[name=figuretablebundle,multiple=false]{figure,table,figure}
36
37 \DeclareCoupledCounters[name=sectionequationbundle]{section,equation}
38
39 \begin{document}
40
41 \AddCoupledCounters[name=figuretablefoo]{figure,table,figure}
42
43 \listoffigures
44 \listoftables
45
46 \section{First}
47
48
49 \blindtext[10]
50
51 \begin{figure}[!ht]
52
53 \caption{A figure}
54 \end{figure}
55
56 A footnote here\footnote{Myfootnote}
57
58 \blindtext[10]
59
60
61 \begin{table}[!ht]
62 \caption{A table}
63 \end{table}
64
65 \begin{equation}
66 E=mc^2
67 \end{equation}
68
69 \section{Second}
70
71 \blindtext[10]
72
73 \begin{figure}[!ht]
74
75 \caption{A foo figure}
76 \end{figure}
77
78 \blindtext[10]
79
80
81 \begin{table}[!ht]
82 \caption{A foo table}
83 \end{table}
84
85
86
87 \begin{table}[!ht]
88 \caption{A foobar table}
89 \end{table}
90
91
92
93 \begin{figure}[!ht]
94
95 \caption{A foobar figure}
96 \end{figure}
97
98 \blindtext[10]
99
100 \begin{table}[!ht]
101 \caption{Yet another foo table}
102 \end{table}
103
104
105
106 \begin{figure}[!ht]
107
108 \caption{Yet another foo figure}
109 \end{figure}
110
111 \RemoveCoupledCounters[name=figuretablebundle]{figure}
112 \addcontentsline{lof}{section}{After using RemoveCoupledCounters for figure}
113
114 \blindtext[10]
115
116 \begin{figure}[!ht]
117
118 \caption{An intermediate figure that is not coupled}
119 \end{figure}
120
121
122 \begin{table}[!ht]
123 \caption{Yet another foobar table}
124 \end{table}
125
126 \begin{table}[!ht]
127 \caption{Even more foobar table}
128 \end{table}
129
130 \begin{table}[!ht]
131 \caption{Even most foobar table}
132 \end{table}
133
134
135
136 \begin{figure}[!ht]
137
138 \caption{Even more foobar figure}
139 \end{figure}
140
141 \clearpage
142
143 \begin{figure}[!ht]
144
145 \caption{Another intermediate figure that is not coupled}
146 \end{figure}
147
148
149 \AddCoupledCounters[name=figuretablebundle]{figure}
150
151 \addcontentsline{lof}{section}{After using AddCoupledCounters for figure again}
152
153 \begin{figure}[!ht]
154 \caption{Even most foobar figure}
155 \end{figure}
156
157 \begin{table}[!ht]
158 \caption{Another coupled table}
159 \end{table}
160
161 \begin{figure}[!ht]
162 \caption{Another coupled figure}
163 \end{figure}
164
165
166 \ClearAllCoupledCounters
167 \clearpage
168
169 \addcontentsline{lof}{section}{After using ClearAllCoupledCounters}
170 \addcontentsline{lot}{section}{After using ClearAllCoupledCounters}
171
172 \begin{figure}[!ht]
173 \caption{Almost next to last figure}
174 \end{figure}
175
176
177 \begin{table}[!ht]
178 \caption{Almost next to last table}
179 \end{table}
180
181 \begin{figure}[!ht]
182 \caption{Next to last figure}
183 \end{figure}
184
185 \begin{table}[!ht]
186 \caption{Next to last table}
187 \end{table}
188
189
190
191 \AddCoupledCounters[name=figuretablebundle]{figure,table}
192 \addcontentsline{lof}{section}{After using AddCoupledCounters}
193 \addcontentsline{lot}{section}{After using AddCoupledCounters}
194
195
196 \begin{figure}[!ht]
197 \caption{The last figure}
198 \end{figure}
199
200 \begin{table}[!ht]
201 \caption{The last table}
202 \end{table}
203
204
205
206 \end{document}