From 6701b05506a127ff463d499fb6b6badaf9055b2d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 29 Dec 2018 22:50:45 +0000 Subject: crossreftools (29dec18) git-svn-id: svn://tug.org/texlive/trunk@49530 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/crossreftools/crossreftools.sty | 43 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty') diff --git a/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty b/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty index cf89b6fbc97..747946de523 100644 --- a/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty +++ b/Master/texmf-dist/tex/latex/crossreftools/crossreftools.sty @@ -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@refundefined}{#1}} +\newcommand{\crt@crefundefinedcountervalue}{1977} +\newcommand{\crtcrefundefinedcountervalue}[1]{\renewcommand{\crt@refundefinedcountervalue}{#1}} + + + \@onlypreamble\crtrefundefined +\@onlypreamble\crtcrefundefinedcountervalue @@ -166,28 +172,49 @@ \@@crtextr@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@crefundefinedcountervalue% + }{% + \crtcrefnumber{#1}% + }% +} + -%%%%% + +%%%%%%%%%%%%%%%% % Default cref format \newcommand{\crtcref}[1]{% - \expandafter\ifx\csname r@#1\endcsname\relax + \expandafter\ifx\csname r@#1@cref\endcsname\relax \crt@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@cref\endcsname\relax \crt@refundefined% \else - \crtCrefnamebylabel{#1} \crtcrefnumber{#1}% + \crtCrefnamebylabel{#1} %\crtcrefreference{#1}% \fi } +%%%%% + + +%%%%% + % refcount - like support -- cgit v1.2.3