diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-25 23:05:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-25 23:05:38 +0000 |
commit | 8e702cd6feaf0a000bfa3a3cdb0bcd66c114a0fe (patch) | |
tree | 8de2cbcd930fe9c51afdbe25fa2965c7fc0e77c4 /Master/texmf-dist/tex/latex/refstyle/refstyle.sty | |
parent | 64f1cfef2e1a181d09514e23bc89d2501a3b4363 (diff) |
refstyle 0.4 (25oct10)
git-svn-id: svn://tug.org/texlive/trunk@20203 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/refstyle/refstyle.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/refstyle/refstyle.sty | 86 |
1 files changed, 51 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/refstyle/refstyle.sty b/Master/texmf-dist/tex/latex/refstyle/refstyle.sty index 69391d53256..a64ddc61ebf 100644 --- a/Master/texmf-dist/tex/latex/refstyle/refstyle.sty +++ b/Master/texmf-dist/tex/latex/refstyle/refstyle.sty @@ -6,29 +6,26 @@ %% %% refstyle.dtx (with options: `pkg') %% +%% Copyright (C) 2002--2010 Danie Els +%% %% ------------------------------------------------------------------- -%% Refstyle package to format references +%% The refstyle package +%% for the formatting of references %% ------------------------------------------------------------------- -%% -%% Author: Danie Els -%% -%% Copyright (C) 2002--2006 Danie Els -%% All rights reserved. -%% %% This work may be distributed and/or modified under the conditions -%% of the LaTeX Project Public License, either version 1.3 of this -%% license or (at your option) any later version. The latest version -%% of this license is in: http://www.latex-project.org/lppl.txt and -%% version 1.3 or later is part of all distributions of LaTeX version -%% 2003/12/01 or later. +%% of the LaTeX Project Public License, either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. %% -%% This work has the LPPL maintenance status "maintained". -%% -%% This Current Maintainer of this work is Danie Els (dnjels@sun.ac.za) +%% This work is "maintained" (as per LPPL maintenance status) +%% by Danie Els (dnjels@sun.ac.za). %% ------------------------------------------------------------------- %% -\newcommand*{\RefstyleFileDate}{2006/09/09} -\newcommand*{\RefstyleFileVersion}{v0.3} +\newcommand*{\RefstyleFileDate}{2010/10/21} +\newcommand*{\RefstyleFileVersion}{v0.4} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{refstyle}[\RefstyleFileDate\space @@ -93,22 +90,33 @@ \def\RS@firstcap#1#2\@nil{% \iffalse{\fi \uppercase{\edef\RS@cap{\iffalse}\fi#1}#2}}% +\newif\ifRS@keyactive +\@ifpackagewith{\@currname}{nokeyprefix}% + {\RS@keyactivefalse}% + {\RS@keyactivetrue} +\DeclareOption{nokeyprefix}{\OptionNotUsed} \newif\ifRSstar\RSstarfalse \newif\ifRSnameon\RSnameontrue \newif\ifRScapname\RScapnamefalse \newif\ifRSplural\RSpluralfalse +\newif\ifRSlsttwo\RSlsttwofalse \newcommand*{\newref}[1]{% \lowercase{\def\RS@tempa{#1}}% \expandafter\RS@newref\expandafter{\RS@tempa}} \newcommand*{\RS@newref}[2]{% \RS@clearref{#1}% - \define@key{RS@#1}{key}[#1:]{\RS@namedef{RS@#1@key}{##1}}% + \ifRS@keyactive + \define@key{RS@#1}{key}[#1:]{\RS@namedef{RS@#1@key}{##1}}% + \else + \define@key{RS@#1}{key}[]{\RS@namedef{RS@#1@key}{##1}}% + \fi \define@key{RS@#1}{s}[true]{\RS@setbool{RSplural}{##1}}% \define@key{RS@#1}{name}[]{\RS@namedef{RS@#1@name}{##1}}% \define@key{RS@#1}{names}[]{\RS@namedef{RS@#1@names}{##1}}% \define@key{RS@#1}{Name}[]{\RS@namedef{RS@#1@Name}{##1}}% \define@key{RS@#1}{Names}[]{\RS@namedef{RS@#1@Names}{##1}}% \define@key{RS@#1}{rngtxt}[\space to~]{\RS@namedef{RS@#1@rngtxt}{##1}}% + \define@key{RS@#1}{lsttwotxt}[\space and~]{\RS@namedef{RS@#1@lsttwotxt}{##1}}% \define@key{RS@#1}{lsttxt}[\space and~]{\RS@namedef{RS@#1@lsttxt}{##1}}% \define@key{RS@#1}{refcmd}[\ref{####1}]{\RS@namedef{RS@#1@rcmd}####1{##1}}% \define@key{RS@#1}{xr}[]{\RS@namedef{RS@#1@xr}{##1}}% @@ -116,7 +124,7 @@ \RS@setkeys{RS@#1}{key, s=false, name,names,Name,Names, - rngtxt,lsttxt, + rngtxt,lsttwotxt,lsttxt, refcmd, xr, vref=false}% @@ -175,18 +183,24 @@ \RS@makeref{#1}{#2}% \RS@makevpageref{#1}{#2}% \RSnameonfalse% + \RSlsttwotrue% \RS@@@ref{#1} #3\@eolst% \fi} \def\RS@@@ref#1 #2,#3\@eolst{% - \ifx\relax#3\relax - \RS@nameuse{RS@#1@lsttxt}% - \RS@makeref{#1}{#2}% - \RS@makevpageref{#1}{#2}% - \else - \unskip,\space% - \RS@makeref{#1}{#2}% - \RS@makevpageref{#1}{#2}% - \RS@@@ref{#1} #3\@eolst% + \ifx\relax#3\relax + \ifRSlsttwo + \RS@nameuse{RS@#1@lsttwotxt}% + \else + \RS@nameuse{RS@#1@lsttxt}% + \fi + \RS@makeref{#1}{#2}% + \RS@makevpageref{#1}{#2}% + \else + \RSlsttwofalse% + \unskip,\space% + \RS@makeref{#1}{#2}% + \RS@makevpageref{#1}{#2}% + \RS@@@ref{#1} #3\@eolst% \fi} \def\RS@rangeref#1[#2]#3#4{% \begingroup @@ -293,13 +307,15 @@ {\DeclareOption{#1}{\expandafter\RSaddto\csname extras#1\endcsname #2}}% } \newcommand*{\RS@cfgfile}{refstyle.cfg} -\@ifpackagewith{\@currname}{noconfig} - {\PackageInfo{\RS@pkgname}{No config file loaded}}% - {\InputIfFileExists{\RS@cfgfile}% - {\PackageInfo{\RS@pkgname}{Config file \RS@cfgfile\space used}}% - {\PackageInfo{\RS@pkgname}{Config file \RS@cfgfile\space not found}}% - } -\DeclareOption{noconfig}{\OptionNotUsed} +\newcommand*{\RS@reffile}{refstyle.def} +\@ifpackagewith{\@currname}{noconfig}% + {\PackageInfo{\RS@pkgname}{No config file loaded}}% + {\InputIfFileExists{\RS@reffile}% + {\PackageInfo{\RS@pkgname}{Local config file \RS@reffile\space used}} + {\InputIfFileExists{\RS@cfgfile}% + {\PackageInfo{\RS@pkgname}{Config file \RS@cfgfile\space used}}% + {\PackageInfo{\RS@pkgname}{No config file found}}}} +\DeclareOption{noconfig}{\OptionNotUsed}% \ProcessOptions*\relax \endinput %% |