diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex new file mode 100644 index 00000000000..3a5b64b14dc --- /dev/null +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex @@ -0,0 +1,139 @@ +%% LaTeX package xassoccnt driver file - version 0.1 (2015/11/07) +%% +%% +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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'. +%% +%% This work consists of all files listed in README +%% + + +\documentclass{book} + +\usepackage{xcolor} + +\usepackage{calc} +\usepackage[autodefinecounters=true]{xassoccnt} + +\usepackage{totcount} +\usepackage{hyperref} +\usepackage{cleveref} + + +\newcounter{totalpages} +\newtotcounter{totalsections} +\newcounter{othersections} + + + +\DeclareAssociatedCounters[autodefine=none]{section}{totalsections,othersections} +\AddAssociatedCounters[autodefine=associated]{section}{totalsections} + + +\DeclareAssociatedCounters{page}{totalpages} +\DeclareAssociatedCounters[autodefine=associated,sloppy=false]{table}{totaltables} + + + +\begin{document} + + +\chapter{First} + +In \cref{section::dummylabel} we will see that + +\section{First} + +\begin{table} +\caption{table} +\end{table} + + + +\section{Other} +\section{Third} + +\begin{table} +\caption{Other table} +\end{table} + +\begin{equation} + E=mc^2 +\end{equation} + +\begin{equation} + E=mc^2 +\end{equation} + + +\chapter{Second chapter} + +\section{First section of 2nd chapter} \label{section::dummylabel} + +\thesection\ \total{totalsections}\ \theothersections\ \thetotaltables\ + + +\IsSuspendedCounter{totalsections}{Yes, it's suspended}{Nope, it's not suspended} + +\IsAssociatedCounter{totalsections}{Yes, it's associated}{Nope, it's not associated} + +\IsSuspendedCounter{equation}{Yes, it's suspended}{Nope, it's not suspended} + +\IsAssociatedCounter{equation}{Yes, it's associated}{Nope, it's not associated} + + +\SetDocumentCounter[associatedtoo=true,onlycounters={totalsections,gandalf},associatedtoo=true]{section}{17} + +\SetDocumentCounter{section}{28} + +\SetDocumentCounter{totalsections}{100} + +\NewDocumentCounter[initial=151]{counterother}[section] + + + +Value of counterother: \thecounterother + +\section{Another one} + +Value of counterother: \thecounterother + + + + + +\thesection\ \thetotalsections\ \theothersections\ \thetotaltables\ + +\SyncCounters[onlycounters={totalsections}]{section} + + +\IfIsDocumentCounterTF{section}{% + Yes, it's a counter +}{% + No, it's no counter +} + + +\countersresetlistcount{chapter} +\SetDocumentCounter{counterother}{\getresetlistcount} + +\begin{itemize} + \item There are \getresetlistcount\ counters in the reset list of chapter + \item \IfInResetListTF{chapter}{figure}{Yes, figure is in the reset list of chapter}{No, figure is not in the reset list of chapter} + \item \IfInResetListTF{chapter}{page}{Yes, page is in the reset list of chapter}{No, page is not in the reset list of chapter} + \item Values: \thesection\ \thetotalsections\ \theothersections\ \thetotaltables\ \thecounterother. +\end{itemize} + +\end{document}
\ No newline at end of file |