summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex')
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex90
1 files changed, 90 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex
new file mode 100644
index 00000000000..01d305561be
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex
@@ -0,0 +1,90 @@
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
+%% Example file the the usage of labels with associated counters file for xassoccnt.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2017 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}