texlive[49530] Master/texmf-dist: crossreftools (29dec18)

commits+karl at tug.org commits+karl at tug.org
Sat Dec 29 23:50:45 CET 2018


Revision: 49530
          http://tug.org/svn/texlive?view=revision&revision=49530
Author:   karl
Date:     2018-12-29 23:50:45 +0100 (Sat, 29 Dec 2018)
Log Message:
-----------
crossreftools (29dec18)

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	2018-12-29 22:50:33 UTC (rev 49529)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/README	2018-12-29 22:50:45 UTC (rev 49530)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
+%% LaTeX package crossreftools - version 0.8 (2018/12/29 -- 16:21:53)
 %% 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	2018-12-29 22:50:33 UTC (rev 49529)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex	2018-12-29 22:50:45 UTC (rev 49530)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
+%% LaTeX package crossreftools - version 0.8 (2018/12/29 -- 16:21:53)
 %% Documentation file for crossreftools.sty
 %%
 %%
@@ -99,6 +99,10 @@
 
 \@namedef{crossreftoolsversion0.6}{v0.6 2018-03-18}
 
+\@namedef{crossreftoolsversion0.7}{v0.7 2018-12-28}
+
+\@namedef{crossreftoolsversion0.8}{v0.8 2018-12-29}
+
 \newcommand{\authorname}{Autor}
 
 
@@ -327,7 +331,7 @@
 
 
 
-\def\packageversion{0.6}
+\def\packageversion{0.8}
 
 \def\hyperrefversionwithfifthargument{v6.85a}
 
@@ -503,8 +507,19 @@
 \end{docCommand}
 
 
+Similar to \refCom{crtrefundefinedtext} is \refCom{crtcrefundefinedcountervalue}, providing an integer value in calculation contexts with \cs{ifnum} or \cs{setcounter}. 
 
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.4}}]{crtcrefundefinedcountervalue}{\marg{integer value}}
 
+
+This command sets the output of \cs{crt at crefundefinedcountervalue} in the same manner like the standard macro \cs{title} would do for \cs{@title}. 
+
+\begin{marker}
+  \refCom{crtcrefundefinedcountervalue} 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.
@@ -619,6 +634,15 @@
 \end{docCommand}
 
 \begin{docCommand}[code={\CHDocExpCommand{}},
+doc new={\chdocextractversion{crossreftoolsversion0.8}}]{crtcrefcountervalue}{\marg{label name}}
+
+This extracts the counter value (or something that is stored by \cs{cref at currentlabel} belonging to a certain label name and can be used in any context that requrires integer values.
+
+If the label does not exist, the content of \cs{crt at crefundefinedcountervalue} is returned, which is by default a number, see \refCom{crtcrefundefinedcountervalue} in order how to set the return value. 
+\end{docCommand}
+
+
+\begin{docCommand}[code={\CHDocExpCommand{}},
 doc new={\chdocextractversion{crossreftoolsversion0.1}}]{crtcrefresult}{\marg{label name}}
 
 This extracts the result of the splitting of a counter belonging to a certain label name.
@@ -967,10 +991,27 @@
 
 \clearpage
 \part{Meta information}
+
+\section{Acknowledgements} \label{section::acknowledgements}
+
+I would like to thank Javier Bezos to pointing me out to an issue with \refCom{crtcrefnumber} when being used as counter value extracting and inserting it again into \cs{setcounter} or any other occurence where a number value is expected. 
+
+This issue is regarded fixed with \refCom{crtcrefcountervalue}. 
+
+
 \section{Version history}
 
 
 \begin{itemize}[itemsep=15pt]
+
+\item \CHDocFullVersion{0.8} 
+
+  Added \refCom{crtcrefcountervalue}, see \cref{section::acknowledgements} for some explanation. 
+
+\item \CHDocFullVersion{0.7} 
+
+  Corrected two typos in \refCom{crtcref} and \refCom{crtCref}, leading to wrong reports of reference numbers. 
+
 \item \CHDocFullVersion{0.6} 
   \begin{itemize}
     \item Corrected the typo in this manual about \refCom{crtifdefinedlabel} and \refCom{crtifundefinedlabel}

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	2018-12-29 22:50:33 UTC (rev 49529)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex	2018-12-29 22:50:45 UTC (rev 49530)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
+%% LaTeX package crossreftools - version 0.8 (2018/12/29 -- 16:21:53)
 %% Driver file for crossreftools.sty
 %%
 %%
@@ -21,8 +21,6 @@
 
 \documentclass{book}
 
-
-
 \usepackage{hyperref}
 \usepackage{nameref}
 \usepackage[user]{zref}
@@ -57,6 +55,7 @@
 The counter for \fbox{\labeltoshow} is \foocntr\ or \crtcrefcounter{\labeltoshow}. It is used on page \crtcrefpage{\labeltoshow}. The value for the misspelled label name is \crtcrefnumber{labeltoshowstuff}, whereas the correct value is \crtcrefnumber{\labeltoshow}. 
 
 
+Let us check for a subsection label: \crtcrefcounter{foosubsectionlabel}
 
 The result is \fbox{\crtcrefresult{\labeltoshow}}
 
@@ -123,6 +122,8 @@
 \setcounter{section}{5}
 \section{Foo}\label{foosectionlabel} \zlabel{foosectionlabel}
 
+\subsection{Foo subsection} \label{foosubsectionlabel}
+
 \begin{equation}
   E=mc^{2}\label{firstequationlabel}
 \end{equation}

Modified: trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty	2018-12-29 22:50:33 UTC (rev 49529)
+++ trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty	2018-12-29 22:50:45 UTC (rev 49530)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
+%% LaTeX package crossreftools - version 0.8 (2018/12/29 -- 16:21:53)
 %% Source file for crossreftools.sty
 %%
 %%
@@ -19,10 +19,10 @@
 %%
 %%
 
-\def\crossreftoolspackageversion{0.6}
+\def\crossreftoolspackageversion{0.8}
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 
-\ProvidesPackage{crossreftools}[2018/03/18 - v\crossreftoolspackageversion]
+\ProvidesPackage{crossreftools}[2018/12/29 - v\crossreftoolspackageversion]
 
 \newif\ifcrtfinal
 \newif\ifcleverefcompatmode
@@ -39,7 +39,13 @@
 
 \newcommand{\crtrefundefinedtext}[1]{\renewcommand{\crt at refundefined}{#1}}
 
+\newcommand{\crt at crefundefinedcountervalue}{1977}
+\newcommand{\crtcrefundefinedcountervalue}[1]{\renewcommand{\crt at refundefinedcountervalue}{#1}}
+
+
+
 \@onlypreamble\crtrefundefined
+\@onlypreamble\crtcrefundefinedcountervalue
 
 
 
@@ -166,28 +172,49 @@
   \@@crtextr at ct@cref{page}{#1}%
 }  
 
+%%%%%%%%%%%%%%%%
+%%%% A macro that returns \crtcrefnumber - like the counter value if the label exists 
+%%%% otherwise some default value in order to be able to calculate with the return value
+%%%%
 
-%%%%%
 
+
+\newcommand{\crtcrefcountervalue}[1]{%
+  \crtcrefifundefinedlabel{#1}{%
+    \crt at crefundefinedcountervalue%
+  }{%
+    \crtcrefnumber{#1}%
+  }%
+}
+
+
+
+%%%%%%%%%%%%%%%%
+
 % Default cref format
 
 \newcommand{\crtcref}[1]{%
-  \expandafter\ifx\csname r@#1\endcsname\relax
+  \expandafter\ifx\csname r@#1 at cref\endcsname\relax
   \crt at refundefined%
   \else
-  \crtcrefnamebylabel{#1} \crtcrefnumber{#1}%
+  \crtcrefnamebylabel{#1} \crtcrefreference{#1}%
   \fi
 }
 
 \newcommand{\crtCref}[1]{%
-  \expandafter\ifx\csname r@#1\endcsname\relax
+  \expandafter\ifx\csname r@#1 at cref\endcsname\relax
   \crt at refundefined%
   \else
-  \crtCrefnamebylabel{#1} \crtcrefnumber{#1}%
+  \crtCrefnamebylabel{#1} %\crtcrefreference{#1}%
   \fi
 }
 
 
+%%%%%
+
+
+%%%%%
+
 % refcount - like support
 
 



More information about the tex-live-commits mailing list