texlive[41360] Master: xcntperchap (7jun16)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 11 01:22:27 CEST 2016


Revision: 41360
          http://tug.org/svn/texlive?view=revision&revision=41360
Author:   karl
Date:     2016-06-11 01:22:27 +0200 (Sat, 11 Jun 2016)
Log Message:
-----------
xcntperchap (7jun16)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/xcntperchap/
    trunk/Master/texmf-dist/doc/latex/xcntperchap/README
    trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.pdf
    trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.tex
    trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.pdf
    trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.tex
    trunk/Master/texmf-dist/tex/latex/xcntperchap/
    trunk/Master/texmf-dist/tex/latex/xcntperchap/xcntperchap.sty
    trunk/Master/tlpkg/tlpsrc/xcntperchap.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/xcntperchap/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xcntperchap/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xcntperchap/README	2016-06-10 23:22:27 UTC (rev 41360)
@@ -0,0 +1,28 @@
+%% LaTeX package xcntperchap - version 0.2 (2016/06/07 -- 09/05/23)
+%% README file for xcntperchap.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2016 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`
+%%
+%%
+
+
+The package xcntperchap provides a way of investigating how many subsections per chapter etc. are in a certain chapter etc beforehand, i.e. at the begin of the second compilation run this is information is available. 
+
+As of 2016/06/07 xcntperchap does not supersede the package cntperchap by the same author, however, 
+the older package isn't declared obsolete as of 2016/06/07
+
+


Property changes on: trunk/Master/texmf-dist/doc/latex/xcntperchap/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.pdf	2016-06-10 23:21:30 UTC (rev 41359)
+++ trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.pdf	2016-06-10 23:22:27 UTC (rev 41360)

Property changes on: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.tex	2016-06-10 23:22:27 UTC (rev 41360)
@@ -0,0 +1,535 @@
+%% LaTeX package xcntperchap - version 0.2 (2016/06/07 -- 09/05/23)
+%% Documentation file for xcntperchap.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2016 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`
+%%
+%%
+
+\documentclass[12pt,a4paper]{article}
+
+
+
+
+\usepackage[lmargin=2cm,rmargin=2cm,headheight=15pt]{geometry}
+\usepackage{savesym}
+\usepackage{bbding}
+\savesymbol{Cross}
+
+\usepackage{blindtext}
+\usepackage[x11names]{xcolor}
+\usepackage{imakeidx}
+\usepackage{fontawesome}
+\usepackage[most,documentation]{tcolorbox}
+\usepackage[tikz]{bclogo}
+\usepackage{marginnote}
+\usepackage{fancyhdr}
+\usepackage{datetime}
+\usepackage{array}
+\usepackage{xkeyval}
+\usepackage{xparse}
+\usepackage{totcount}
+\usepackage{enumitem}
+\usepackage{microtype}
+\usepackage{caption}
+\usepackage[T1]{fontenc}
+\usepackage[scaled=0.92]{helvet}
+
+\newlist{codeoptionsenum}{enumerate}{1}
+\setlist[codeoptionsenum,1]{label={\textcolor{blue}{\#\arabic*}}}
+
+\renewcommand{\rmdefault}{\sfdefault}
+
+\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
+
+\makeatletter
+\define at key{chdoc}{packageauthor}{%
+  \def\KVchdocpackageauthor{#1}%
+}
+
+\define at key{chdoc}{packageauthormail}{%
+  \def\KVchdocpackageauthormail{#1}%
+}
+
+\define at key{chdoc}{filepurpose}{%
+  \def\KVchdocfilepurpose{#1}%
+}
+
+
+\newcommand{\chdocextractversion}[1]{%
+  \@nameuse{#1}%
+}
+
+
+\@namedef{xcntperchapversion0.1}{v0.1 2016-05-22}
+\@namedef{xcntperchapversion0.2}{v0.2 2016-06-07}
+
+
+\makeatother
+
+
+
+
+
+
+\fancypagestyle{plain}{%
+\fancyfoot[L]{\begin{tabular}[t]{l}\PackageDocName\ \packageversion \tabularnewline \textcopyright\ Dr. Christian Hupfer\end{tabular}}%
+\fancyfoot[C]{\thepage}%
+\fancyfoot[R]{\today}%
+\renewcommand{\headrule}{{\color{blue}%
+\hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
+\renewcommand{\footrule}{{\color{blue}\vskip-\footruleskip\vskip-\footrulewidth
+\hrule width\headwidth height\footrulewidth\vskip\footruleskip}}
+\renewcommand{\footrulewidth}{2pt}
+\renewcommand{\headrulewidth}{2pt}
+}
+
+
+
+\newtcolorbox{CHPackageTitleBox}[1][]{%
+  enhanced jigsaw,
+  drop lifted shadow,
+  colback=yellow!30!white,
+  width=0.8\textwidth,
+  #1
+}
+
+
+\presetkeys{chdoc}{packageauthor={Christian Hupfer}}{}%
+\NewDocumentCommand{\CHPackageTitlePage}{O{}mO{}}{%
+  \setkeys{chdoc}{packageauthor={Christian Hupfer},filepurpose={Documentation},#1}%
+  \begin{center}
+    \begin{CHPackageTitleBox}[#3]
+      \large \bfseries%
+      \begin{center}%
+        \begin{tabular}{C{0.9\textwidth}}%
+          \scshape \PackageDocName \tabularnewline
+          \tabularnewline
+          #2 \tabularnewline
+          \tabularnewline
+          \KVchdocfilepurpose \tabularnewline
+          \tabularnewline
+          Version \packageversion \tabularnewline
+          \tabularnewline
+          \today \tabularnewline
+          \tabularnewline
+          \addtocounter{footnote}{2}
+          Author: \KVchdocpackageauthor\(^\mathrm{\fnsymbol{footnote}}\)
+          \tabularnewline
+        \end{tabular}
+      \end{center}
+    \end{CHPackageTitleBox}
+    \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
+    \footnotetext{\mymailtoaddress}%
+  \end{center}
+}
+
+\newtcolorbox{docCommandArgs}[1]{colbacktitle={blue},coltitle={white},title={Description of arguments of command \cs{#1}}}
+
+
+\newcommand{\tcolorboxdoclink}{http://mirrors.ctan.org/macros/latex/contrib/tcolorbox/tcolorbox.pdf}
+
+% 'Stolen' from tcolorbox documentation ;-)
+
+\newtcolorbox{marker}[1][]{enhanced,
+  before skip=2mm,after skip=3mm,
+  boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
+  colback=yellow!50,
+  colframe=yellow!20!black,
+  sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
+  underlay={%
+    \path[fill=tcbcol at back!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
+    \path[draw=tcbcol at frame,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
+    \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
+    },
+    drop fuzzy shadow,#1}
+
+
+%%%% Documentation macros
+
+
+\NewDocumentCommand{\packagename}{sm}{%
+  \textcolor{blue}{\textbf{\faEnvelopeO~#2}}%
+  \IfBooleanF{#1}{%
+    \index{Package!#2}
+  }%
+}
+
+\NewDocumentCommand{\classname}{sm}{%
+  \textcolor{brown}{\textbf{\faBriefcase~#2}}%
+  \IfBooleanF{#1}{%
+    \index{Package!#2}%
+  }%
+}
+
+
+\NewDocumentCommand{\CHDocPackage}{sm}{%
+  \textcolor{blue}{\textbf{\faEnvelopeO~#2}}%
+  \IfBooleanF{#1}{%
+    \index{Package!#2}
+  }%
+}
+
+
+
+
+\NewDocumentCommand{\CHDocClass}{sm}{%
+  \textcolor{brown}{\textbf{\faBriefcase~#2}}%
+  \IfBooleanF{#1}{%
+    \index{Package!#2}%
+  }%
+}
+
+\NewDocumentCommand{\CHDocKey}{sm}{%
+  \textcolor{red}{\textbf{\faKey~#2}}%
+  \IfBooleanF{#1}{%
+      \index{Option!#2}%
+  }%
+}
+
+\newcommand{\handrightnote}{\tcbdocmarginnote{\ding{43}}}
+
+
+\NewDocumentCommand{\CHDocCounter}{sm}{%
+  \textcolor{Green4}{\textbf{\faCalculator~#2}}%
+  \IfBooleanF{#1}{%
+    \index{Counter!#2}%
+  }%	
+}
+
+
+\NewDocumentCommand{\CHDocTag}{sm}{%
+  \textcolor{violet}{\faTag~#2}%
+  \IfBooleanF{#1}{%
+    \index{Feature!#2}%
+  }%	
+}
+
+
+\NewDocumentCommand{\CHDocFileExt}{sm}{%
+    \faFile~#2%
+}
+
+\NewDocumentCommand{\CHDocFiles}{sm}{%
+    \faFilesO~#2%
+}
+
+
+\NewDocumentCommand{\CHDocConventions}{}{%
+  \section*{\centering Typographical conventions}
+  Throughout this documentation following symbols and conventions are used:
+  \begin{itemize}
+  \item \CHDocClass*{foo} means a the class \texttt{foo}
+  \item \CHDocPackage*{foo} names a package \texttt{foo}
+  \item \CHDocCounter*{foo} indicates a counter named \texttt{foo}
+  \item \CHDocFileExt*{foo} will indicate either a file named \texttt{foo} or a file extension \texttt{foo}
+  \item \CHDocFiles*{foo} will indicate some files 
+  \item \CHDocTag*{foo} names a special feature or tag \texttt{foo}
+  \item \CHDocKey*{foo} deals with a command or package option named \texttt{foo}
+  \end{itemize}
+}
+
+\usepackage{xcntperchap}
+
+
+\newcommand{\PackageDocName}{xcntperchap}%
+
+
+
+\newcommand{\mymailtoaddress}{%
+  christian.hupfer at yahoo.de
+}
+
+
+\def\packageversion{\xcntperchappackageversion}%
+
+\makeindex[intoc]
+
+\RegisterCounters{section}{subsection,subsubsection,table,figure}
+
+\hypersetup{breaklinks=true}
+
+
+
+\hypersetup{breaklinks=true,
+  pdftitle={\jobname.pdf -- version \packageversion},
+  pdfauthor={PACKAGEAUTHOR},
+  pdfsubject={Documentation of \PackageDocName\ package},
+  pdfkeywords={LaTeX, counters},
+  pdfcreator={LaTeX}
+}
+
+
+\begin{document}
+\mmddyyyydate
+
+
+\setlength{\parindent}{0pt}
+
+\thispagestyle{empty}%
+\CHPackageTitlePage[packageauthor={Christian Hupfer}]{Store counter values per chapter (or other track levels)}
+\clearpage
+\tableofcontents
+\clearpage
+
+\CHDocConventions
+\clearpage
+
+\pagestyle{plain}
+
+\setcounter{footnote}{0}
+
+\pagestyle{plain}
+
+
+
+\section{Disclaimer}
+This package as of its version \packageversion\ is a rewrite of the former \CHDocPackage{cntperchap} by the same author, is under constant development and as such subject to macro interface changes as well as renaming of macros. Not all features of the previous package has been incorporated so far -- if some functionality of your document depends on \CHDocPackage{assoccnt}, continue using the older version and shift gradually to \CHDocPackage{\PackageDocName} please.
+
+\begin{marker}
+Most times class and package authors will benefit of this package, but there might be usual documents that need the features of |\PackageDocName||
+\end{marker}
+
+\section{Introduction}
+
+The aim of this package is to provide support for a summary in advance how many sections, subsections, etc. or figures, tables, equations there will be in predefined track level, for example per chapters. The values are stored at the beginning of such a new track level, say \cs{chapter} and written to a \CHDocFileExt{jobname.cpc} file.
+
+\begin{marker}
+  Since the \CHDocCounter*{page} counter is an unrealiable 'friend' it is not advised to use this counter as a track level. 
+\end{marker}
+
+
+As of version \packageversion\ there is no default version of a track level.
+
+This package is the consequence of the question \url{http://tex.stackexchange.com/questions/241559/how-to-count-the-total-number-of-sections-within-a-chapter} by the user \texttt{gsl}. 
+
+
+
+\section{Package options}%
+\label{section::package_options}
+
+As of version \packageversion~ the package has no package options.
+
+
+\section{Requirements and incompatibilities}%
+
+\subsection{Required packages}
+
+Since \CHDocPackage{\PackageDocName} is written using \CHDocPackage{expl3}, it requires the \CHDocPackage{xparse} package. It relies on the features of associated counters introduced by \CHDocPackage{xassoccnt}, this package is also needed%
+
+\begin{itemize}
+\item \CHDocPackage{expl3}%
+\item \CHDocPackage{xparse}%
+\item \CHDocPackage{xassoccnt}%
+\end{itemize}
+
+The package \CHDocPackage{xparse} is already loaded by \CHDocPackage{assoccnt} and does not need to be specified again. 
+
+\subsection{Incompatibilities}
+
+This package has been tested with the standard classes \classname{article}, \classname{book} and \classname{report} as well as with \classname{memoir} and the relevant \classname{KOMA} equivalents. As of version \packageversion\ for those classes there are no known incompatibilities with the general behaviour of the package, however, there is an issue with \CHDocPackage{assoccnt} and \CHDocPackage{xifthen} which is not solved so far. 
+
+\marginnote{\bcbombe} It would be nice to adapt the package for usage on a per frame base with the \classname{beamer} class, but this seems both not really necessary as well as quite difficult, since \classname{beamer} follows different strategies about the usage of ``pages'' or ``sections'', see \ref{section::todo}
+
+
+\clearpage
+
+
+\section{Documentation of Macros}
+
+\subsection{Preamble only commands}
+
+\begin{docCommand}{RegisterCounters}{\marg{track counter}\marg{counter1, counter2,...}} \tcbdocmarginnote{\tcbdocnew{\chdocextractversion{xcntperchapversion0.1}}}
+
+This provides the means to let the package know that the counters should be tracked for values inside a certain track level -- specify this in the document preamble.
+
+\begin{docCommandArgs}{RegisterCounters}%
+  \begin{itemize}
+  \item \marg{track counter}
+    This contains the counter name which is the track level, e.g. \CHDocCounter*{section}
+  \item \marg{counter1, counter2,...}
+    This marks the counters to be tracked inside the track level, e.g. \CHDocCounter*{subsection}, \CHDocCounter*{subsubsection}
+\end{itemize}
+\end{docCommandArgs}
+
+\end{docCommand}%
+
+
+\section{User commands}
+
+
+\begin{docCommand}{ObtainTrackedValue}{\oarg{counter value}\marg{track level}\marg{tracked counter}} \tcbdocmarginnote{\tcbdocnew{\chdocextractversion{xcntperchapversion0.1}}}
+
+This command prints the value of the tracked counter of a track counter, i.e. the number of subsections in a specific chapter, say, the 5th chapter can be obtained by
+
+\begin{dispExample}{listings only}
+  \ObtainTrackedValue[5]{chapter}{subsection}
+\end{dispExample}
+
+\begin{codeoptionsenum}
+  \item \oarg{options}: As of version \packageversion, the only option is a counter value, say 5 for the 5th chapter. This must be the total number of the relevant track counter, i.e. the 17th total section etc. 
+  \item \marg{track counter name}: The name of the track level, i.e. \CHDocCounter*{section}. 
+  \item \marg{tracked counter name}: The name of the tracked counter, i.e. \CHDocCounter*{figure}. 
+\end{codeoptionsenum}
+
+Please note that the number of entities per track level might be reported wrongly for floats, since those are shifted to some other places. If this should be prevented, a \cs{FloatBarrier} from \CHDocPackage{placeins} might be necessary (see the example file \verb!xcntperchap_driver.tex!)
+
+\begin{marker}\tcbdocmarginnote{\tcbdocupdated{\chdocextractversion{xcntperchapversion0.2}}}
+  This macro is not expandable -- for an expandable version use \refCom{ObtainTrackedValueExp} instead.
+\end{marker}
+
+\end{docCommand}
+\clearpage
+
+\begin{docCommand}{ObtainTrackedValueExp}{\oarg{counter value}\marg{track level}\marg{tracked counter}} \tcbdocmarginnote{\tcbdocnew{\chdocextractversion{xcntperchapversion0.2}}}
+
+This command is the expandable version of \refCom{ObtainTrackedValue} and should be used if are calculations, comparisions and write - operations to files are requested.
+
+The meaning of arguments is the same as in \refCom{ObtainTrackedValue}. 
+\end{docCommand}
+
+\section{Examples}
+
+\subsection[Item count of enumerate]{Count the items of an enumerate}
+
+
+\tcbset{breakable}
+\begin{dispListing}
+\documentclass{article}
+
+\usepackage{xcntperchap}
+\usepackage{enumitem}
+
+
+
+\RegisterCounters{section}{enumi}
+\RegisterCounters{subsection}{enumi}
+
+\begin{document}
+\tableofcontents
+
+\section{Section 1 -- with \ObtainTrackedValueExp{section}{enumi} items}
+    \begin{enumerate}[resume]
+        \item Item 1
+        \item Item 2
+        \item Item 3
+    \end{enumerate}
+
+\subsection{Another subsection with \ObtainTrackedValueExp{subsection}{enumi} }
+
+\begin{enumerate}[resume]
+\item Item 4
+\item Item 5
+\end{enumerate}
+
+
+\section{Section 2 -- with \ObtainTrackedValueExp{section}{enumi} items}
+\begin{enumerate}[resume]
+\item Item 6
+\item Item 7
+\end{enumerate}
+
+\subsection{Another subsection with \ObtainTrackedValueExp[2]{subsection}{enumi} Items } % Second total subsection to be used. 
+
+\begin{enumerate}[resume]
+\item Item 8
+\item Item 9
+\item Item 10
+\item Item 11
+\item Item 12
+\item Item 13
+\end{enumerate}
+
+\end{document}
+\end{dispListing}
+
+
+\clearpage
+
+\section{To-Do list}\label{section::todo}
+
+\begin{itemize}
+\item Better error handling (no checks for many features so far).
+\item More options for fine control of the behaviour package and macros.
+\item Easy - adaption for other documentclasses, especially for \classname{beamer}
+\item Improve documentation
+\item More examples
+\end{itemize}
+
+If you 
+
+\begin{itemize}
+  \item find bugs
+  \item errors in the documentation
+  \item have suggestions
+  \item have feature requests
+\end{itemize}
+
+don't hesitate and contact me via \makeatletter christian.hupfer at yahoo.de\makeatother
+
+\clearpage
+
+
+\section{Acknowledgments}
+
+I would like to express my gratitudes to the developpers of fine \LaTeX{} packages and of course
+to the users at tex.stackexchange.com, especially to
+
+\begin{itemize}
+  \item Paulo Roberto Massa Cereda
+  \item Enrico Gregorio
+  \item Joseph Wright
+  \item David Carlisle
+  \item Werner Grundlingh
+  \item Gonzalo Medina
+\end{itemize}
+
+for their invaluable help on many questions on macros.
+
+\vspace{2\baselineskip}
+\begin{marker}
+A special gratitude goes to Prof. Dr. Dr. Thomas Sturm for providing the wonderful \CHDocPackage{tcolorbox} package which was used to
+write this documentation.
+\end{marker}
+
+
+\section{Version history}
+
+\begin{itemize}
+\item 
+Version \chdocextractversion{xcntperchapversion0.2} \tcbdocmarginnote{\tcbdocnew{\chdocextractversion{xcntperchapversion0.2}}}
+\begin{itemize}
+\item Added the expandable version of \cs{ObtainTrackedValues} 
+\item Removed the bug concerning the missing reset of the associated counters
+\end{itemize}
+
+\item 
+Version \chdocextractversion{xcntperchapversion0.1} \tcbdocmarginnote{\tcbdocnew{\chdocextractversion{xcntperchapversion0.1}}}
+
+Bootstrap version, rewrite of previous \CHDocPackage{cntperchap} with LaTeX - 3 - Kernel features
+
+\end{itemize}
+
+
+
+
+\clearpage
+\printindex
+
+
+
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.pdf	2016-06-10 23:21:30 UTC (rev 41359)
+++ trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.pdf	2016-06-10 23:22:27 UTC (rev 41360)

Property changes on: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.tex	2016-06-10 23:22:27 UTC (rev 41360)
@@ -0,0 +1,192 @@
+%% LaTeX package xcntperchap - version 0.2 (2016/06/07 -- 09/05/23)
+%% Driver file for xcntperchap.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2016 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`
+%%
+%%
+
+\documentclass{book}
+
+
+\usepackage{xcntperchap}
+
+\usepackage{placeins}
+\setcounter{secnumdepth}{5}
+
+
+
+
+\RegisterCounters{chapter}{section,subsection,figure}
+\RegisterCounters{section}{subsection,subsubsection,figure}
+
+
+\begin{document}
+
+\tableofcontents
+
+
+\cleardoublepage
+\markboth{}{}
+\begingroup
+\parindent=0em
+Chapter 1 has \ObtainTrackedValueExp[1]{chapter}{section} sections and \ObtainTrackedValueExp[1]{chapter}{subsection} subsections
+
+Chapter 1 has \ObtainTrackedValueExp[1]{chapter}{figure} figures
+
+Chapter 2 has \ObtainTrackedValueExp[2]{chapter}{section} sections and \ObtainTrackedValueExp[2]{chapter}{subsection} subsections
+
+Chapter 2 has \ObtainTrackedValueExp[2]{chapter}{figure} figures
+
+Section 1 has \ObtainTrackedValueExp[1]{section}{subsection} subsections and \ObtainTrackedValueExp[1]{section}{subsubsection} subsubsections
+
+Section 5 has \ObtainTrackedValueExp[5]{section}{subsection} subsections and \ObtainTrackedValueExp[5]{section}{subsubsection} subsubsections
+
+Section 8 has \ObtainTrackedValueExp[8]{section}{subsection} subsections and \ObtainTrackedValueExp[8]{section}{subsubsection} subsubsections
+\endgroup
+
+
+
+\chapter{Foo}
+
+
+\section{First section}
+
+\subsection{My first subsection}
+
+\subsubsection{First subsub}
+
+\subsubsection{Second subsub}
+
+
+\subsection{other subsection}
+
+\subsubsection{First subsub}
+
+\subsubsection{Second subsub}
+
+
+\section{Second section}
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+\section{Third section}
+\subsection{other subsection}
+
+\subsection{other subsection}
+\subsection{other subsection}
+
+\section{Fourth section}
+
+
+\subsection{other subsection}
+
+\subsection{other subsection}
+\subsection{other subsection}
+
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+
+\FloatBarrier
+
+
+\chapter{Foo bar chapter}
+
+
+\section{A section}
+
+\subsection{ A figure stuff}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+\begin{figure}
+\caption{Foofigure}
+\end{figure}
+
+
+
+\section{Foo}
+
+\section{Second section}
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+\section{Third section}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\subsection{My first subsection}
+
+\subsection{other subsection}
+
+
+\section{The last one}
+
+\subsection{Foo}
+
+
+
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/xcntperchap/xcntperchap_driver.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/xcntperchap/xcntperchap.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xcntperchap/xcntperchap.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/xcntperchap/xcntperchap.sty	2016-06-10 23:22:27 UTC (rev 41360)
@@ -0,0 +1,278 @@
+%% LaTeX package xcntperchap - version 0.2 (2016/06/07 -- 09/05/23)
+%% Source file for xcntperchap.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2016 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`
+%%
+%%
+
+\def\xcntperchappackageversion{0.2}
+\NeedsTeXFormat{LaTeX2e}
+
+\ProvidesPackage{xcntperchap}[2016/06/07 - v\xcntperchappackageversion]
+
+\RequirePackage{xparse}
+\RequirePackage{l3keys2e}
+\RequirePackage[nonumberofruns]{xassoccnt}
+
+
+\ExplSyntaxOn
+
+
+\let\latex@@stepcounter\stepcounter
+
+
+\cs_generate_variant:Nn \int_set:Nn {NV, Nx}
+\cs_generate_variant:Nn \int_eval:n {V, x}
+\cs_generate_variant:Nn \seq_gremove_all:Nn {NV,Nx,cV,cx}
+
+
+\seq_new:N \g_xcntperchap_tracklevel_seq % This holds all counters which serve as a tracklevel
+
+
+\ior_new:N \g_trackfile_storage_read
+\iow_new:N \g_trackfile_storage_write
+
+
+\int_new:N \l_tracklevelunit_int
+\int_new:N \l_tracklevel_tracked_int
+
+
+\cs_new:Nn \xcntperchap_add_tracklevel:n {% 
+  \seq_if_in:NnF \g_xcntperchap_tracklevel_seq {#1} {%
+    \seq_gput_right:Nn \g_xcntperchap_tracklevel_seq {#1}
+    \seq_new:c {g_xcntperchap_tracklevel_#1_seq}% Creating a new container for the counter names to be tracked
+    \prop_new:c {g_xcntperchap_tracklevel_#1_prop}% Creating a new property list for the counter names to be tracked
+    \seq_new:c {g_xcntperchap_tracklevelstored_#1_seq}% Creating a new container for the stored counter values (used later on)
+  }%
+}
+
+\NewDocumentCommand{\RegisterCounters}{mm}{%
+  \xcntperchap_add_tracklevel:n {#1}
+  \seq_set_from_clist:cn {g_xcntperchap_tracklevel_#1_seq} {#2}
+  \seq_remove_duplicates:c {g_xcntperchap_tracklevel_#1_seq}
+  \int_zero:N \l_tmpa_int
+  \seq_map_inline:cn {g_xcntperchap_tracklevel_#1_seq} {%
+    \int_incr:N \l_tmpa_int
+    \IfIsDocumentCounterF{cps@@#1total##1}{%
+      \NewDocumentCounter{cps@@#1total##1}%
+      \AddAssociatedCounters{##1}{cps@@#1total##1}% Define associated counters 
+    }
+    \prop_put:cnV {g_xcntperchap_tracklevel_#1_prop} {##1} {\l_tmpa_int} % New Version 0.2
+  }
+}
+
+
+\cs_new:Nn \xcntperchap_storetracked_values:n{%
+  \tl_clear:N \l_tmpa_tl
+  \int_zero:N \l_tmpa_int
+  \int_zero:N \l_tmpb_int
+  \seq_if_in:NnT \g_xcntperchap_tracklevel_seq {#1} {%
+    \tl_put_right:Nn \l_tmpa_tl {#1,}%
+    \int_set:Nx \l_tmpb_int {\seq_count:c {g_xcntperchap_tracklevel_#1_seq} }
+    \int_compare:nNnT { \value{#1} } > {\c_zero }{%
+      \int_zero:N \l_tmpa_int
+      \seq_map_inline:cn {g_xcntperchap_tracklevel_#1_seq} {%
+        \int_incr:N \l_tmpa_int
+        \int_compare:nNnTF {\l_tmpa_int } < { \l_tmpb_int } 
+        {  \tl_gput_right:Nx \l_tmpa_tl { \number\value{cps@@#1total##1}, } } {  \tl_gput_right:Nx \l_tmpa_tl { \number\value{cps@@#1total##1} } }
+      } 
+      \iow_now:Nx \g_trackfile_storage_write {\l_tmpa_tl}%
+    }
+    \seq_map_inline:cn {g_xcntperchap_tracklevel_#1_seq} {
+      \setcounter{cps@@#1total##1}{0}% Reset the total counter values
+    }
+  }
+}
+
+
+\NewDocumentCommand{\StoreCounterValues}{m}{%
+  \xcntperchap_storetracked_values:n{#1}%
+}
+
+
+% Redefine again, to provide the storage feature
+\RenewDocumentCommand{\stepcounter}{m}{%
+  % Must get reset list first
+  \__xassoccnt_getresetlist:n{#1}% 
+  \seq_map_inline:Nn \g_xcntperchap_tracklevel_seq {%
+    \seq_if_in:NnT \l__xassoccnt_counterreset_seq {##1} {
+      \StoreCounterValues{##1}%
+    }
+  }
+  \StoreCounterValues{#1}%
+  \latex@@stepcounter{#1}%
+}
+
+
+
+\cs_new_nopar:Nn \xcntperchap_trackcounters: {%
+  \seq_map_inline:cn {g_xcntperchap_tracklevel_seq} {%
+    \xcntperchap_storetracked_values:n{##1}%
+  }
+}
+
+\NewDocumentCommand{\TrackCounters}{}{%
+  \xcntperchap_trackcounters:
+}
+
+
+\NewDocumentCommand{\cntperchapsetup}{}{%
+% Unused so far  
+}
+
+\NewDocumentCommand{\LoadTrackedValues}{}{%
+  \IfFileExists{\jobname.cpc}{%
+    \xcntperchap_open_trackfile_for_read:n{\jobname.cpc}
+    \GetStoredValues%
+    \xcntperchap_close_trackfile_for_read:
+  }{}
+}
+
+
+
+\cs_new:Nn \xcntperchap_open_trackfile_for_read:n {%
+  \ior_open:Nn \g_trackfile_storage_read {#1}
+}
+
+\cs_new_nopar:Nn \xcntperchap_close_trackfile_for_read: {%
+  \ior_close:N \g_trackfile_storage_read
+}
+
+\cs_new:Nn \xcntperchap_open_trackfile_for_write:n {%
+  \iow_open:Nn \g_trackfile_storage_write {#1}
+}
+
+\cs_new_nopar:Nn \xcntperchap_close_trackfile_for_write: {%
+  \iow_close:N \g_trackfile_storage_write
+}
+
+\NewDocumentCommand{\CloseTrackFileForWrite}{}{%
+  \xcntperchap_close_trackfile_for_write:%
+}
+
+
+\NewDocumentCommand{\OpenTrackFileForWrite}{m}{%
+  \xcntperchap_open_trackfile_for_write:n{#1}%
+}
+
+
+
+\cs_new:Nn \l_xcntperchap_read_countervalues:n {%
+  \clist_set:Nx \l_tmpa_clist {#1}%
+  \tl_set:Nx \l_tmpa_tl {\clist_item:Nn \l_tmpa_clist {1}}
+  \clist_map_inline:Nn \l_tmpa_clist {%
+    \seq_gput_right:cn {g_xcntperchap_tracklevelstored_\l_tmpa_tl _seq} {##1} % Store the value in the tracklevel list for counter \l_tmpa_tl
+  }
+  % Kick the name of the tracklevel counter from the list
+  \seq_gremove_all:cx {g_xcntperchap_tracklevelstored_\l_tmpa_tl _seq} {\tl_use:N \l_tmpa_tl}%
+}
+
+\cs_new_nopar:Nn \xcntperchap_gettrackedvalues_from_file:n {%
+  \ior_map_inline:Nn #1 { \l_xcntperchap_read_countervalues:n{##1}  }
+}
+
+
+% Unexpandable version!
+\cs_new:Nn \xcntperchap_obtaintrackedvalue:nnn {%
+  \int_set:Nx \l_tracklevelunit_int {#1}
+  \seq_if_in:cnTF {g_xcntperchap_tracklevel_#2_seq} {#3} 
+  {
+    \int_set:Nx \l_tracklevel_tracked_int {\seq_count:c {g_xcntperchap_tracklevel_#2_seq}}
+    \int_zero:N \l_tmpa_int
+    \seq_map_inline:cn {g_xcntperchap_tracklevel_#2_seq} {%
+      \int_incr:N \l_tmpa_int
+      \tl_if_eq:nnT { ##1 } {#3 } { 
+        \seq_map_break:
+      }
+    }
+    \int_set:NV \l_tmpb_int { \l_tmpa_int }
+    \int_set:Nx \l_tmpa_int { \l_tracklevel_tracked_int * (\l_tracklevelunit_int -1) + \l_tmpb_int  }
+  }{%
+    % Perhaps some error message here, for the moment only a screen message
+    \typeout{#3~is~not~under~track~control~of~#2}
+  }
+}  
+
+\NewDocumentCommand{\ObtainTrackedValue}{omm}{%
+  \IfValueTF{#1}{%
+    \xcntperchap_obtaintrackedvalue:nnn {#1}{#2}{#3}%
+  }{%
+    \xcntperchap_obtaintrackedvalue:nnn {\number\value{#2}}{#2}{#3}%
+  }%
+}
+
+
+%%%%% 0.2 Expandable Version
+\cs_new:Nn \xcntperchap_obtaintrackedvalue_exp_orig:nnn {%
+  \int_set:Nx \l_tracklevelunit_int {#1}
+  \seq_if_in:cnT {g_xcntperchap_tracklevel_#2_seq} {#3} 
+  {
+    \int_set:Nx \l_tracklevel_tracked_int {\seq_count:c {g_xcntperchap_tracklevel_#2_seq}}
+    \int_zero:N \l_tmpa_int
+    \seq_map_inline:cn {g_xcntperchap_tracklevel_#2_seq} {%
+      \int_incr:N \l_tmpa_int
+      \tl_if_eq:nnT { ##1 } {#3 } { 
+        \seq_map_break:
+      }
+    }
+    \int_set:NV \l_tmpb_int { \l_tmpa_int }
+    \int_set:Nx \l_tmpa_int { \l_tracklevel_tracked_int * (\l_tracklevelunit_int -1) + \l_tmpb_int  }
+    \seq_item:cn {g_xcntperchap_tracklevelstored_#2_seq} {\int_use:N \l_tmpa_int}
+  }%
+}  
+
+
+\cs_new:Nn \xcntperchap_obtaintrackedvalue_exp:nnn {% Needs some error checking!!!
+  \seq_if_exist:cTF {g_xcntperchap_tracklevel_#2_seq} {
+    \seq_item:cn {g_xcntperchap_tracklevelstored_#2_seq} { \seq_count:c {g_xcntperchap_tracklevel_#2_seq} * \int_eval:n{#1-1}+\prop_item:cn {g_xcntperchap_tracklevel_#2_prop} {#3}}
+  }{
+    \typeout{Error!}%
+  }
+}
+
+\DeclareExpandableDocumentCommand{\ObtainTrackedValueExp}{omm}{%
+  \IfValueTF{#1}{%
+    \xcntperchap_obtaintrackedvalue_exp:nnn {#1}{#2}{#3}%
+  }{%
+    \xcntperchap_obtaintrackedvalue_exp:nnn {\number\value{#2}}{#2}{#3}
+  }
+}
+
+
+\NewDocumentCommand{\GetStoredValues}{}{%
+  \xcntperchap_gettrackedvalues_from_file:n {\g_trackfile_storage_read}
+}
+
+
+
+\ExplSyntaxOff
+
+\@onlypreamble\RegisterCounters
+\makeatother
+
+
+\AtBeginDocument{%
+  \LoadTrackedValues%
+  \OpenTrackFileForWrite{\jobname.cpc}%
+}
+
+\AtEndDocument{%
+  \TrackCounters%
+  \CloseTrackFileForWrite%
+}
+\endinput
+


Property changes on: trunk/Master/texmf-dist/tex/latex/xcntperchap/xcntperchap.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-06-10 23:21:30 UTC (rev 41359)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-06-10 23:22:27 UTC (rev 41360)
@@ -617,7 +617,7 @@
     widetable williams withargs
     wnri wnri-latex wordlike
     wrapfig wsemclassic wsuipa
-  xargs xassoccnt xcharter xcite xcjk2uni xcolor xcolor-solarized
+  xargs xassoccnt xcharter xcite xcjk2uni xcntperchap xcolor xcolor-solarized
     xcomment xcookybooky xdoc xduthesis
     xebaposter xecjk xecolor xecyr xeindex xellipsis
     xepersian xesearch xespotcolor

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2016-06-10 23:21:30 UTC (rev 41359)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2016-06-10 23:22:27 UTC (rev 41360)
@@ -1062,6 +1062,7 @@
 depend wrapfig
 depend xargs
 depend xassoccnt
+depend xcntperchap
 depend xcolor-solarized
 depend xcomment
 depend xdoc

Added: trunk/Master/tlpkg/tlpsrc/xcntperchap.tlpsrc
===================================================================


More information about the tex-live-commits mailing list