From c0e1259ef738f3dc6e27246d797cf81a05836f97 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 23 Apr 2010 00:33:14 +0000 Subject: oberdiek update (22apr10) git-svn-id: svn://tug.org/texlive/trunk@17966 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/oberdiek/oberdiek.ins | 2 +- .../texmf-dist/source/latex/oberdiek/oberdiek.tex | 4 +- Master/texmf-dist/source/latex/oberdiek/zref.dtx | 443 +++++++++++++-------- 3 files changed, 286 insertions(+), 163 deletions(-) (limited to 'Master/texmf-dist/source/latex/oberdiek') diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins index 0215cb16e6c..b96894248c9 100644 --- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins +++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins @@ -1,5 +1,5 @@ % oberdiek.ins -% 2010/04/18 +% 2010/04/22 % % Copyright (C) 1999, 2001, 2006 by % Heiko Oberdiek diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex index f517e7ba021..a4b87171592 100644 --- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex +++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex @@ -6,7 +6,7 @@ \newcommand*{\Subject}{CTAN:\CTANdir} \newcommand*{\Author}{Heiko Oberdiek} \newcommand*{\Email}{heiko.oberdiek at googlemail.com} -\newcommand*{\Date}{2010/04/18} +\newcommand*{\Date}{2010/04/22} % Copyright (C) 2006-2010 by % Heiko Oberdiek @@ -334,7 +334,7 @@ [\entrysep] \entry{uniquecounter}{2009/12/18}{1.1}{Provides unlimited unique counter}% [\entrysep] -\entry{zref}{2010/04/17}{2.12}{New reference scheme for \LaTeXe{}}% +\entry{zref}{2010/04/22}{2.14}{New reference scheme for \LaTeXe{}}% \end{overview} \section{Packages} diff --git a/Master/texmf-dist/source/latex/oberdiek/zref.dtx b/Master/texmf-dist/source/latex/oberdiek/zref.dtx index 9a632a0c32a..050ffd5cf0b 100644 --- a/Master/texmf-dist/source/latex/oberdiek/zref.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/zref.dtx @@ -27,7 +27,8 @@ % zref-totpages.sty, zref-user.sty, zref-xr.sty, % zref-example.tex, zref-example-lastpage.tex, % zref-example-nextpage.tex, zref-test1.tex, -% zref-test-runs.tex, zref-test-titleref-memoir.tex. +% zref-test-base.tex, zref-test-runs.tex, +% zref-test-titleref-memoir.tex. % % Distribution: % CTAN:macros/latex/contrib/oberdiek/zref.dtx @@ -82,6 +83,7 @@ % TDS:doc/latex/oberdiek/zref-example-lastpage.tex % TDS:doc/latex/oberdiek/zref-example-nextpage.tex % TDS:doc/latex/oberdiek/test/zref-test1.tex +% TDS:doc/latex/oberdiek/test/zref-test-base.tex % TDS:doc/latex/oberdiek/test/zref-test-runs.tex % TDS:doc/latex/oberdiek/test/zref-test-titleref-memoir.tex % TDS:source/latex/oberdiek/zref.dtx @@ -101,7 +103,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: zref 2010/04/17 v2.12 New reference scheme for LaTeX2e (HO)} +\Msg{* Package: zref 2010/04/22 v2.14 New reference scheme for LaTeX2e (HO)} \Msg{************************************************************************} \keepsilent @@ -139,7 +141,8 @@ and the derived files zref-totpages.sty, zref-user.sty, zref-xr.sty, zref-example.tex, zref-example-lastpage.tex, zref-example-nextpage.tex, zref-test1.tex, - zref-test-runs.tex, zref-test-titleref-memoir.tex. + zref-test-base.tex, zref-test-runs.tex, + zref-test-titleref-memoir.tex. \endpreamble \let\MetaPrefix\DoubleperCent @@ -171,6 +174,7 @@ and the derived files \file{zref-example-nextpage.tex}{\from{zref.dtx}{example-nextpage}}% \usedir{doc/latex/oberdiek/test}% \file{zref-test1.tex}{\from{zref.dtx}{test1}}% + \file{zref-test-base.tex}{\from{zref.dtx}{test-base}}% \file{zref-test-runs.tex}{\from{zref.dtx}{test-runs}}% \file{zref-test-titleref-memoir.tex}{\from{zref.dtx}{test-titleref-memoir}}% } @@ -208,7 +212,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{zref.drv}% - [2010/04/17 v2.12 New reference scheme for LaTeX2e (HO)]% + [2010/04/22 v2.14 New reference scheme for LaTeX2e (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2008/08/11] \begin{document} @@ -217,7 +221,7 @@ and the derived files % % \fi % -% \CheckSum{2292} +% \CheckSum{2351} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -238,7 +242,7 @@ and the derived files % \GetFileInfo{zref.drv} % % \title{The \xpackage{zref} package} -% \date{2010/04/17 v2.12} +% \date{2010/04/22 v2.14} % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}} % % \maketitle @@ -261,6 +265,10 @@ and the derived files % \textsuperscript{exp}^^A % \space % } +% \newcommand{\markexptwo}{^^A +% \textsuperscript{exp2}^^A +% \space +% } % \newcommand{\markrobust}{^^A % \textsuperscript{robust}^^A % \space @@ -416,7 +424,9 @@ and the derived files % \subsection{Property list} % % \markexp means that the implementation of the -% marked macro is expandable. +% marked macro is expandable. \markexptwo goes a step further +% and marks the macro expandable in exact two expansion steps +% except inside \cs{zref@wrapper@unexpanded}. % % \begin{declcs}{zref@newlist} % \M{listname} @@ -424,13 +434,17 @@ and the derived files % Declares a new empty property list. % % \begin{declcs}{zref@addprop} -% \M{listname} \M{propname} +% \M{listname} \M{propname list} % \end{declcs} -% Adds the property \meta{propname} to the property list \meta{listname}. +% Adds the properties of \meta{propname list} (comma separated) +% to the property list \meta{listname}. % The property and list must exist. +% A \meta{propname list} can be given since 2010/04/19 v2.13. +% Before this version only one property name could be added in one call +% of \cs{zref@addprop}. % % \begin{declcs}{zref@localaddprop} -% \M{listname} \M{propname} +% \M{listname} \M{propname list} % \end{declcs} % Local variant of \cs{zref@addprop}. % @@ -477,13 +491,18 @@ and the derived files % This sets the current value of the property \meta{propname}. % It is a generalization of setting \LaTeX's \cs{currentlabel}. % -% \begin{declcs}{zref@getcurrent} -% \M{propname} \M{value} +% \begin{declcs}{zref@getcurrent}\markexptwo +% \M{propname} % \end{declcs} % This returns the current value of the property \meta{propname}. % The value may not be correct, especially if the property % is bound to a page (start form of \cs{zref@newprop}) and the % right value is only known at shipout time (e.g. property `page'). +% In case of errors (e.g. unknown property) the empty string is +% returned. +% +% Since version 2010/04/22 v2.14 \cs{zref@getcurrent} supports +% \cs{zref@wrapper@unexpanded}. % % \begin{declcs}{zref@propexists} % \M{propname} \M{then} @@ -528,7 +547,7 @@ and the derived files % % \subsection{Data extraction} % -% \begin{declcs}{zref@extractdefault}\markexp +% \begin{declcs}{zref@extractdefault}\markexptwo % \M{refname} \M{propname} \M{default} % \end{declcs} % This is the basic command that refernces the value of a @@ -536,7 +555,7 @@ and the derived files % In case of errors such as undefined reference the \meta{default} % is used instead. % -% \begin{declcs}{zref@extract}\markexp +% \begin{declcs}{zref@extract}\markexptwo % \M{refname} \M{propname} % \end{declcs} % The command is an abbreviation for \cs{zref@extractdefault}. @@ -671,8 +690,8 @@ and the derived files % This (theoretical?) problem can be solved by this wrapper: % \begin{quote} %\begin{verbatim} -%\edef\foo{% -% \zref@wrapper@unexpanded{% +%\zref@wrapper@unexpanded{% +% \edef\foo{% % \zref@extract{someref}{bar}% % }% %} @@ -681,7 +700,8 @@ and the derived files % The \cs{edef} forces the expansion of \cs{zref@extract}, % but the extraction of the value is prevented by % the wrapper that uses \eTeX'\ \cs{unexpanded} for this -% purpose. +% purpose. Supported macros are \cs{zref@extract}, \cs{zref@extractdefault} +% and since version 2010/04/22 v2.14 macro \cs{zref@getcurrent}. % % \subsection{Counter for unique names} % @@ -718,7 +738,9 @@ and the derived files % \markexp\unskip & Expandable version:\\ % & \textbullet\ robust, % unless the extracted values are fragile,\\ -% & \textbullet\ no babel shorthand suport. +% & \textbullet\ no babel shorthand suport.\\ +% \markexptwo\unskip & Expandable like \markexp and:\\ +% & \textbullet\ expandable in exact two steps.\\ % \end{tabular} % \end{quote} % @@ -834,15 +856,13 @@ and the derived files \newcounter{foo} \renewcommand*{\thefoo}{\Alph{foo}} -\usepackage{zref-lastpage,zref-user}[2010/04/17] +\usepackage{zref-lastpage,zref-user}[2010/04/22] \makeatletter \zref@newprop{thefoo}{\thefoo} \zref@newprop{valuefoo}{\the\value{foo}} \zref@newprop{chapter}{\thechapter} -\zref@addprop{LastPage}{thefoo} -\zref@addprop{LastPage}{valuefoo} -\zref@addprop{LastPage}{chapter} +\zref@addprop{LastPage}{thefoo,valuefoo,chapter} \makeatother \newcommand*{\foo}{% @@ -950,7 +970,7 @@ and the derived files %< \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref} - [2010/04/17 v2.12 New reference scheme for LaTeX2e (HO)]% + [2010/04/22 v2.14 New reference scheme for LaTeX2e (HO)]% % \end{macrocode} % % \subsubsection{Load basic module} % % \begin{macrocode} -\RequirePackage{zref-base}[2010/04/17] +\RequirePackage{zref-base}[2010/04/22] % \end{macrocode} % Abort package loading if \xpackage{zref-base} could not be % loaded successfully. @@ -1458,7 +1478,7 @@ the height difference of the two baselines is \def\ZREF@temp#1{% \DeclareOption{#1}{% \AtEndOfPackage{% - \RequirePackage{zref-#1}[2010/04/17]% + \RequirePackage{zref-#1}[2010/04/22]% }% }% } @@ -1518,13 +1538,14 @@ the height difference of the two baselines is %<*base> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-base}% - [2010/04/17 v2.12 Module base for zref (HO)]% + [2010/04/22 v2.14 Module base for zref (HO)]% % \end{macrocode} % % \subsubsection{Utilities} % % \begin{macrocode} \RequirePackage{ltxcmds}[2010/03/01] +\RequirePackage{kvsetkeys}[2010/03/01] % \end{macrocode} % % \begin{macro}{\ZREF@name} @@ -1555,14 +1576,13 @@ the height difference of the two baselines is % the command and safes it. % \begin{macrocode} \def\ZREF@patch#1{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname #1\endcsname\relax - \expandafter\ltx@gobble - \else + \ltx@IfUndefined{#1}{% + \ltx@gobble + }{% \expandafter\let\csname ZREF@org@#1\expandafter\endcsname \csname #1\endcsname - \expandafter\ltx@firstofone - \fi + \ltx@firstofone + }% } % \end{macrocode} % \end{macro} @@ -1657,11 +1677,7 @@ the height difference of the two baselines is % then \verb|#2| is executed and \verb|#3| otherwise. % \begin{macrocode} \def\zref@iflistundefined#1{% - \expandafter\ifx\csname Z@L@#1\endcsname\relax - \expandafter\ltx@firstoftwo - \else - \expandafter\ltx@secondoftwo - \fi + \ltx@ifundefined{Z@L@#1}% } % \end{macrocode} % \end{macro} @@ -1685,7 +1701,11 @@ the height difference of the two baselines is % already present in a property list \verb|#1|. % \begin{macrocode} \def\zref@iflistcontainsprop#1{% - \expandafter\ZREF@iflistcontainsprop\csname Z@L@#1\endcsname + \zref@iflistundefined{#1}{% + \expandafter\ltx@secondoftwo\@gobble + }{% + \expandafter\ZREF@iflistcontainsprop\csname Z@L@#1\endcsname + }% } \def\ZREF@iflistcontainsprop#1#2{% \begingroup @@ -1730,16 +1750,19 @@ the height difference of the two baselines is % \begin{macrocode} \def\zref@addprop#1#2{% \zref@listexists{#1}{% - \zref@propexists{#2}{% - \zref@iflistcontainsprop{#1}{#2}{% - \PackageWarning\ZREF@name{% - Property `#2' is already in list `#1'% + \comma@parse{#2}{% + \zref@propexists\comma@entry{% + \zref@iflistcontainsprop{#1}\comma@entry{% + \PackageWarning\ZREF@name{% + Property `\comma@entry' is already in list `#1'% + }% + }{% + \edef\comma@entry{\comma@entry}% + \expandafter\g@addto@macro\csname Z@L@#1\expandafter\endcsname + \expandafter{\expandafter{\comma@entry}}% }% - }{% - \edef\ZREF@temp{#2}% - \expandafter\g@addto@macro\csname Z@L@#1\expandafter\endcsname - \expandafter{\expandafter{\ZREF@temp}}% }% + \ltx@gobble }% }% } @@ -1750,36 +1773,25 @@ the height difference of the two baselines is % \begin{macrocode} \def\zref@localaddprop#1#2{% \zref@listexists{#1}{% - \zref@propexists{#2}{% - \zref@iflistcontainsprop{#1}{#2}{% - \PackageWarning\ZREF@name{% - Property `#2' is already in list `#1'% + \comma@parse{#2}{% + \zref@propexists\comma@entry{% + \zref@iflistcontainsprop{#1}\comma@entry{% + \PackageWarning\ZREF@name{% + Property `\comma@entry' is already in list `#1'% + }% + }{% + \edef\comma@entry{\comma@entry}% + \expandafter\ltx@LocalAppendToMacro + \csname Z@L@#1\expandafter\endcsname + \expandafter{\expandafter{\comma@entry}}% }% - }{% - \expandafter\ZREF@l@addto@macro\csname Z@L@#1\endcsname{{#2}}% }% + \ltx@gobble }% }% } % \end{macrocode} % \end{macro} -% \begin{macro}{\ZREF@l@addto@macro} -% \begin{macrocode} -\ifetex@unexpanded - \def\ZREF@l@addto@macro#1#2{% - \global\let\ZREF@gtemp#1% - \g@addto@macro\ZREF@gtemp{#2}% - \let#1\ZREF@gtemp - }% -\else - \def\ZREF@l@addto@macro#1#2{% - \edef#1{% - \etex@unexpanded\expandafter{#1#2}% - }% - }% -\fi -% \end{macrocode} -% \end{macro} % % \subsubsection{Properties} % @@ -1789,11 +1801,7 @@ the height difference of the two baselines is % then \verb|#2| is executed and \verb|#3| otherwise. % \begin{macrocode} \def\zref@ifpropundefined#1{% - \expandafter\ifx\csname Z@E@#1\endcsname\relax - \expandafter\ltx@firstoftwo - \else - \expandafter\ltx@secondoftwo - \fi + \ltx@ifundefined{Z@E@#1}% } % \end{macrocode} % \end{macro} @@ -1862,8 +1870,10 @@ the height difference of the two baselines is % \begin{macro}{\zref@setcurrent} % \cs{zref@setcurrent} sets the current value for a property. % \begin{macrocode} -\def\zref@setcurrent#1{% - \expandafter\def\csname Z@C@#1\endcsname +\def\zref@setcurrent#1#2{% + \zref@propexists{#1}{% + \expandafter\def\csname Z@C@#1\endcsname{#2}% + }% } % \end{macrocode} % \end{macro} @@ -1872,7 +1882,34 @@ the height difference of the two baselines is % \cs{zref@getcurrent} gets the current value for a property. % \begin{macrocode} \def\zref@getcurrent#1{% - \csname Z@C@#1\endcsname + \romannumeral0% + \ltx@ifundefined{Z@C@#1}{% + \ltx@space + }{% + \expandafter\expandafter\expandafter + \ZREF@@unexpanded\expandafter\expandafter\expandafter{% + \csname Z@C@#1\endcsname + }% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ZREF@@unexpanded} +% \begin{macrocode} +\def\ZREF@@unexpanded#1{% + \ifx\ZREF@unexpanded\ltx@firstofone + \expandafter\ltx@firstoftwo + \else + \expandafter\ltx@secondoftwo + \fi + {% + \ltx@space + #1% + }{% + \ltx@space + \ZREF@unexpanded{#1}% + }% } % \end{macrocode} % \end{macro} @@ -2023,11 +2060,7 @@ the height difference of the two baselines is % \cs{zref@ifrefundefined} calls \verb|#2| and \verb|#3| otherwise. % \begin{macrocode} \def\zref@ifrefundefined#1{% - \expandafter\ifx\csname Z@R@#1\endcsname\relax - \expandafter\ltx@firstoftwo - \else - \expandafter\ltx@secondoftwo - \fi + \ltx@ifundefined{Z@R@#1}% } % \end{macrocode} % \end{macro} @@ -2081,12 +2114,18 @@ the height difference of the two baselines is % value. % \begin{macrocode} \def\zref@extract#1#2{% - \expandafter\expandafter\expandafter\ZREF@extract - \expandafter\expandafter\expandafter{% - \csname Z@D@#2\endcsname - }{#1}{#2}% + \romannumeral0% + \ltx@ifundefined{Z@D@#2}{% + \expandafter\ltx@space\zref@default + }{% + \expandafter\expandafter\expandafter\ZREF@extract + \expandafter\expandafter\expandafter{% + \csname Z@D@#2\endcsname + }{#1}{#2}% + }% } \def\ZREF@extract#1#2#3{% + \expandafter\expandafter\expandafter\ltx@space \zref@extractdefault{#2}{#3}{#1}% } % \end{macrocode} @@ -2127,11 +2166,14 @@ the height difference of the two baselines is % the default value in \verb|#3| in case for problems. % \begin{macrocode} \def\zref@extractdefault#1#2#3{% - \zref@ifrefundefined{#1}{% - \ZREF@unexpanded{#3}% + \romannumeral0% + \zref@ifrefundefined{#1}\ltx@firstoftwo{% + \zref@ifpropundefined{#2}\ltx@firstoftwo\ltx@secondoftwo }{% - \expandafter\expandafter\expandafter\ZREF@unexpanded - \expandafter\expandafter\expandafter{% + \ZREF@@unexpanded{#3}% + }{% + \expandafter\expandafter\expandafter + \ZREF@@unexpanded\expandafter\expandafter\expandafter{% \csname Z@E@#2\expandafter\expandafter\expandafter\endcsname \csname Z@R@#1\expandafter\endcsname \csname#2\endcsname{#3}\ZREF@nil @@ -2281,8 +2323,7 @@ the height difference of the two baselines is % \begin{macrocode} \zref@newprop{default}{\@currentlabel} \zref@newprop*{page}{\thepage} -\zref@addprop\ZREF@mainlist{default} -\zref@addprop\ZREF@mainlist{page} +\zref@addprop\ZREF@mainlist{default,page} % \end{macrocode} % % \paragraph{Mark successful loading} @@ -2299,8 +2340,8 @@ the height difference of the two baselines is %<*user> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-user}% - [2010/04/17 v2.12 Module user for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module user for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -2374,8 +2415,8 @@ the height difference of the two baselines is %<*abspage> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-abspage}% - [2010/04/17 v2.12 Module abspage for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module abspage for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -2419,8 +2460,8 @@ the height difference of the two baselines is %<*counter> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-counter}% - [2010/04/17 v2.12 Module counter for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module counter for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -2456,9 +2497,9 @@ the height difference of the two baselines is %<*lastpage> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-lastpage}% - [2010/04/17 v2.12 Module lastpage for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] -\RequirePackage{zref-abspage}[2010/04/17] + [2010/04/22 v2.14 Module lastpage for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] +\RequirePackage{zref-abspage}[2010/04/22] \RequirePackage{atveryend}[2009/12/07] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} @@ -2525,14 +2566,14 @@ the height difference of the two baselines is %<*thepage> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-thepage}% - [2010/04/17 v2.12 Module thepage for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module thepage for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % % \begin{macrocode} \RequirePackage{atbegshi} -\RequirePackage{zref-abspage}[2010/04/17] +\RequirePackage{zref-abspage}[2010/04/22] % \end{macrocode} % \begin{macrocode} \zref@newlist{thepage} @@ -2585,15 +2626,15 @@ the height difference of the two baselines is %<*nextpage> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-nextpage}% - [2010/04/17 v2.12 Module nextpage for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module nextpage for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % % \begin{macrocode} -\RequirePackage{zref-abspage}[2010/04/17] -\RequirePackage{zref-thepage}[2010/04/17] -\RequirePackage{zref-lastpage}[2010/04/17] +\RequirePackage{zref-abspage}[2010/04/22] +\RequirePackage{zref-thepage}[2010/04/22] +\RequirePackage{zref-lastpage}[2010/04/22] \RequirePackage{uniquecounter}[2009/12/18] % \end{macrocode} % \begin{macrocode} @@ -2686,16 +2727,16 @@ the height difference of the two baselines is %<*totpages> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-totpages}% - [2010/04/17 v2.12 Module totpages for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module totpages for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % % The absolute page number of the last page is the total % page number. % \begin{macrocode} -\RequirePackage{zref-abspage}[2010/04/17] -\RequirePackage{zref-lastpage}[2010/04/17] +\RequirePackage{zref-abspage}[2010/04/22] +\RequirePackage{zref-lastpage}[2010/04/22] % \end{macrocode} % % \begin{macro}{\ztotpages} @@ -2725,8 +2766,8 @@ the height difference of the two baselines is %<*marks> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-marks}% - [2010/04/17 v2.12 Module marks for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module marks for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -2829,7 +2870,7 @@ the height difference of the two baselines is %<*runs> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-runs}% - [2010/04/17 v2.12 Module runs for zref (HO)]% + [2010/04/22 v2.14 Module runs for zref (HO)]% % \end{macrocode} % % \begin{macro}{\zruns} @@ -2861,8 +2902,8 @@ the height difference of the two baselines is %<*perpage> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-perpage}% - [2010/04/17 v2.12 Module perpage for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module perpage for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -2874,7 +2915,7 @@ the height difference of the two baselines is % For detecting changed pages module \xmodule{abspage} % is loaded. % \begin{macrocode} -\RequirePackage{zref-abspage}[2010/04/17] +\RequirePackage{zref-abspage}[2010/04/22] % \end{macrocode} % % We group the properties for the needed references @@ -2883,9 +2924,7 @@ the height difference of the two baselines is % \begin{macrocode} \zref@newprop*{pagevalue}[0]{\number\c@page} \zref@newlist{perpage} -\zref@addprop{perpage}{abspage} -\zref@addprop{perpage}{page} -\zref@addprop{perpage}{pagevalue} +\zref@addprop{perpage}{abspage,page,pagevalue} % \end{macrocode} % The page value, known by the reference mechanism, will be % stored in counter |zpage|. @@ -3018,8 +3057,8 @@ the height difference of the two baselines is %<*titleref> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-titleref}% - [2010/04/17 v2.12 Module titleref for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module titleref for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} \RequirePackage{gettitlestring}[2009/12/08] % \end{macrocode} @@ -3414,8 +3453,8 @@ the height difference of the two baselines is %<*xr> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-xr}% - [2010/04/17 v2.12 Module xr for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module xr for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % \begin{macrocode} @@ -3723,28 +3762,30 @@ the height difference of the two baselines is Import to LaTeX label `#2'% }% \fi - \expandafter\xdef\csname r@#2\endcsname{% - {% - \ltx@ifundefined{M@TitleReference}{% - \ltx@ifundefined{TR@TitleReference}{% - \zref@extractdefault{#1}{default}{}% + \zref@wrapper@unexpanded{% + \expandafter\xdef\csname r@#2\endcsname{% + {% + \ltx@ifundefined{M@TitleReference}{% + \ltx@ifundefined{TR@TitleReference}{% + \zref@extractdefault{#1}{default}{}% + }{% + \noexpand\TR@TitleReference + {\zref@extractdefault{#1}{default}{}}% + {\zref@extractdefault{#1}{title}{}}% + }% }{% - \noexpand\TR@TitleReference + \noexpand\M@TitleReference {\zref@extractdefault{#1}{default}{}}% {\zref@extractdefault{#1}{title}{}}% }% - }{% - \noexpand\M@TitleReference - {\zref@extractdefault{#1}{default}{}}% - {\zref@extractdefault{#1}{title}{}}% }% + {\zref@extractdefault{#1}{page}{}}% + \ltx@ifpackageloaded{nameref}{% + {\zref@extractdefault{#1}{title}{}}% + {\zref@extractdefault{#1}{anchor}{}}% + {\zref@extractdefault{#1}{url}{}}% + }{}% }% - {\zref@extractdefault{#1}{page}{}}% - \ltx@ifpackageloaded{nameref}{% - {\zref@extractdefault{#1}{title}{}}% - {\zref@extractdefault{#1}{anchor}{}}% - {\zref@extractdefault{#1}{url}{}}% - }{}% }% } % \end{macrocode} @@ -3882,8 +3923,8 @@ the height difference of the two baselines is %<*hyperref> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-hyperref}% - [2010/04/17 v2.12 Module hyperref for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module hyperref for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -3911,8 +3952,8 @@ the height difference of the two baselines is %<*savepos> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-savepos}% - [2010/04/17 v2.12 Module savepos for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module savepos for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % @@ -3936,17 +3977,17 @@ the height difference of the two baselines is \RequirePackage{ifpdf} \ifpdf \else - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdftexversion\endcsname\relax - \else + \ltx@IfUndefined{pdftexversion}{% + }{% \ifnum\pdftexversion<140 % \PackageError\ZREF@name{% - \string\pdfsavepos\space is not supported in DVI mode\MessageBreak + \string\pdfsavepos\space is not supported in DVI mode% + \MessageBreak of this pdfTeX version% }\ZREF@UpdatePdfTeX \expandafter\expandafter\expandafter\endinput \fi - \fi + }% \fi % \end{macrocode} % @@ -3956,8 +3997,7 @@ the height difference of the two baselines is \zref@newlist{savepos} \zref@newprop*{posx}[0]{\the\pdflastxpos} \zref@newprop*{posy}[0]{\the\pdflastypos} -\zref@addprop{savepos}{posx} -\zref@addprop{savepos}{posy} +\zref@addprop{savepos}{posx,posy} % \end{macrocode} % % \subsubsection{User macros} @@ -4014,15 +4054,15 @@ the height difference of the two baselines is %<*dotfill> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{zref-dotfill}% - [2010/04/17 v2.12 Module dotfill for zref (HO)]% -\RequirePackage{zref-base}[2010/04/17] + [2010/04/22 v2.14 Module dotfill for zref (HO)]% +\RequirePackage{zref-base}[2010/04/22] \@ifundefined{ZREF@baseok}{\endinput}{} % \end{macrocode} % % For measuring the width of \cs{zdotfill} we use the features % provided by module \xmodule{savepos}. % \begin{macrocode} -\RequirePackage{zref-savepos}[2010/04/17] +\RequirePackage{zref-savepos}[2010/04/22] % \end{macrocode} % For automatically generated label names we use the unique % counter of module \xmodule{base}. @@ -4111,7 +4151,7 @@ the height difference of the two baselines is \NeedsTeXFormat{LaTeX2e} \nofiles \documentclass{article} -\usepackage{zref-base}[2010/04/17] +\usepackage{zref-base}[2010/04/22] \usepackage{qstest} \IncludeTests{*} \LogTests{log}{*}{*} @@ -4135,13 +4175,69 @@ the height difference of the two baselines is % % \end{macrocode} % +% \subsection{Module \xmodule{base}} +% +% \begin{macrocode} +%<*test-base> +\NeedsTeXFormat{LaTeX2e} +\documentclass{article} +\usepackage{zref-base,zref-titleref}[2010/04/22] +\usepackage{qstest} +\IncludeTests{*} +\LogTests{log}{*}{*} + +\makeatletter +\newcommand*{\DefExpand}[2]{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#1% + \expandafter\expandafter\expandafter{#2}% + \@onelevel@sanitize#1% +} +\newcommand*{\Test}[3]{% + \Expect{#2}*{#1}% + \zref@wrapper@unexpanded{% + \Expect*{#3}*{#1}% + }% + \DefExpand\x{#1}% + \Expect*{#3}*{\x}% +} +\makeatother + +\begin{document} +\section{Hello \textbf{World}} +\label{sec:hello} +\makeatletter +\zref@newprop{foo}[D\@empty efault]{V\@empty alue} +\begin{qstest}{getcurrent}{getcurrent} + \Test{\zref@getcurrent{foo}}{Value}{V\noexpand\@empty alue}% + \Test{\zref@getcurrent{xy}}{}{}% +\end{qstest} +\begin{qstest}{extract}{extract} + \def\textbf#1{<#1>}% + \Test{\zref@extractdefault{xy}{page}{D\@empty efault}}% + {Default}{D\noexpand\@empty efault}% + \Test{\zref@extractdefault{sec:hello}{foo}{A\@empty B}}% + {AB}{A\noexpand\@empty B}% + \Test{\zref@extract{sec:hello}{foo}}% + {Default}{D\noexpand\@empty efault}% + \zref@ifrefundefined{sec:hello}{% + }{% + \Test{\zref@extract{sec:hello}{default}}{1}{1}% + \Test{\zref@extract{sec:hello}{title}}% + {Hello }{Hello \noexpand\textbf{World}}% + }% +\end{qstest} +\end{document} +% +% \end{macrocode} +% % \subsection{Module \xmodule{runs}} % % \begin{macrocode} %<*test-runs> \NeedsTeXFormat{LaTeX2e} \documentclass{article} -\usepackage{zref-runs}[2010/04/17] +\usepackage{zref-runs}[2010/04/22] \usepackage{qstest} \IncludeTests{*} \LogTests{log}{*}{*} @@ -4170,7 +4266,7 @@ the height difference of the two baselines is %<*test-titleref-memoir> \NeedsTeXFormat{LaTeX2e} \documentclass{memoir} -\usepackage{zref-titleref}[2010/04/17] +\usepackage{zref-titleref}[2010/04/22] \usepackage{qstest} \IncludeTests{*} \LogTests{log}{*}{*} @@ -4308,6 +4404,7 @@ the height difference of the two baselines is % zref-example-lastpage.tex & doc/latex/oberdiek/zref-example-lastpage.tex\\ % zref-example-nextpage.tex & doc/latex/oberdiek/zref-example-nextpage.tex\\ % test/zref-test1.tex & doc/latex/oberdiek/test/zref-test1.tex\\ +% test/zref-test-base.tex & doc/latex/oberdiek/test/zref-test-base.tex\\ % test/zref-test-runs.tex & doc/latex/oberdiek/test/zref-test-runs.tex\\ % test/zref-test-titleref-memoir.tex & doc/latex/oberdiek/test/zref-test-titleref-memoir.tex\\ % zref.dtx & source/latex/oberdiek/zref.dtx\\ @@ -4596,6 +4693,32 @@ the height difference of the two baselines is % Module \xmodule{xr}: Setup options \xoption{tozreflabel} % and \xoption{toltxlabel} added. % \end{Version} +% \begin{Version}{2010/04/19 v2.13} +% \item +% \cs{zref@setcurrent} throws an error if the property +% does not exist (Florent Chervet). +% \item +% \cs{zref@getcurrent} the documentation is fixed (Florent Chervet). +% Also it returns the empty string in case of errors. +% \item +% \cs{zref@addprop} and \cs{zref@localaddprop} now take a list of +% property names (feature request of Florent Chervet). +% \item +% Example for \cs{zref@wrapper@unexpanded} corrected (Florent Chervet). +% \end{Version} +% \begin{Version}{2010/04/22 v2.14} +% \item +% Bug fix for \cs{zref@getcurrent} second argument wasn't eaten in +% case of unknown property. +% \item +% \cs{zref@getcurrent} supports \cs{zref@wrapper@unexpanded}. +% \item +% \cs{zref@wrapper@unexpanded} added for \cs{ZREF@xr@tolabel}. +% \item +% \cs{zref@extract}, \cs{zref@extractdefault}, \cs{zref@getcurrent} +% are expandable in exact two steps +% except inside \cs{zref@wrapper@unexpanded}. +% \end{Version} % \end{History} % % \PrintIndex -- cgit v1.2.3