Debian Codegraph @

texmf-dist/doc/latex/uniquecounter/uniquecounter-example.tex

raw
1 %%
2 %% This is file `uniquecounter-example.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% uniquecounter.dtx (with options: `example')
8 %%
9 %% This is a generated file.
10 %%
11 %% Project: uniquecounter
12 %% Version: 2019/12/15 v1.4
13 %%
14 %% Copyright (C)
15 %% 2009, 2011 Heiko Oberdiek
16 %% 2016-2019 Oberdiek Package Support Group
17 %%
18 %% This work may be distributed and/or modified under the
19 %% conditions of the LaTeX Project Public License, either
20 %% version 1.3c of this license or (at your option) any later
21 %% version. This version of this license is in
22 %% https://www.latex-project.org/lppl/lppl-1-3c.txt
23 %% and the latest version of this license is in
24 %% https://www.latex-project.org/lppl.txt
25 %% and version 1.3 or later is part of all distributions of
26 %% LaTeX version 2005/12/01 or later.
27 %%
28 %% This work has the LPPL maintenance status "maintained".
29 %%
30 %% The Current Maintainers of this work are
31 %% Heiko Oberdiek and the Oberdiek Package Support Group
32 %% https://github.com/ho-tex/uniquecounter/issues
33 %%
34 %%
35 %% The Base Interpreter refers to any `TeX-Format',
36 %% because some files are installed in TDS:tex/generic//.
37 %%
38 %% This work consists of the main source file uniquecounter.dtx
39 %% and the derived files
40 %% uniquecounter.sty, uniquecounter.pdf, uniquecounter.ins,
41 %% uniquecounter.drv, uniquecounter-example.tex,
42 %% uniquecounter-test1.tex, uniquecounter-test2.tex,
43 %% uniquecounter-test3.tex.
44 %%
45 \documentclass{minimal}
46 \usepackage{uniquecounter}
47 \UniqueCounterNew{anchor}
48 \makeatletter
49 \newcommand*{\DefNewAnchorName}[2]{%
50 % #1 is unique counter value
51 % #2 is name of anchor
52 \@namedef{anchor@#2}{a#1}%
53 }
54 \newcommand*{\NewAnchorName}[1]{%
55 \UniqueCounterCall{anchor}\DefNewAnchorName{#1}%
56 }
57 \newcommand*{\PrintAnchorName}[1]{%
58 \@nameuse{anchor@#1}%
59 }
60 \begin{document}
61 \NewAnchorName{Top}%
62 \NewAnchorName{Left}%
63 \noindent
64 Top: \PrintAnchorName{Top}\\%
65 Left: \PrintAnchorName{Left}%
66 \end{document}
67 %% \section{Installation}
68 \endinput
69 %%
70 %% End of file `uniquecounter-example.tex'.