summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/modref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-02-04 14:26:56 +0000
committerKarl Berry <karl@freefriends.org>2009-02-04 14:26:56 +0000
commitdbad3960fac04316f576aa1bae89e5742f108e32 (patch)
tree89a5eb8678e3967252e9cf8e77c269a7c5b8f6f8 /Master/texmf-dist/tex/latex/modref
parent7a435f08f9cf1fd60752d4430900dd004787ca7a (diff)
new latex package modref (3feb09)
git-svn-id: svn://tug.org/texlive/trunk@12072 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/modref')
-rw-r--r--Master/texmf-dist/tex/latex/modref/modref.sty140
1 files changed, 140 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/modref/modref.sty b/Master/texmf-dist/tex/latex/modref/modref.sty
new file mode 100644
index 00000000000..25c7cc6f672
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/modref/modref.sty
@@ -0,0 +1,140 @@
+%%
+%% This is file `modref.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% modref.dtx (with options: `package')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from modref.sty.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file modref.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%% =============================================================================================
+\def\basename{modref}
+\def\fullname{restyle: cross-referencing hacks for LaTeX}
+\def\revisiondate{2009/02/02}
+\def\revision{0.9}
+\def\writtenby{J. Niel de Beaudrap}
+%% \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
+%% Lower-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
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+%% Package `modref' to use with LaTeX 2e
+%% Copyright (C) 2007 J. Niel de Beaudrap, all rights reserved.
+\typeout{-------}
+\typeout{\fullname \space v\revision \space(\basename)}
+\typeout{\writtenby, \revisiondate}
+\typeout{-------}
+\ProvidesPackage{modref}[\revisiondate {} {v\revision} {\writtenby}]
+\RequirePackage{kvoptions}
+
+\DeclareOption*{\PackageWarning{Unknown option `\CurrentOption'.}}
+\makeatletter
+%% Main text:
+\newcommand\modref@error{\PackageError{modref}}
+\edef\reserved@a{Ref}%
+\@ifundefined\reserved@a{%
+ \let\Ref\ref
+}{%
+ \modref@error{%
+ Command \string\Ref\ defined already; refer to the help message.%
+ }{%
+ The "modref" package defines the command \string\Ref\ to allow you (and
+ the package) to use the original functionality of \string\ref. However, in
+ this instance, \string\Ref\ already had a meaning when "modref" started
+ running. Please determine what is defining \string\Ref, and whether you need
+ it.}}
+\def\@ifempty#1{\@xifempty#1@@..\@nil}
+\long\def\@xifempty#1#2@#3#4#5\@nil{ %
+ \ifx#3#4\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+\DeclareStringOption[:]{delimiter}
+\ProcessKeyvalOptions*
+\newcommand\setrefdelimiter[1]{%
+ \def\ref##1{\modref@ref##1#1\egroup\modref@basestyle}%
+ \def\varref##1{\modref@ref##1#1\egroup\modref@varbasestyle}%
+ \def\modref@ref##1#1##2\egroup##3{%
+ \@ifempty{##2}{%
+ \expandafter\@setref\csname r@##1\endcsname{##3\expandafter\@iden}{##1}%
+ }{%
+ \modref@@ref##1#1##2\egroup##3}}%
+ \def\modref@@ref##1#1##2#1\egroup##3{%
+ \@ifundefined{@modref@##1}{%
+ \expandafter\@setref\csname r@##1#1##2\endcsname{%
+ ##3\expandafter\@iden}{##1#1##2}%
+ }{%
+ \expandafter\def\expandafter\@tempa\expandafter{%
+ \csname @modref@##1\endcsname}%
+ \expandafter\@setref\csname r@##1#1##2\endcsname{%
+ ##3\expandafter\@tempa}{##1#1##2}%
+ }}%
+}%
+\ifx\modref@delimiter\@empty
+ \modref@error{Option "delimiter" must be set to a non-empty value}{%
+ The option "delimiter" was used, but seems to have been set to the
+ empty string. I require a character, or a multi-character string, to
+ delimit reference style names within cross-reference labels. If in
+ doubt, just remove the "delimiter" option, and this should fix things.}%
+\else
+ \expandafter\setrefdelimiter\expandafter{\modref@delimiter}%
+\fi
+\newcommand\GlobalRefStyle[1]{\def\modref@@basestyle##1##2{#1}}
+\newcommand\GlobalVarRefStyle[1]{\def\modref@@varbasestyle##1##2{#1}}
+\@onlypreamble\GlobalRefStyle
+\@onlypreamble\GlobalVarRefStyle
+\def\modref@basestyle#1#2#3{\modref@@basestyle{#1{#2}}{#3}}%
+\def\modref@varbasestyle#1#2#3{\modref@@varbasestyle{#1{#2}}{#3}}%
+\GlobalRefStyle{#1}%
+\GlobalVarRefStyle{#1}%
+\edef\reserved@a{refstyle}%
+\@ifundefined\reserved@a{%
+ \newcommand\refstyle[2]{%
+ \expandafter\def\csname @modref@#1\endcsname##1{#2}}%
+}{%
+ \modref@error{%
+ Command \string\refstyle\ defined already; refer to the help message.
+ }{%
+ The "modref" package defines the command \string\refstyle; however,
+ in this instance, \string\refstyle\ already had a meaning when "modref"
+ started running. Please determine what is defining \string\refstyle, and
+ whether you need it.}}
+\newcommand\eqrefstyle[1]{%
+ \def\eqref##1{%
+ \maketag@@@{%
+ \expandafter\@setref\csname r@##1\endcsname{%
+ \modref@trivbasestyle\expandafter\modref@eqref}{##1}}}%
+ \def\modref@eqref##1{#1}}%
+\def\modref@trivbasestyle#1#2#3{#1{#2}}
+\newcommand\displaytagstyle[1]{%
+ \def\modref@tagstyle##1{#1}%
+ \def\tagform@##1{\maketag@@@{\modref@tagstyle{##1}}}%
+ \@ifundefined{modref@eqref}{%
+ \eqrefstyle{\textup{(\ignorespaces#1\unskip\@@italiccorr)}}%
+ }\relax
+}%
+\makeatother
+\endinput
+%%
+%% End of file `modref.sty'.