summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xassoccnt/xassoccnt_label_example.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/xassoccnt/xassoccnt_label_example.tex')
-rw-r--r--macros/latex/contrib/xassoccnt/xassoccnt_label_example.tex90
1 files changed, 90 insertions, 0 deletions
diff --git a/macros/latex/contrib/xassoccnt/xassoccnt_label_example.tex b/macros/latex/contrib/xassoccnt/xassoccnt_label_example.tex
new file mode 100644
index 0000000000..0fdaf74b22
--- /dev/null
+++ b/macros/latex/contrib/xassoccnt/xassoccnt_label_example.tex
@@ -0,0 +1,90 @@
+%% LaTeX package xassoccnt - version 1.7 (2018/12/28 -- 06:45:16)
+%% Example file the the usage of labels with associated counters file for xassoccnt.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2017 -- 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`
+%%
+%%
+
+\documentclass[10pt,a4paper,twoside]{article}
+\usepackage{chngcntr}
+\usepackage{xassoccnt}
+\usepackage{hyperref}
+\NewDocumentCounter{ap, apother}
+\DeclareAssociatedCounters{subsection}{ap, apother}
+
+\counterwithout{ap}{section}
+
+\usepackage{cleveref}
+
+\crefname{ap}{package}{packages}
+\Crefname{ap}{Package}{Packages}
+\creflabelformat{ap}{AP~#2#1#3}
+\crefformat{ap}{AP~#2#1#3}
+
+\begin{document}
+
+See \cref{foosection}
+
+ \section{ some section } \label{foosection}
+ \section{ special section on packages }
+ \setcounter{ap}{0}
+
+ Here we describe \cref{ap::ap-one,ap::ap-two,ap::ap-three} ....
+ this will be presented in \cref{ap::ap-one,ap::ap-two} and
+ finally in \cref{ap::ap-three} we describe ....
+
+ Preferably this should look like this:
+
+ Here we describe package AP 1 to AP 3 ....
+ this will be presented in packages AP 1 and AP 2 and
+ finally in package AP 3 we describe ....
+
+ but currently it looks like this:
+
+ Here we describe package AP 2.1 to AP 2.3 ....
+ this will be presented in packages AP 2.1 and AP 2.2 and
+ finally in package AP 2.3 we describe ....
+
+ \subsection{AP~\arabic{ap}: first } \label{ap-one}
+ bla bla bla
+ Here we describe ...
+ which will be used in \cref{ap::ap-two,ap::ap-three} ....
+
+
+ \subsection{AP~\arabic{ap}: second }
+ \label{ap-two}
+ bla bla bla
+ we described in \cref{ap::ap-one} ....
+ follow in \cref{ap::ap-three}
+
+ ap counter is \arabic{ap} or \theap.
+
+ subsection counter is \arabic{subsection}
+ and ``thesection'' is \thesubsection.
+
+
+ \subsection{AP~\arabic{ap}: three }
+ \label{ap-three}
+ bla bla bla
+ we described in \cref{ap::ap-three,ap::ap-two} but look at \ref{ap-three}
+
+
+ \section*{Appendix}
+ The table of contents is fine as is
+ \tableofcontents
+
+\end{document}