texlive[47012] Master/texmf-dist: crossreftools (18mar18)

commits+karl at tug.org commits+karl at tug.org
Sun Mar 18 22:51:41 CET 2018


Revision: 47012
          http://tug.org/svn/texlive?view=revision&revision=47012
Author:   karl
Date:     2018-03-18 22:51:41 +0100 (Sun, 18 Mar 2018)
Log Message:
-----------
crossreftools (18mar18)

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-03-18 21:51:28 UTC (rev 47011)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/README	2018-03-18 21:51:41 UTC (rev 47012)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13)
+%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
 %% 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-03-18 21:51:28 UTC (rev 47011)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex	2018-03-18 21:51:41 UTC (rev 47012)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13)
+%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
 %% Documentation file for crossreftools.sty
 %%
 %%
@@ -97,6 +97,8 @@
 
 \@namedef{crossreftoolsversion0.5}{v0.5 2018-02-23}
 
+\@namedef{crossreftoolsversion0.6}{v0.6 2018-03-18}
+
 \newcommand{\authorname}{Autor}
 
 
@@ -325,7 +327,7 @@
 
 
 
-\def\packageversion{0.5}
+\def\packageversion{0.6}
 
 \def\hyperrefversionwithfifthargument{v6.85a}
 
@@ -710,7 +712,60 @@
 For the lower case version see \refCom{crthypercref}. 
 \end{docCommand}
 
+\section{Lower and upper case references}
 
+\begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.6}]
+{crtlnameref}{\marg{label name}}
+
+This generates a linked reference to the name like \cs{nameref} would do, but the first character is used in lower case mode. % 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{crtunameref}. 
+\end{docCommand}
+
+\begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.6}]
+{crtlnameref*}{\marg{label name}}
+
+This generates a reference like \cs{nameref*} would do, but the first character is used in lower case mode -- no links are generated. 
+For the upper case version see \refCom{crtlnameref*}. 
+\end{docCommand}
+
+
+\begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.6}]
+{crtunameref}{\marg{label name}}
+
+This generates a linked reference to the name like \cs{nameref} would do, but the first character is used in upper case mode. % 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{crtlnameref}. 
+\end{docCommand}
+
+\begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.6}]
+{crtunameref*}{\marg{label name}}
+
+This generates a reference like \cs{nameref*} would do, but the first character is used in upper case mode -- no links are generated. 
+For the lower case version see \refCom{crtlnameref*}. 
+\end{docCommand}
+
+
+\section{Convenience macros}
+
+In case \CHDocPackage{hyperref} shouldn't be loaded, \CHDocPackage{crossreftools} provides some convenience wrapper macros
+
+\begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.6}]
+{crtnameref}{\marg{label name}}
+
+This generates a reference like \cs{nameref*} would do. 
+If \CHDocPackage{hyperref} is not loaded but \CHDocPackage{nameref} is used, no link is generated, so \refCom{crtnameref} acts like \refCom{crtnameref*}
+For the unlinked version see \refCom{crtnameref*}. 
+\end{docCommand}
+
+\begin{docCommand}[doc new=\chdocextractversion{crossreftoolsversion0.6}]
+{crtnameref*}{\marg{label name}}
+
+This generates a reference like \cs{nameref*} would do and does not generate a link. If neither \CHDocPackage{nameref} nor \CHDocPackage{hyperref} is used no output is generated from this macro. 
+For the linked version see \refCom{crtnameref}. 
+\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}, 
@@ -760,7 +815,7 @@
 Sometimes it is necessary to check whether some label exists in order to refer to it. The macros 
 
 \begin{itemize}
-  \item \refCom{crtrefifdefinedlabel}
+  \item \refCom{crtifdefinedlabel}
   \item \refCom{crtcrefifdefinedlabel}
 \end{itemize}
 
@@ -769,17 +824,17 @@
 Those macros have related commands that revert the test, i.e. they check for the non-existence of a label:
 
 \begin{itemize}
-  \item \refCom{crtrefifundefinedlabel}
+  \item \refCom{crtifundefinedlabel}
   \item \refCom{crtcrefifundefinedlabel}
 \end{itemize}
 
 
-\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtrefifdefinedlabel}{\marg{label name}\marg{true branch}\marg{false branch}}
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtifdefinedlabel}{\marg{label name}\marg{true branch}\marg{false branch}}
 This checks whether the label 'label name' is defined and executes the true branch, otherwise the false branch. 
 \end{docCommand}
 
 
-\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtrefifundefinedlabel}{\marg{label name}\marg{true branch}\marg{false branch}}
+\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtifundefinedlabel}{\marg{label name}\marg{true branch}\marg{false branch}}
 This checks whether the label 'label name' is undefined and executes the true branch, otherwise the false branch. 
 \end{docCommand}
 
@@ -916,6 +971,13 @@
 
 
 \begin{itemize}[itemsep=15pt]
+\item \CHDocFullVersion{0.6} 
+  \begin{itemize}
+    \item Corrected the typo in this manual about \refCom{crtifdefinedlabel} and \refCom{crtifundefinedlabel}
+    \item Added the macros \refCom{crtlnameref} and \refCom{crtunameref} for providing a lower and upper case version of the first character in a \cs{nameref} - like usage.  
+     \item Provided the convenience wrappers \refCom{crtnameref} and \refCom{crtnameref*} in order to make code compilable if \CHDocPackage{hyperref} is not loaded. 
+  \end{itemize}
+
 \item \CHDocFullVersion{0.5} 
   \begin{itemize}
     \item Added the \texttt{cleverefcompat} option. 
@@ -922,9 +984,7 @@
     \item Changed the internal code of \refCom{crtcrefpage} which was necessary after the update of \CHDocPackage{cleveref} to version 0.21
     \item Added some macros that check for label existence, see \cref{sec:checkinglabelexistence} about this. 
 \end{itemize}
-\item \CHDocFullVersion{0.3} 
 
-
 \item \CHDocFullVersion{0.4} 
   \begin{itemize}
     \item Corrected typos in this documentation

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-03-18 21:51:28 UTC (rev 47011)
+++ trunk/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex	2018-03-18 21:51:41 UTC (rev 47012)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13)
+%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
 %% Driver file for crossreftools.sty
 %%
 %%
@@ -24,6 +24,7 @@
 
 
 \usepackage{hyperref}
+\usepackage{nameref}
 \usepackage[user]{zref}
 \usepackage{cleveref}
 
@@ -107,13 +108,14 @@
 \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]
+\crtcrossreflabel[Let us place a label without a counter]{Let us plant a label not being connected to a counter:}[somelabel] and \crtcrossreflabel*{some visible text that is invisibly placed here}[invisiblelabel]
 
 
 
+
 \clearpage
 
-See \ref{somelabel} or \nameref{somelabel} on \cpageref{somelabel}
+See \ref{somelabel} or \crtnameref{somelabel} on \cpageref{somelabel}, but \crtlnameref{somelabel}. \crtunameref{invisiblelabel}
 
 
 \chapter{This is foo}\label{foochapterlabel}

Modified: trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty	2018-03-18 21:51:28 UTC (rev 47011)
+++ trunk/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty	2018-03-18 21:51:41 UTC (rev 47012)
@@ -1,4 +1,4 @@
-%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13)
+%% LaTeX package crossreftools - version 0.6 (2018/03/18 -- 16:34:57)
 %% Source file for crossreftools.sty
 %%
 %%
@@ -19,10 +19,10 @@
 %%
 %%
 
-\def\crossreftoolspackageversion{0.5}
+\def\crossreftoolspackageversion{0.6}
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 
-\ProvidesPackage{crossreftools}[2018/02/23 - v\crossreftoolspackageversion]
+\ProvidesPackage{crossreftools}[2018/03/18 - v\crossreftoolspackageversion]
 
 \newif\ifcrtfinal
 \newif\ifcleverefcompatmode
@@ -309,9 +309,12 @@
 }
 
 \newcommand{\crtrefcounter}[1]{%
+  \if at crt@hyperrefloaded
   \@ifundefined{r@#1}{\crt at refundefined}{%
     \expandafter\crt at split@anchor\expandafter{\csname r@#1\endcsname}%
   }%
+  \else
+  \fi
 }
 
 
@@ -476,7 +479,106 @@
 }
 
 
+%%%%
 
+% First lower case and first uppercase support
+
+
+\def\crt at first@up#1#2\relax{\uppercase{#1}#2}%
+\def\crt at first@low#1#2\relax{\lowercase{#1}#2}
+
+\newcommand{\crt at firstupper}[1]{\expandafter\expandafter\expandafter\crt at first@up#1\relax}%
+\newcommand{\crt at firstlower}[1]{\expandafter\expandafter\expandafter\crt at first@low#1\relax}%
+
+\def\crt@@lowercase@@splitter#1#2#3#4#5\@nil{%
+  \crt at firstlower{#3}%
+}
+
+\def\crt@@uppercase@@splitter#1#2#3#4#5\@nil{%
+  \crt at firstupper{#3}%
+}
+
+
+\newcommand{\crt at lowercasesplitter}[1]{%
+  \expandafter\crt@@lowercase@@splitter#1\@nil%
+}
+\newcommand{\crt at uppercasesplitter}[1]{%
+  \expandafter\crt@@uppercase@@splitter#1\@nil%
+}
+
+
+\newcommand{\crtlnameref}{%
+  \@ifstar{\@crtlnameref at starred}{\@crtlnameref at unstarred}
+}
+
+\newcommand{\@crtlnameref at starred}[1]{%
+  \crtifdefinedlabel{#1}{%
+    \expandafter\crt at lowercasesplitter\csname r@#1\endcsname%
+  }{}%
+}
+
+\newcommand{\@crtlnameref at unstarred}[1]{%
+  \crtifdefinedlabel{#1}{%
+    \if at crt@hyperrefloaded    
+    \hyperlink{\crtrefanchor{#1}}{\expandafter\crt at lowercasesplitter\csname r@#1\endcsname}%
+    \else
+    \@crtlnameref at starred{#1}%
+    \fi
+  }{}%
+}
+
+
+
+\newcommand{\crtunameref}{%
+  \@ifstar{\@crtunameref at starred}{\@crtunameref at unstarred}
+}
+
+\newcommand{\@crtunameref at starred}[1]{%
+  \crtifdefinedlabel{#1}{%
+    \expandafter\crt at uppercasesplitter\csname r@#1\endcsname%
+  }{}%
+}
+
+\newcommand{\@crtunameref at unstarred}[1]{%
+  \crtifdefinedlabel{#1}{%
+    \if at crt@hyperrefloaded
+    \hyperlink{\crtrefanchor{#1}}{\expandafter\crt at uppercasesplitter\csname r@#1\endcsname}%
+    \else
+    \@crtunameref at starred{#1}%
+    \fi
+  }{}%
+}
+
+%%%%%
+
+% Convenience wrappers 
+
+\newcommand{\crtnameref}{%
+  \crt at nameref%
+}
+
+\newcommand{\crt at nameref}{%
+  \@ifstar{\crt at nameref@starred}{\crt at nameref@unstarred}
+}
+
+\newcommand{\crt at nameref@starred}[1]{%
+  \crtifdefinedlabel{#1}{%
+    \crtrefname{#1}%
+  }{}
+}
+
+\newcommand{\crt at nameref@unstarred}[1]{%
+  \crtifdefinedlabel{#1}{%
+    \if at crt@hyperrefloaded
+    \hyperlink{\crtrefanchor{#1}}{\crtrefname{#1}}%
+    \else
+    \crt at nameref@starred{#1}%
+    \fi
+  }{}%
+}
+  
+  
+
 %%%%%%%%%%%%%%%%%
 
 %%% Checking for existence of a label



More information about the tex-live-commits mailing list