diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/refcount.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/refcount.sty | 367 |
1 files changed, 303 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/refcount.sty b/Master/texmf-dist/tex/latex/oberdiek/refcount.sty index d9c147d3a72..4992b01821a 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/refcount.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/refcount.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 1998, 2000, 2006, 2008 by +%% Copyright (C) 1998, 2000, 2006, 2008, 2010 by %% Heiko Oberdiek <heiko.oberdiek at googlemail.com> %% %% This work may be distributed and/or modified under the @@ -27,35 +27,226 @@ %% %% This work consists of the main source file refcount.dtx %% and the derived files -%% refcount.sty, refcount.pdf, refcount.ins, refcount.drv. +%% refcount.sty, refcount.pdf, refcount.ins, refcount.drv, +%% refcount-test1.tex, refcount-test2.tex, refcount-test3.tex, +%% refcount-test4.tex. %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{refcount} - [2008/08/11 v3.1 Data extraction from references (HO)]% - -\def\setrefcountdefault#1{% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \catcode64=11 % @ + \catcode123=1 % { + \catcode125=2 % } + \expandafter\let\expandafter\x\csname ver@refcount.sty\endcsname + \ifx\x\relax % plain-TeX, first loading + \else + \def\empty{}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \else + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{refcount}{The package is already loaded}% + \aftergroup\endinput + \fi + \fi +\endgroup% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode40=12 % ( + \catcode41=12 % ) + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode47=12 % / + \catcode58=12 % : + \catcode64=11 % @ + \catcode91=12 % [ + \catcode93=12 % ] + \catcode123=1 % { + \catcode125=2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@refcount.sty\endcsname +\ProvidesPackage{refcount}% + [2010/12/01 v3.2 Data extraction from references (HO)]% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \def\x{\endgroup + \expandafter\edef\csname rc@AtEnd\endcsname{% + \endlinechar=\the\endlinechar\relax + \catcode13=\the\catcode13\relax + \catcode32=\the\catcode32\relax + \catcode35=\the\catcode35\relax + \catcode61=\the\catcode61\relax + \catcode64=\the\catcode64\relax + \catcode123=\the\catcode123\relax + \catcode125=\the\catcode125\relax + }% + }% +\x\catcode61\catcode48\catcode32=10\relax% +\catcode13=5 % ^^M +\endlinechar=13 % +\catcode35=6 % # +\catcode64=11 % @ +\catcode123=1 % { +\catcode125=2 % } +\def\TMP@EnsureCode#1#2{% + \edef\rc@AtEnd{% + \rc@AtEnd + \catcode#1=\the\catcode#1\relax + }% + \catcode#1=#2\relax +} +\TMP@EnsureCode{33}{12}% ! +\TMP@EnsureCode{39}{12}% ' +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] +\TMP@EnsureCode{96}{12}% ` +\edef\rc@AtEnd{\rc@AtEnd\noexpand\endinput} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input ltxcmds.sty\relax + \input infwarerr.sty\relax +\else + \RequirePackage{ltxcmds}[2010/04/08]% + \RequirePackage{infwarerr}[2010/04/08]% +\fi +\ltx@IfUndefined{@ifdefinable}{% + \def\rc@IfDefinable#1{% + \ifx#1\ltx@undefined + \expandafter\ltx@firstofone + \else + \ifx#1\relax + \expandafter\expandafter\expandafter\ltx@firstofone + \else + \@PackageError{refcount}{% + Command \string#1 is already defined.\MessageBreak + It will not redefined by this package% + }\@ehc + \expandafter\expandafter\expandafter\ltx@gobble + \fi + \fi + }% +}{% + \let\rc@IfDefinable\@ifdefinable +} +\ltx@IfUndefined{protected}{% + \ltx@IfUndefined{DeclareRobustCommand}{% + \def\rc@RobustDefOne#1#2#3#4{% + \rc@IfDefinable#3{% + #1\def#3##1{#4}% + }% + }% + }{% + \def\rc@RobustDefOne#1#2#3#4{% + \rc@IfDefinable#3{% + \DeclareRobustCommand#2#3[1]{#4}% + }% + }% + }% +}{% + \def\rc@RobustDefOne#1#2#3#4{% + \rc@IfDefinable#3{% + \protected#1\def#3##1{#4}% + }% + }% +} +\ltx@IfUndefined{newcommand}{% + \def\rc@newcommand*#1[#2]#3{% hash-ok + \rc@IfDefinable#1{% + \ifcase#2 % + \def#1{#3}% + \or + \def#1##1{#3}% + \or + \def#1##1##2{#3}% + \else + \rc@InternalError + \fi + }% + }% +}{% + \let\rc@newcommand\newcommand +} +\rc@RobustDefOne\long{}\setrefcountdefault{% \def\rc@default{#1}% } \setrefcountdefault{0} - -\def\rc@cartwo#1#2#3\@nil{#2} - -\long\def\rc@refused#1{% - \expandafter\ifx\csname r@#1\endcsname\relax - \protect\G@refundefinedtrue +\ltx@IfUndefined{G@refundefinedtrue}{% + \rc@RobustDefOne{}{*}\refused{% + \begingroup + \csname @safe@activestrue\endcsname + \ltx@IfUndefined{r@#1}{% + \protect\G@refundefinedtrue + \rc@WarningUndefined{#1}% + }{}% + \endgroup + }% +}{% + \rc@RobustDefOne{}{*}\refused{% + \begingroup + \csname @safe@activestrue\endcsname + \ltx@IfUndefined{r@#1}{% + \csname protect\expandafter\endcsname + \csname G@refundefinedtrue\endcsname + \rc@WarningUndefined{#1}% + }{}% + \endgroup + }% +} +\ltx@IfUndefined{@latex@warning}{% + \def\rc@WarningUndefined#1{% + \ltx@ifundefined{thepage}{% + \def\thepage{\number\count0 }% + }{}% + \@PackageWarning{refcount}{% + Reference `#1' on page \thepage\space undefined% + }% + }% +}{% + \def\rc@WarningUndefined#1{% \@latex@warning{% Reference `#1' on page \thepage\space undefined% }% - \fi -} - -\newcommand*{\refused}[1]{% - \begingroup - \csname @safe@activestrue\endcsname - \rc@refused{#1}{}% - \endgroup + }% } - \def\rc@set#1#2#3#4{% \begingroup \csname @safe@activestrue\endcsname @@ -72,70 +263,118 @@ }% \fi } - - -\newcommand*{\setcounterref}{\rc@set\setcounter\@car} -\newcommand*{\addtocounterref}{\rc@set\addtocounter\@car} -\newcommand*{\setcounterpageref}{\rc@set\setcounter\rc@cartwo} -\newcommand*{\addtocounterpageref}{\rc@set\addtocounter\rc@cartwo} - -\newcommand*{\getrefnumber}[1]{% - \expandafter\ifx\csname r@#1\endcsname\relax +\rc@newcommand*{\setcounterref}[0]{% + \rc@set\setcounter\ltx@car +} +\rc@newcommand*{\addtocounterref}[0]{% + \rc@set\addtocounter\ltx@car +} +\rc@newcommand*{\setcounterpageref}[0]{% + \rc@set\setcounter\ltx@cartwo +} +\rc@newcommand*{\addtocounterpageref}[0]{% + \rc@set\addtocounter\ltx@cartwo +} +\rc@newcommand*{\getrefnumber}[1]{% + \romannumeral + \ltx@ifundefined{r@#1}{% + \expandafter\ltx@zero \rc@default - \else - \expandafter\expandafter\expandafter\@car - \csname r@#1\endcsname\@nil - \fi + }{% + \expandafter\expandafter\expandafter\rc@extract@ + \expandafter\expandafter\expandafter!% + \csname r@#1\expandafter\endcsname + \expandafter{\rc@default}\@nil + }% } -\newcommand*{\getpagerefnumber}[1]{% - \expandafter\ifx\csname r@#1\endcsname\relax +\rc@newcommand*{\getpagerefnumber}[1]{% + \romannumeral + \ltx@ifundefined{r@#1}{% + \expandafter\ltx@zero \rc@default - \else - \expandafter\expandafter\expandafter\rc@cartwo - \csname r@#1\endcsname\rc@default\rc@default\@nil - \fi + }{% + \expandafter\expandafter\expandafter\rc@extract@page + \expandafter\expandafter\expandafter!% + \csname r@#1\expandafter\expandafter\expandafter\endcsname + \expandafter\expandafter\expandafter{% + \expandafter\rc@default + \expandafter}\expandafter{\rc@default}\@nil + }% } -\newcommand*{\getrefbykeydefault}[2]{% +\rc@newcommand*{\getrefbykeydefault}[2]{% + \romannumeral \expandafter\rc@getrefbykeydefault \csname r@#1\expandafter\endcsname \csname rc@extract@#2\endcsname } -\def\rc@getrefbykeydefault#1#2#3{% +\long\def\rc@getrefbykeydefault#1#2#3{% \ifx#1\relax % reference is undefined - #3% - \else - \ifx#2\relax - % extract method is missing + \ltx@ReturnAfterElseFi{% + \ltx@zero #3% - \else - \expandafter\rc@generic#1{#3}{#3}{#3}{#3}{#3}\@nil#2{#3}% - \fi + }% + \else + \ltx@ReturnAfterFi{% + \ifx#2\relax + % extract method is missing + \ltx@ReturnAfterElseFi{% + \ltx@zero + #3% + }% + \else + \ltx@ReturnAfterFi{% + \expandafter + \rc@generic#1{#3}{#3}{#3}{#3}{#3}\@nil#2{#3}% + }% + \fi + }% \fi } -\def\rc@generic#1#2\@nil#3#4{% +\long\def\rc@generic#1#2\@nil#3#4{% #3{#1\TR@TitleReference\@empty{#4}\@nil}{#1}#2\@nil } -\def\rc@extract@{% - \expandafter\@car\@gobble +\long\def\rc@extract@#1#2#3\@nil{% + \ltx@zero + #2% } -\def\rc@extract@page{% - \expandafter\@car\@gobbletwo +\long\def\rc@extract@page#1#2#3#4\@nil{% + \ltx@zero + #3% } -\def\rc@extract@name{% - \expandafter\@car\@gobblefour\@empty +\long\def\rc@extract@name#1#2#3#4#5\@nil{% + \ltx@zero + #4% } -\def\rc@extract@anchor{% - \expandafter\@car\@gobblefour +\long\def\rc@extract@anchor#1#2#3#4#5#6\@nil{% + \ltx@zero + #5% } -\def\rc@extract@url{% - \expandafter\expandafter\expandafter\@car\expandafter - \@gobble\@gobblefour +\long\def\rc@extract@url#1#2#3#4#5#6#7\@nil{% + \ltx@zero + #6% } -\def\rc@extract@title#1#2\@nil{% +\long\def\rc@extract@title#1#2\@nil{% \rc@@extract@title#1% } -\def\rc@@extract@title#1\TR@TitleReference#2#3#4\@nil{#3} +\long\def\rc@@extract@title#1\TR@TitleReference#2#3#4\@nil{% + \ltx@zero + #3% +} +\rc@newcommand*{\IfRefUndefinedExpandable}[1]{% + \ltx@ifundefined{r@#1}\ltx@firstoftwo\ltx@secondoftwo +} +\rc@RobustDefOne{}*\IfRefUndefinedBabel{% + \begingroup + \csname safe@actives@true\endcsname + \expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname r@#1\endcsname\relax + \expandafter\ltx@firstoftwo + \else + \expandafter\ltx@secondoftwo + \fi +} +\rc@AtEnd% \endinput %% %% End of file `refcount.sty'. |