texlive[46142] Master/texmf-dist: crossreftools (26dec17)

commits+karl at tug.org commits+karl at tug.org
Tue Dec 26 23:07:36 CET 2017


Revision: 46142
          http://tug.org/svn/texlive?view=revision&revision=46142
Author:   karl
Date:     2017-12-26 23:07:36 +0100 (Tue, 26 Dec 2017)
Log Message:
-----------
crossreftools (26dec17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/crossreftools/README
    trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.pdf
    trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex
    trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.pdf
    trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex
    trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty

Modified: trunk/Master/texmf-dist/doc/latex/crossreftools/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crossreftools/README	2017-12-26 22:07:24 UTC (rev 46141)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/README	2017-12-26 22:07:36 UTC (rev 46142)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.3 (2017/10/31 -- 08:23:52)
+%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15)
 %% README file for crossreftools.sty
 %%
 %%

Modified: trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex	2017-12-26 22:07:24 UTC (rev 46141)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex	2017-12-26 22:07:36 UTC (rev 46142)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.3 (2017/10/31 -- 08:23:52)
+%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15)
 %% Documentation file for crossreftools.sty
 %%
 %%
@@ -21,9 +21,19 @@
 
 \documentclass[12pt,a4paper,oneside]{article}
 
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}%
 
 
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{minitoc}
+\usepackage{tocbibind}
 
+
+
+
+
 \usepackage[lmargin=2cm,rmargin=2cm,headheight=15pt]{geometry}
 \usepackage{savesym}
 \usepackage{bbding}
@@ -34,7 +44,6 @@
 \usepackage[x11names]{xcolor}
 \usepackage{imakeidx}
 \usepackage{fontawesome}
-\usepackage[most,documentation]{tcolorbox}
 \usepackage[tikz]{bclogo}
 \usepackage{marginnote}
 \usepackage{fancyhdr}
@@ -44,11 +53,14 @@
 \usepackage{xparse}
 \usepackage{totcount}
 \usepackage{enumitem}
+\usepackage{caption}
 \usepackage{microtype}
-\usepackage{caption}
 \usepackage[T1]{fontenc}
 \usepackage[scaled=0.92]{helvet}
 
+\usepackage[most,documentation]{tcolorbox}
+
+
 \newlist{codeoptionsenum}{enumerate}{1}
 \setlist[codeoptionsenum,1]{label={\textcolor{blue}{\#\arabic*}}}
 
@@ -81,6 +93,8 @@
 
 \@namedef{crossreftoolsversion0.3}{v0.3 2017-10-29}
 
+\@namedef{crossreftoolsversion0.4}{v0.4 2017-12-06}
+
 \newcommand{\authorname}{Autor}
 
 
@@ -300,24 +314,16 @@
 }
 
 
-\usepackage[T1]{fontenc}
-\usepackage{graphicx}%
 
+\usepackage{bookmark}
 
-\usepackage{amsmath}
-\usepackage{amssymb}
-\usepackage{minitoc}
-\usepackage{tocbibind}
 
-
-\usepackage{bookmark}
-
 \usepackage{cleveref}
 
 
 
 
-\def\packageversion{0.3}
+\def\packageversion{0.4}
 
 \def\hyperrefversionwithfifthargument{v6.85a}
 
@@ -358,6 +364,7 @@
 }
 
 
+
 \begin{document}
 
 \yyyymmdddate
@@ -369,7 +376,7 @@
 
 
 
-\CHPackageTitlePage[packageauthor={Christian Hupfer}]{Expandable extraction of cleveref and other label data}
+\CHPackageTitlePage[packageauthor={Christian Hupfer}]{Expandable extraction of cleveref or cross reference data and label utilities}
 
 
 \clearpage
@@ -379,7 +386,9 @@
 \CHDocConventions
 \clearpage
 
+\crtlistoflabels
 
+
 \pagestyle{plain}
 
 
@@ -396,9 +405,10 @@
 Whereas \CHDocPackage{cleveref} provides \cs{labelcref} and other commands or \cs{ref} from standard \LaTeX2e kernel none of those are expandable and can not be used in an \cs{edef} - approach. 
 
 \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|
+Most times class and package authors will benefit of this package, but there might be usual documents that need the features of \CHDocPackage{\PackageDocName}
 \end{marker}
 
+All macros from this package use the prefix \cs{crt\dots}, eg \refCom{crtrefname}. 
 
 \section{Requirements, loading and incompatibilities}%
 
@@ -411,22 +421,55 @@
 No packages are loaded by \CHDocPackage{crossreftools}, this package does neither load \CHDocPackage{hyperref} nor \CHDocPackage{cleveref} itself. 
 
 
-\subsection{Loading of the package}
+\subsection{Loading of the package} \label{subsection::loadingofpackage}
 
 Loading is done with
 
-\begin{tcblisting}{listing only}
-\usepackage[options]{crossreftools}
-\end{tcblisting}
+\begin{tcolorbox}
+\verb!\usepackage[options]{crossreftools}!
+\end{tcolorbox}
 
-As of version \packageversion\ \CHDocPackage{\PackageDocName} does not have options.
+As of version \packageversion\ \CHDocPackage{\PackageDocName} does have following option(s):
 
-There is no loading order required. The macros expand to \makeatletter\fbox{\crt at refundefined}\makeatother\ if \CHDocPackage{cleveref} is not loaded. 
+\begin{itemize}
+  \item \texttt{draft}
+    
+    By default, unless specified as package or class option, \CHDocPackage{\PackageDocName} works in draft mode, i.e. \CHDocTag{List of Labels} is enabled, see \crtcrefcounter{section::listoflabels} \nameref{section::listoflabels} for more on this. 
+    
+  \item \texttt{final}
 
+    This disables the feature \CHDocTag{List of Labels}, see \crtcrefcounter{section::listoflabels} \nameref{section::listoflabels} for more information about this feature -- it is considered to be unnecessary having a List of Labels in a final version of document. 
+
+By default, the package works in \texttt{draft} - mode, unless the class option \texttt{final} is specified already. In this case, the package option \texttt{final} can be omitted. 
+\end{itemize}
+
+
+
+
+There is no loading order required. The macros related to \CHDocPackage{cleveref} expand to \makeatletter\fbox{\crt at refundefined}\makeatother\ if \CHDocPackage{cleveref} is not loaded. 
+
+\begin{marker}
+  In order to ensure that the changes to the cross referencing system introduced by \CHDocPackage{hyperref} and \CHDocPackage{cleveref} it is recommened to load \CHDocPackage{\PackageDocName} after both packages. 
+\end{marker}
+
 \subsection{Incompatibilities}\label{subsection:incompatibilities}
 
-As of \packageversion\ this package cannot be used with plain \TeX\ 
+\begin{itemize}
+  \item Plain \TeX:
 
+    
+As of \packageversion\ this package cannot be used with plain \TeX, since there is no real built-in support for cross-referencing in plain \TeX. 
+\item Issue with \cs{tcb at cs} from the \CHDocPackage{tcolorbox} and its \fbox{documentation} library regarding the \cs{crtlistoflabels} usage. 
+
+  As of \packageversion\ this package cannot cope with labels produced from \CHDocPackage{tcolorbox} for documented code -- this inserts an unexpandable call of \cs{tcb at cs} in the label content which leaves unpleasant content in the List Of Labels (see \nameref{section::listoflabels}). As long as no other solution is available, \cs{tcb at cs} is redefined to gobble its argument only and doing nothing inside the \refCom{crtlistoflabels} macro. 
+
+\begin{marker}
+  This is the cause for the special \cs{refCom} macro provided by the documentation library from \CHDocPackage{tcolorbox}.
+\end{marker}
+  
+\item Similarly any unexpandable content written to the \CHDocFileExt{aux} - file by redefinitions of \cs{label} or \cs{@currentlabel} etc. will cause problems. 
+\end{itemize}
+
 \clearpage
 
 \part{Macro descriptions}
@@ -433,6 +476,24 @@
 
 \parttoc
 
+\section{Indicating undefined references}
+
+\CHDocPackage{\PackageDocName} uses the content of the internal macro \cs{crt at refundefined} which defaults to \makeatletter\crt at refundefined\makeatother. 
+Use \refCom{crtrefundefinedtext} to change the output of \cs{crt at refundefined}.
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtrefundefinedtext}{\marg{undefined reference indication text}}
+
+
+This command sets the output of \cs{crt at refundefined} in the same manner like the standard macro \cs{title} would do for \cs{@title}. 
+
+\begin{marker}
+  \refCom{crtrefundefinedtext} is a preamble-only macro. 
+\end{marker}
+\end{docCommand}
+
+
+
+
 \section{Extracting information from regular labels}\label{section:extractingregularlabels}
 
 Depending on loading of \CHDocPackage{hyperref} there is some more information (properties) stored with a \cs{label} command. Common properties are \texttt{reference} and \texttt{page}, additions of \CHDocPackage{hyperref} are \texttt{name}, \texttt{anchor} and the (yet) unused 5th argument of \cs{newlabel}, the property is called \texttt{unused} as of version \packageversion.
@@ -462,7 +523,7 @@
 This extracts the reference value (or something that is stored by \cs{@currentlabel} belonging to a certain label name.
 \end{docCommand}
 
-With \CHDocPackage{hyperref} being loaded, following return non-empty label information, without \CHDocPackage{hyperref} they are available, but expand to nothing.
+With \CHDocPackage{hyperref} being loaded, following commands return non-empty label information, without \CHDocPackage{hyperref} they are available, but expand to nothing.
 
 \begin{docCommand}[code={\CHDocExpCommand{}},
 doc new={\chdocextractversion{crossreftoolsversion0.3}}]{crtrefname}{\marg{label name}}
@@ -482,16 +543,24 @@
 This extracts the yet unused 5th argument of labels generated after \CHDocPackage{hyperref} is loaded. As of version \hyperrefversionwithfifthargument\ of \CHDocPackage{hyperref}, this argument has no meaning yet. If this is going to be change in future, \refCom{crtrefunused} will probably be removed and replaced by another macro that reflects the meaning of this 5th argument. 
 \end{docCommand}
 
+\begin{docCommand}[code={\CHDocExpCommand{}},
+doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtrefcounter}{\marg{label name}}
 
+This macro tries to extract the counter name related to the label assuming that the standard anchor type is used: \texttt{X.Y} where \texttt{X} stands for the counter name and \texttt{Y} is some alphanumerical value constructed from \cs{theHX}, e.g. \cs{theHchapter}. If this pattern fails, \refCom{crtrefcounter} will not compile. 
 
+\end{docCommand}
+
+
 \section{Extracting information from cleveref}
 
 The \CHDocPackage{cleveref} package redefines the \cs{label} macro and stores another label with the same basic name and a suffix \string @cref, so 
 
-\begin{tcblisting}{listing only}
-\label{foo}
-\end{tcblisting}
+\tcbinputlisting{breakable,listing only,listing file=labelstuff.tex}
 
+%\begin{tcblisting}{listing only}
+%\section{Stuff}
+%\end{tcblisting}
+
 would generate both the labels \verb!foo! and \verb!foo at cref!. The \CHDocPackage{cleveref} - version of a label saves basically five properties to the \CHDocFileExt{.aux} - file. 
 
 
@@ -516,8 +585,6 @@
     This property stores the page number of the \cs{label} usage.
     
 \end{itemize}
-
-\clearpage
 \CHDocPackage{\PackageDocName} extracts those properties with \refCom{crtextractcref}. 
 
 \begin{docCommand}[code={\CHDocExpCommand{}},
@@ -637,7 +704,7 @@
 
 This generates a linked reference to a given label like \cs{cref} would do. If \CHDocPackage{hyperref} is not loaded, no link but only the reference text is displayed. 
 
-For the upper case version see \refCom{crtcref}. 
+For the upper case version see \refCom{crthyperCref}. 
 \end{docCommand}
 
 \begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.3}]
@@ -645,11 +712,158 @@
 
 This generates a linked reference to a given label like \cs{Cref} would do. If \CHDocPackage{hyperref} is not loaded, no link but only the reference text is displayed. 
 
-For the lower case version see \refCom{crtcref}. 
+For the lower case version see \refCom{crthypercref}. 
 \end{docCommand}
 
 
+\section{Placing more generic labels}\label{section::placing-generic-labels}
 
+Sometimes it is necessary to refer to content that is not connected to a counter and \cs{refstepcounter}. In this case the macros \refCom{crtprovidecurrentlabel}, \refCom{crtprovidecurrentlabelname}, 
+
+\refCom{crtprovidecurrentlabelinfo} and \refCom{crtcrossreflabel} may be useful.
+
+\begin{marker}
+  None of the macros placing 'arbitrary' labels described in this section is expandable! 
+\end{marker}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtprovidecurrentlabel}{\marg{usual label content}}
+This sets \cs{@currentlabel} which is later on stored to be the label content with \cs{label} and being displayed with the various variants of \cs{ref} or \cs{cref} etc. from \CHDocPackage{cleveref}. 
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtprovidecurrentlabelname}{\marg{nameref label content}}
+This sets \cs{@currentlabelname} which is later on stored to be the label content with \cs{label} and being displayed with the various variants of \cs{nameref} from \CHDocPackage{hyperref}. 
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtprovidecurrentlabelinfo}{\marg{usual label content}\marg{nameref label content}}
+This is a convenience macro in order to provide both \cs{@currentlabel} and \cs{@currentlabelname} at once. If \CHDocPackage{hyperref} is loaded, a \cs{phantomsection} call is used before calling
+
+\refCom{crtprovidecurrentlabel} and \refCom{crtprovidecurrentlabelname}.
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtcrossreflabel}{\oarg{nameref label content}\marg{usual label content}\oarg{label name}}
+
+This macro is an even more convenient wrapper for \refCom{crtprovidecurrentlabelinfo} by using the 2nd (mandatory) argument both for the usual label and the nameref label content if the 1st optional argument is not specified. This resembles the \cs{caption[]\textbraceleft\textbraceright} or e.g. \cs{section[]\textbraceleft\textbraceright} mechanism where the first optional argument is used for the ToC - related entries. 
+
+The 2nd optional argument is placing the \cs{label} with the relevant label name. 
+
+\begin{marker}
+  Please note that depending on the presence of the 1st optional argument either the 2nd or der 1st argument is displayed in the input stream, i.e. in the document text. If this is not requested, use the starred form \refCom{crtcrossreflabel*}.
+\end{marker}
+
+
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtcrossreflabel*}{\oarg{nameref label content}\marg{usual label content}\oarg{label name}}
+
+This behaves like \refCom{crtcrossreflabel} but suppresses the output of the 2nd or 1st argument explicitly. Use this to place hidden labels and anchors. 
+\end{docCommand}
+
+
+
+\section{Displaying label information}\label{section::listoflabels}
+
+For some reason it might be useful to have a list of all defined labels available. Currently, the support from \CHDocPackage{crossreftools} for this limited, however. 
+
+\begin{marker}
+  \CHDocPackage{crossreftools} redefines \cs{label} at the beginning of the document body. It takes care about a potential optional argument of \cs{label} as is introduced by \CHDocPackage{cleveref}. 
+\end{marker}
+
+
+\subsection{Useful macros for the list of labels}
+
+
+
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtlistoflabels}{}
+This displays a list of all cross-reference labels in the order of their definition, the heading has the title \texttt{\listoflabelsname}, in order to change the title redefine \refCom{listoflabelsname}. 
+
+An ordinary entry to the list - of - labels file (default extension \CHDocFileExt{lla}) is written with \cs{addcontentsline} 
+
+\tcbinputlisting{breakable,listing only,listing file=addcontentslineforlistoflabels.tex}
+
+where \refCom{crt at listoflabelsfileextension} and \refCom{crt at listoflabelsstructurelevel} are internal versions of \refCom{crtlistoflabelsfileextension} and
+
+\refCom{crtlistoflabelsstructurelevel}.
+
+This command does add an entry into the table of contents (\CHDocFileExt{toc} - file) either on chapter or on section level, depending whether the class is \CHDocClass{book} or not. 
+
+If no ToC - entry should be made, use \refCom{crtlistoflabels*}.
+
+\begin{marker}
+  If the package (or class) option \texttt{final} is enabled, the \CHDocTag{List of Labels} feature is disabled and \refCom{crtlistoflabels} expands to nothing. 
+\end{marker}
+
+
+\end{docCommand}
+
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtlistoflabels*}{}
+This behaves like \refCom{crtlistoflabels} but does not generate an entry in the table of contents. 
+
+\end{docCommand}
+
+
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtlistoflabelsfileextension}{\marg{extension}}
+
+This changes the extention of the list of labels file. The value is stored internally in
+
+ \refCom{crt at listoflabelsfileextension} which defaults to \texttt{lla}
+
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crt at listoflabelsfileextension}{}
+
+This holds the extension (without a dot in the name) of the list of labels file. Do not change this macro directly, but use \refCom{crtlistoflabelsfileextension} instead. 
+
+\end{docCommand}
+
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{listoflabelsname}{}
+This is the title of the list of labels heading, it defaults to \texttt{\listoflabelsname}. 
+
+It can be changed with \cs{renewcommand}. 
+
+\end{docCommand}
+
+
+
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtlistoflabelsstructurelevel}{\marg{counter name}}
+
+This changes the level of the label entries in the list of labels. The value is stored internally in \cs{crt at listoflabelsstructurelevel} which defaults to \texttt{section}
+
+\begin{marker}
+This is a preamble - only macro. 
+\end{marker}
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crt at listoflabelsstructurelevel}{}
+
+This holds the structure level of the list of labels entries. Do not change this macro directly, but use \refCom{crtlistoflabelsstructurelevel} instead. 
+
+\end{docCommand}
+
+
+\subsection{Useful macros for the label command}
+
+\CHDocPackage{crossreftools} provides two hook macros to be usable inside of the \cs{label} command
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtprelabelhook}{\marg{argument}}
+This hook is executed before the internally stored \cs{label} is called, the argument can be 'anything'. 
+
+By default, this macro expands to nothing, but can be redefined with \cs{renewcommand}. 
+
+\end{docCommand}
+
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtpostlabelhook}{\marg{argument}}
+This hook is executed after the internally stored \cs{label} is called, the argument can be 'anything'. 
+
+By default, this macro expands to nothing, but can be redefined with \cs{renewcommand}. 
+
+\end{docCommand}
+
+
 \clearpage
 \part{Examples}
 
@@ -659,17 +873,34 @@
 
 \tcbinputlisting{breakable,listing only,listing file=crossreftools_driver.tex}
 
+
+
+
 \clearpage
+\part{Meta information}
 \section{Version history}
 
 
 \begin{itemize}[itemsep=15pt]
-\item \CHDocFullVersion{0.3} Added the extraction macros for regular labels (i.e. not the \CHDocPackage{cleveref} - related ones) and convenience wrappers for generating links. 
-\item \CHDocFullVersion{0.2} Introduced a check in \refCom{crtcrefnamebylabel} and \refCom{crtCrefnamebylabel} whether given label exists
-\item   \CHDocFullVersion{0.1} First version
+\item \CHDocFullVersion{0.4} 
+  \begin{itemize}
+    \item Corrected typos in this documentation
+    \item Added the \CHDocTag{List of Labels} feature and the relevant macros from \cref{section::listoflabels}.
+    \item Added the \texttt{final} and \texttt{draft} package options. 
+    \item Introduced more generic label content macros. 
 \end{itemize}
+\item \CHDocFullVersion{0.3} 
 
+Added the extraction macros for regular labels (i.e. not the \CHDocPackage{cleveref} - related ones) and convenience wrappers for generating links. 
+\item \CHDocFullVersion{0.2} 
 
+Introduced a check in \refCom{crtcrefnamebylabel} and \refCom{crtCrefnamebylabel} whether given label exists
+\item   \CHDocFullVersion{0.1} 
+
+First version
+\end{itemize}
+
+
 \printindex
 
 \end{document}

Modified: trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex	2017-12-26 22:07:24 UTC (rev 46141)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex	2017-12-26 22:07:36 UTC (rev 46142)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.3 (2017/10/31 -- 08:23:52)
+%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15)
 %% Driver file for crossreftools.sty
 %%
 %%
@@ -36,11 +36,18 @@
 \def\equationlabeltoshow{fooequationlabel}
 
 
+\crtlistoflabelsstructurelevel{section}
 \begin{document}
 
+\tableofcontents
 
-\setcounter{chapter}{16}
+\crtlistoflabels*
 
+\clearpage
+
+\chapter{Some easy usages of crossreftools}
+%\setcounter{chapter}{16}% Just for checking
+
 Let us refer the usual way: \Cref{\labeltoshow}
 
 \edef\foocntr{\crtcrefcounter{\labeltoshow}}  
@@ -72,6 +79,7 @@
 The 5th (and usually empty) label property introduced by hyperref is unused as of version v6.85a of that package -- \crtextractref{unused}{labelname} will return nothing here, i.e. the expansion is empty.  
 
 
+This works only if there is usual hyper anchor for the counter: \crtrefcounter{fooequationlabel}. 
 
 \section{Extracting the cleveref names}
 
@@ -91,9 +99,22 @@
 The macro \verb!\crtextractcref! is expandable!\edef\counterof{\crtextractcref{counter}{\labeltoshow}} Using the stored value for counter: \counterof!
 
 
-See \crthyperCref{fooequationlabel}
+See \crthyperCref{fooequationlabel} and \cref{pythagoreantheorem}.
 
 
+
+\chapter{Placing more generic labels}
+
+\clearpage
+\crtcrossreflabel[Let us place a label without a counter]{Let us plant a label not being connected to a counter:}[somelabel]
+
+
+
+\clearpage
+
+See \ref{somelabel} or \nameref{somelabel} on \cpageref{somelabel}
+
+
 \chapter{This is foo}\label{foochapterlabel}
 
 \setcounter{section}{5}
@@ -107,4 +128,11 @@
   E=mc^{2}\label{fooequationlabel}
 \end{equation}
 
+
+\clearpage
+
+\section{Another foo bar section}
+\begin{equation}
+  a^{2} + b^{2}=c^{2}\label[section]{pythagoreantheorem}% Explicitly use a wrong counter type here for testing
+\end{equation}
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty	2017-12-26 22:07:24 UTC (rev 46141)
+++ trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty	2017-12-26 22:07:36 UTC (rev 46142)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.3 (2017/10/31 -- 08:23:52)
+%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15)
 %% Source file for crossreftools.sty
 %%
 %%
@@ -19,16 +19,25 @@
 %%
 %%
 
-\def\crossreftoolspackageversion{0.3}
+\def\crossreftoolspackageversion{0.4}
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 
-\ProvidesPackage{crossreftools}[2017/10/31 - v\crossreftoolspackageversion]
+\ProvidesPackage{crossreftools}[2017/12/26 - v\crossreftoolspackageversion]
 
+\newif\ifcrtfinal
+\DeclareOption{final}{\global\crtfinaltrue}
+\DeclareOption{draft}{\global\crtfinalfalse}
 
+\ProcessOptions*
+
 % Some helper macros
+
 \newcommand{\crt at refundefined}{[UNDEFINED]}
 
+\newcommand{\crtrefundefinedtext}[1]{\renewcommand{\crt at refundefined}{#1}}
 
+\@onlypreamble\crtrefundefined
+
 % Splitters for cleveref
 
 \def\crt@@cref@@splitter@@first[#1][#2][#3]#4\@nil{%
@@ -280,6 +289,21 @@
   \@@crtextr at ct@ref{name}{#1}% 
 }
 
+%%%
+
+\def\crt at split@@@anchor#1.#2\@nil{#1}
+\def\crt at split@@anchor#1#2#3#4#5{\crt at split@@@anchor#4\@nil}
+\def\crt at split@anchor#1{%
+  \expandafter\crt at split@@anchor#1%
+}
+
+\newcommand{\crtrefcounter}[1]{%
+  \@ifundefined{r@#1}{\crt at refundefined}{%
+    \expandafter\crt at split@anchor\expandafter{\csname r@#1\endcsname}%
+  }%
+}
+
+
 %%% Hyperref wrappers, not expandable. 
 
 
@@ -299,6 +323,173 @@
   \crthyperlink{\crtrefanchor{#1}}{\crtCref{#1}}%
 }
 
+%%% Support for list of labels
 
+\providecommand*{\listoflabelsname}{List of labels}
+
+\@ifclassloaded{book}{
+  \providecommand*{\listoflabelstructurelevel}{%
+    chapter%
+  }
+}{%
+  \providecommand*{\listoflabelstructurelevel}{%
+    section%
+  }
+}
+
+
+\newcommand{\crt at listoflabelsfileextension}{lla}
+\newcommand{\crt at listoflabelsstructurelevel}{section}
+
+\newcommand{\crtlistoflabelsstructurelevel}[1]{%
+  \renewcommand{\crt at listoflabelsstructurelevel}{#1}%
+}
+
+\newcommand{\crtlistoflabelsfileextension}[1]{%
+  \renewcommand{\crt at listoflabelsfileextension}{#1}%
+}
+
+
+
+
+\newcommand{\crtlistoflabels at unstarred}{%
+  \addcontentsline{toc}{\listoflabelstructurelevel}{\listoflabelsname}%
+  \@crt at listofl@bels%
+}
+
+
+\newcommand{\crtlistoflabels at starred}{%
+  \@crt at listofl@bels%
+}
+
+
+\newcommand{\@crt at listofl@bels}{%
+  \begingroup
+  \makeatletter
+  % In case of loading tcolorbox documentation mode
+  \@ifundefined{tcb at cs}{}{% Redefine \tcb at cs to gobble its argument
+    \renewcommand{\tcb at cs}[1]{}%
+  }%
+  \@input{\jobname.\crt at listoflabelsfileextension}
+  \if at filesw
+  \expandafter\newwrite\csname tf@\crt at listoflabelsfileextension\endcsname
+  \immediate\openout \csname tf@\crt at listoflabelsfileextension\endcsname \jobname.\crt at listoflabelsfileextension\relax
+  \fi
+  \endgroup
+}
+
+
+
+\newcommand{\crtlistoflabels}{%
+  \ifcrtfinal
+  \else
+  \csname\listoflabelstructurelevel\endcsname*{\listoflabelsname\@mkboth{\MakeUppercase{\listoflabelsname}}{\MakeUppercase{\listoflabelsname}}}%
+  \@ifstar{\crtlistoflabels at starred}{\crtlistoflabels at unstarred}%
+  \fi
+}
+
+
+\newcommand{\crtaddlabeltotoc}[1]{%
+  \ifcrtfinal
+  \else
+  \addcontentsline{\crt at listoflabelsfileextension}{\crt at listoflabelsstructurelevel}{\protect\numberline{\expandafter\crtrefnumber{#1}}#1}%
+  \fi
+}
+
+
+\@onlypreamble{\crtlistoflabelsstructurelevel}
+
+\providecommand{\crtprelabelhook}[1]{}
+\providecommand{\crtpostlabelhook}[1]{}
+
+
+%%%%%%%%%%%%%% Support for generic labels
+
+
+
+\newcommand{\crtprovidecurrentlabelname}[1]{%
+  \protected at edef\@currentlabelname{#1}%
+}
+
+\newcommand{\crtprovidecurrentlabel}[1]{%
+  \protected at edef\@currentlabel{#1}%
+}
+
+\newcommand{\crtprovidecurrentlabelinfo}[2]{%
+  \if at crt@hyperrefloaded
+  \phantomsection%
+  \fi
+  \protected at edef\@currentlabel{#1}%
+  \protected at edef\@currentlabelname{#2}%
+}
+
+
+
+\def\crt@@genericl at belopt@rgi[#1]#2{%
+  \crtprovidecurrentlabelinfo{#2}{#1}%
+  #1%
+  \@ifnextchar[{\crt@@genericl at belopt@rgii}{}
+}
+
+
+\def\scrt@@genericl at belopt@rgi[#1]#2{%
+  \crtprovidecurrentlabelinfo{#2}{#1}%
+  \@ifnextchar[{\crt@@genericl at belopt@rgii}{}
+}
+
+
+\def\crt@@genericl at belopt@rgii[#1]{%
+  \label{#1}%
+}
+
+  
+
+\def\crt@@genericl at belnoopt#1{%
+  \crtprovidecurrentlabelinfo{#1}{#1}%
+  #1%
+  \@ifnextchar[{\crt@@genericl at belopt@rgii}{}%
+}
+
+\def\scrt@@genericl at belnoopt#1{%
+  \crtprovidecurrentlabelinfo{#1}{#1}%
+  \@ifnextchar[{\crt@@genericl at belopt@rgii}{}%
+}
+
+
+\newcommand{\crtcrossreflabel}{%
+  \@ifstar{%
+    \@ifnextchar[{\scrt@@genericl at belopt@rgi}{\scrt@@genericl at belnoopt}%
+  }{%
+    \@ifnextchar[{\crt@@genericl at belopt@rgi}{\crt@@genericl at belnoopt}%
+  }%
+}
+
+%%%%%%%%%%%%%%
+
+
+
+\AtBeginDocument{%
+
+  \let\crt at l@bels at fe\label
+
+  \newcommand{\l at belwithopt@rg}[2][]{%
+    \crtprelabelhook{#2}%
+    \crt at l@bels at fe[#1]{#2}%
+    \crtaddlabeltotoc{#2}%
+    \crtpostlabelhook{#2}%
+  }
+  \newcommand{\l at belwithoutopt@rg}[1]{%
+    \crtprelabelhook{#1}%
+    \crt at l@bels at fe{#1}%
+    \crtaddlabeltotoc{#1}%
+    \crtpostlabelhook{#1}%
+  }
+
+  \renewcommand{\label}{%
+    \@ifnextchar[{\l at belwithopt@rg}{\l at belwithoutopt@rg}%
+  }
+}
+
 \endinput
 
+



More information about the tex-live-commits mailing list