diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-23 00:33:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-23 00:33:14 +0000 |
commit | c0e1259ef738f3dc6e27246d797cf81a05836f97 (patch) | |
tree | 0b8a4267bd51f86fbf251d565d110e018e00dea6 /Master/texmf-dist/tex/latex/oberdiek/zref-base.sty | |
parent | 7ec0cd0175d99a635a9298554e4fb6f0e56599d1 (diff) |
oberdiek update (22apr10)
git-svn-id: svn://tug.org/texlive/trunk@17966 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/zref-base.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/zref-base.sty | 149 |
1 files changed, 85 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/zref-base.sty b/Master/texmf-dist/tex/latex/oberdiek/zref-base.sty index 6ff9ea65221..ba6218b938f 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/zref-base.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/zref-base.sty @@ -35,24 +35,25 @@ %% 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. %% \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)]% \RequirePackage{ltxcmds}[2010/03/01] +\RequirePackage{kvsetkeys}[2010/03/01] \def\ZREF@name{zref} \def\ZREF@UpdatePdfTeX{Update pdfTeX.} \newif\ifZREF@found \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 + }% } \ltx@IfUndefined{eTeXversion}{% \PackageError\ZREF@name{% @@ -96,11 +97,7 @@ }% } \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}% } \def\zref@listexists#1{% \zref@iflistundefined{#1}{% @@ -110,7 +107,11 @@ }% } \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 @@ -142,51 +143,43 @@ } \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 }% }% } \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 }% }% } -\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 \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}% } \def\zref@propexists#1{% \zref@ifpropundefined{#1}{% @@ -219,11 +212,35 @@ \def\ZREF@@@newprop#1{% \expandafter\gdef\csname Z@E@\ZREF@P\endcsname##1#1##2##3\ZREF@nil{##2}% } -\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}% + }% } \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 + }% + }% +} +\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}% + }% } \def\zref@label#1{% \zref@labelbylist{#1}\ZREF@mainlist @@ -304,11 +321,7 @@ }% } \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}% } \newcommand*{\zifrefundefined}[1]{% \zref@wrapper@babel\ZREF@ifrefundefined{#1}% @@ -329,12 +342,18 @@ }{}% } \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}% } \def\zref@ifrefcontainsprop#1#2{% @@ -359,11 +378,14 @@ } \def\ZREF@novalue{\ZREF@NOVALUE} \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 @@ -431,8 +453,7 @@ \zref@newlist\ZREF@mainlist \zref@newprop{default}{\@currentlabel} \zref@newprop*{page}{\thepage} -\zref@addprop\ZREF@mainlist{default} -\zref@addprop\ZREF@mainlist{page} +\zref@addprop\ZREF@mainlist{default,page} \let\ZREF@baseok\@empty \endinput %% |