From a634832239bc23a946c5ce5d60c139981f3f141b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 23 Feb 2018 22:07:41 +0000 Subject: crossreftools (23feb18) git-svn-id: svn://tug.org/texlive/trunk@46724 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/crossreftools/README | 4 +- .../doc/latex/crossreftools/crossreftools_doc.pdf | Bin 229067 -> 236148 bytes .../doc/latex/crossreftools/crossreftools_doc.tex | 83 ++++++++++++++++----- .../latex/crossreftools/crossreftools_driver.pdf | Bin 100690 -> 102704 bytes .../latex/crossreftools/crossreftools_driver.tex | 26 ++++++- 5 files changed, 88 insertions(+), 25 deletions(-) (limited to 'Master/texmf-dist/doc/latex/crossreftools') diff --git a/Master/texmf-dist/doc/latex/crossreftools/README b/Master/texmf-dist/doc/latex/crossreftools/README index cca2568b691..935fa9a310e 100644 --- a/Master/texmf-dist/doc/latex/crossreftools/README +++ b/Master/texmf-dist/doc/latex/crossreftools/README @@ -1,9 +1,9 @@ -%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15) +%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13) %% README file for crossreftools.sty %% %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2017 by Dr. Christian Hupfer +%% Copyright (c) 2017 -- 2018 by Dr. Christian Hupfer %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the diff --git a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.pdf b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.pdf index 6c1b7c45c21..65e8b07ec93 100644 Binary files a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.pdf and b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex index cb21cf87e31..06b4159ed19 100644 --- a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex +++ b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_doc.tex @@ -1,9 +1,9 @@ -%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15) +%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13) %% Documentation file for crossreftools.sty %% %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2017 by Dr. Christian Hupfer +%% Copyright (c) 2017 -- 2018 by Dr. Christian Hupfer %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -93,7 +93,9 @@ \@namedef{crossreftoolsversion0.3}{v0.3 2017-10-29} -\@namedef{crossreftoolsversion0.4}{v0.4 2017-12-06} +\@namedef{crossreftoolsversion0.4}{v0.4 2017-12-26} + +\@namedef{crossreftoolsversion0.5}{v0.5 2018-02-23} \newcommand{\authorname}{Autor} @@ -323,7 +325,7 @@ -\def\packageversion{0.4} +\def\packageversion{0.5} \def\hyperrefversionwithfifthargument{v6.85a} @@ -441,6 +443,13 @@ As of version \packageversion\ \CHDocPackage{\PackageDocName} does have followin 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. +\item \texttt{cleverefcompat} + +Use this option if the \CHDocPackage{cleveref} version is older than 0.21. + +\begin{marker} +With the release of \CHDocPackage{cleveref} version 0.21 (dating to 2018/02/08) the format of stored information by \cs{label} changed and causes wrong output of \refCom{crtcrefpage}. Since version \makeatletter\@nameuse{crossreftoolsversion0.5}\makeatother\ this change is caught with \refCom{crtcrefpage}. +\end{marker} \end{itemize} @@ -510,10 +519,9 @@ This command will extract one of the properties \texttt{reference}, \texttt{page For convenience, there are shortcuts to extract a specific property: -\begin{docCommand}[code={\CHDocExpCommand{}}, -doc new={\chdocextractversion{crossreftoolsversion0.3}}]{crtcrefpage}{\marg{label name}} +\begin{docCommand}[code={\CHDocExpCommand{}},doc new and updated={\chdocextractversion{crossreftoolsversion0.3}}{\chdocextractversion{crossreftoolsversion0.5}},after=\par]{crtcrefpage}{\marg{label name}}% -This extracts the page number that would be printed by \cs{pageref}. + This extracts the page number that would be printed by \cs{cpageref}. \end{docCommand} @@ -620,19 +628,6 @@ doc new={\chdocextractversion{crossreftoolsversion0.1}}]{crtcrefreference}{\marg This extracts the reference that would be printed by \cs{cref} or \cs{Cref}, without hyperlinks. \end{docCommand} -\begin{docCommand}[code={\CHDocExpCommand{}}, -doc new={\chdocextractversion{crossreftoolsversion0.1}}]{crtcrefpage}{\marg{label name}} - -This extracts the page number that would be printed by \cs{pageref}. -\end{docCommand} - - -\section{Additional macros and utilities} - -\subsection{Expandable Commands} - -\CHDocPackage{\PackageDocName} provides some expandable helper macros in order to query the cross reference names that are stored with \cs{crefname} and \cs{Crefname} from \CHDocPackage{cleveref}. - \begin{docCommand}[code={\CHDocExpCommand{}}, doc new={\chdocextractversion{crossreftoolsversion0.1}}]{crtcrefname}{\marg{counter name}} @@ -759,6 +754,45 @@ This behaves like \refCom{crtcrossreflabel} but suppresses the output of the 2nd \end{docCommand} +\clearpage +\section{Checking for label existence}\label{sec:checkinglabelexistence} + +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{crtcrefifdefinedlabel} +\end{itemize} + +check for the label existence and execute the relevant true or false conditions for labels defined the usual \cs{label} macro and for their \CHDocPackage{cleveref} version. + +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{crtcrefifundefinedlabel} +\end{itemize} + + +\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtrefifdefinedlabel}{\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}} +This checks whether the label 'label name' is undefined and executes the true branch, otherwise the false branch. +\end{docCommand} + +\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtcrefifdefinedlabel}{\marg{label name}\marg{true branch}\marg{false branch}} +This checks whether the label 'label name' is defined by \CHDocPackage{cleveref} and executes the true branch, otherwise the false branch. +\end{docCommand} + + +\begin{docCommand}[doc new={\chdocextractversion{crossreftoolsversion0.5}}]{crtcrefifundefinedlabel}{\marg{label name}\marg{true branch}\marg{false branch}} +This checks whether the label 'label name' is undefined by \CHDocPackage{cleveref} and executes the true branch, otherwise the false branch. +\end{docCommand} + + \section{Displaying label information}\label{section::listoflabels} @@ -882,6 +916,15 @@ By default, this macro expands to nothing, but can be redefined with \cs{renewco \begin{itemize}[itemsep=15pt] +\item \CHDocFullVersion{0.5} + \begin{itemize} + \item Added the \texttt{cleverefcompat} option. + \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 diff --git a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.pdf b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.pdf index 214fa8e7445..36b9f71283e 100644 Binary files a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.pdf and b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.pdf differ diff --git a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex index f4aa243eebc..69b1863d933 100644 --- a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex +++ b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex @@ -1,9 +1,9 @@ -%% LaTeX package crossreftools - version 0.4 (2017/12/26 -- 17:55:15) +%% LaTeX package crossreftools - version 0.5 (2018/02/23 -- 13:46:13) %% Driver file for crossreftools.sty %% %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2017 by Dr. Christian Hupfer +%% Copyright (c) 2017 -- 2018 by Dr. Christian Hupfer %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -24,6 +24,7 @@ \usepackage{hyperref} +\usepackage[user]{zref} \usepackage{cleveref} \usepackage{crossreftools} @@ -118,7 +119,7 @@ See \ref{somelabel} or \nameref{somelabel} on \cpageref{somelabel} \chapter{This is foo}\label{foochapterlabel} \setcounter{section}{5} -\section{Foo}\label{foosectionlabel} +\section{Foo}\label{foosectionlabel} \zlabel{foosectionlabel} \begin{equation} E=mc^{2}\label{firstequationlabel} @@ -135,4 +136,23 @@ See \ref{somelabel} or \nameref{somelabel} on \cpageref{somelabel} \begin{equation} a^{2} + b^{2}=c^{2}\label[section]{pythagoreantheorem}% Explicitly use a wrong counter type here for testing \end{equation} + + +\chapter{Checking for label existence} + +\crtifdefinedlabel{firstfooequationlabel}{% + Yes, that label exists% +}{ + No, that label does not exist% +} + +\crtcrefifdefinedlabel{fooequationlabel}{% + Yes, that cleveref label exists% +}{ + No, that cleveref label does not exist% +} + + + + \end{document} \ No newline at end of file -- cgit v1.2.3