diff options
author | Karl Berry <karl@freefriends.org> | 2010-11-04 22:57:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-11-04 22:57:53 +0000 |
commit | d7657995bee70cf2feba1fe06e2b5c8f133a39b6 (patch) | |
tree | c398e83d9729e8149805720a5c88e7f0c46ef110 /Master/texmf-dist/source/latex/refstyle/refstyle.dtx | |
parent | 5877e6f814a0c1dfce1fc636d6dc2ffc80e997f8 (diff) |
refstyle 0.5 (4nov10)
git-svn-id: svn://tug.org/texlive/trunk@20318 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/refstyle/refstyle.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/refstyle/refstyle.dtx | 144 |
1 files changed, 88 insertions, 56 deletions
diff --git a/Master/texmf-dist/source/latex/refstyle/refstyle.dtx b/Master/texmf-dist/source/latex/refstyle/refstyle.dtx index 21b9ff6d3d5..46fa9e3c66c 100644 --- a/Master/texmf-dist/source/latex/refstyle/refstyle.dtx +++ b/Master/texmf-dist/source/latex/refstyle/refstyle.dtx @@ -26,8 +26,8 @@ % ------------------------------------------------------------------- % %<*pkg> -\newcommand*{\RefstyleFileDate}{2010/10/21} -\newcommand*{\RefstyleFileVersion}{v0.4} +\newcommand*{\RefstyleFileDate}{2010/11/02} +\newcommand*{\RefstyleFileVersion}{v0.5} %</pkg> % % @@ -185,7 +185,7 @@ %</driver> % \fi % -% \CheckSum{545} +% \CheckSum{552} % % \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 @@ -209,6 +209,7 @@ % \changes{v0.3}{2006/09/09}{Documentation update} % \changes{v0.4}{2010/10/21}{Documentation update} % \changes{v0.4}{2010/10/21}{Add \texttt{nokeyprefix} option} +% \changes{v0.5}{2010/11/02}{Documentation update} % % \DoNotIndex{ % \@backslashchar, \@carcube, \@ehc, \@empty, \@firstoftwo, @@ -330,6 +331,7 @@ % \end{Ipara} % is provided to declare the package option \meta{language} and add % \meta{definitions} to the |\extras|\meta{language} token for \pkg{babel}. +% It can only be used inside \RScfg\ or \file{refstyle.def}. % % \item[(b)] % Or with an existing configuration with language support and addition @@ -443,15 +445,15 @@ % \newcommand*{\crsi}{\smash{\rule[0pt]{.4pt}{1.25em}\rule[.5ex]{1.5em}{.4pt}}}^^A % \newcommand*{\crsl}{\smash{\rule[.5ex]{.4pt}{1.5em}\rule[.5ex]{1.5em}{.4pt}}}^^A % \begin{Itabb} -% \hspace*{2em}\=\hspace{2em}\=\kill +% \hspace*{2em}\=\hspace{2em}\=\hspace{10em}\=\kill % \cmd{\newref}\marg{\rtp}\mkeylst\tab\mbox{}\\[.75ex] -% \>\crsi \>\argcmd{{\rtp}}{key}\\[.75ex] -% \>\crsl \>\argcmd{{\rtp}}{label}\\[.75ex] -% \>\crsl \>\argcmd{{\rtp}}{ref}\\[.75ex] -% \>\crsl \>\argcmd{{\Rtp}}{ref}\\[.75ex] -% \>\crsl \>\argcmd{{\rtp}}{rangeref}\\[.75ex] -% \>\crsl \>\argcmd{{\Rtp}}{rangeref}\\[.75ex] -% \>\crsl \>\argcmd{{\rtp}}{pageref} +% \>\crsi \>\argcmd{{\rtp}}{key} \> Reference argument prefix \\[.75ex] +% \>\crsl \>\argcmd{{\rtp}}{label} \> Custom label \\[.75ex] +% \>\crsl \>\argcmd{{\rtp}}{ref} \> In text reference \\[.75ex] +% \>\crsl \>\argcmd{{\Rtp}}{ref} \> Start of sentence reference \\[.75ex] +% \>\crsl \>\argcmd{{\rtp}}{rangeref} \> In text range reference \\[.75ex] +% \>\crsl \>\argcmd{{\Rtp}}{rangeref} \> Start of sentence range reference\quad\mbox{}\\[.75ex] +% \>\crsl \>\argcmd{{\rtp}}{pageref} \> Page reference % \end{Itabb} % \end{cminipage} % \blankline @@ -816,8 +818,14 @@ % \>~ $\rightarrow$ |table~\ref{xxx-abc}| % \end{Itabb} % For existing documents containing labels such as |\label{tab:xx}|, -% you can define \opt{key}|={}| and use the existing labels with -% \RS, e.g.: |\tabref{tab:xx}|. +% you can use the \opt{nokeyprefix} option which defines \opt{key}|={}|. The +% normal \cmd{\label} command can then be used and the reference +% commands defaults to +% \begin{Itabb} +% \tab\=\hspace{3.5cm}\=\hspace{2em}\=\kill +% \>\cmd{\label}|{tab:xx}| \\ +% \>|\tabref{tab:xx}| \>~ $\rightarrow$ |table~\ref{tab:xx}| +% \end{Itabb} % % % \subsection{Plural form: \opt{s}} @@ -1034,10 +1042,14 @@ % \Secref[vref, refcmd={\S\ref{#1}, `\nameref{#1}'}]{PRefCmds} % \end{Ipara} % -% \section{Default configuration file} +% \section{Default configuration files} +% +% The \pkg{refstyle} package first searches for the \file{refstyle.def} +% configuration file, and if it not found, then it uses the default +% configuration file \RScfg\ that is supplied with the package. % % The default configuration file, \RScfg, makes a -% number of default reference declarations and provides langauge +% number of default reference declarations and provides language % definitions for the language parameters. See the file % \file{refconfig.pdf} for the documentation. % \medskip @@ -1045,7 +1057,9 @@ % \begin{center} % \begin{fminipage}[.55\textwidth] % \slshape Any user is welcome to customize the -% local copy of the \RScfg\ file. +% local copy of the \RScfg\ file or copy +% the relevant contents to your own \file{refstyle.def} +% configuration file. % \end{fminipage} % \end{center} % @@ -1099,6 +1113,19 @@ \@ifundefined{vref@space}{\let\vref@space\space}{} % \end{macrocode} % +% \begin{macro}{\@safe@activestrue} +% \changes{v0.5}{2010/11/02}{Add \cmd{\@safe@activesfalse}} +% \begin{macro}{\@safe@activesfalse} +% \changes{v0.5}{2010/11/02}{Add \cmd{\@safe@activestrue}} +% If \pkg{babel} is not loaded, make the following +% commands inactive. +% \begin{macrocode} +\providecommand*{\@safe@activestrue}{} +\providecommand*{\@safe@activesfalse}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Utility commands} % % \begin{macro}{\RS@namelet} @@ -1319,15 +1346,15 @@ % \begin{macrocode} \newcommand*{\RS@newref}[2]{% % \end{macrocode} -% \bNP[1.5]\noindent Clears an existing template before defining a new one.\eNP +% \bNP[2.0]\noindent Clears an existing template before defining a new one.\eNP % \begin{macrocode} \RS@clearref{#1}% % \end{macrocode} -% \bNP[1.5]\noindent Create |\ifRS@|\meta{key}|vref| conditional \eNP +% \bNP[2.0]\noindent Create |\ifRS@|\meta{key}|vref| conditional \eNP % \begin{macrocode} % \expandafter\newif\csname ifRS@#1vref\endcsname% % \end{macrocode} -% \bNP[1.5]\noindent Creates a series of key-values for every template +% \bNP[2.0]\noindent Creates a series of key-values for every template % that stores the setup for the specific template.\eNP % \begin{macrocode} \ifRS@keyactive @@ -1335,36 +1362,36 @@ \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}}% - \define@key{RS@#1}{vref}[true]{\RS@namedef{RS@#1vref}{##1}}% + \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}}% + \define@key{RS@#1}{vref}[true]{\RS@namedef{RS@#1vref}{##1}}% % \end{macrocode} -% \bNP[1.5]\noindent Set default key-value parameters.\eNP +% \bNP[2.0]\noindent Set default key-value parameters.\eNP % \begin{macrocode} - \RS@setkeys{RS@#1}{key, - s=false, - name,names,Name,Names, - rngtxt,lsttwotxt,lsttxt, - refcmd, - xr, - vref=false}% + \RS@setkeys{RS@#1}{key, + s=false, + name,names,Name,Names, + rngtxt,lsttwotxt,lsttxt, + refcmd, + xr, + vref=false}% % \end{macrocode} -% \bNP[1.5]Set key-values according to user definitions.\eNP +% \bNP[2.0]\noindent Set key-values according to user definitions.\eNP % \begin{macrocode} - \RS@setkeys{RS@#1}{#2}% + \RS@setkeys{RS@#1}{#2}% % \end{macrocode} -% \bNP[1.5]Build the reference commands.\eNP +% \bNP[2.0]\noindent Build the reference commands.\eNP % \begin{macrocode} - \RS@buildref{#1}% - } + \RS@buildref{#1}% + } % \end{macrocode} % \end{macro} % @@ -1450,9 +1477,10 @@ % \subsection{Reference formatting commands} % % \begin{macro}{\RS@ref} +% \changes{v0.5}{2010/11/02}{Add \cmd{\@safe@activestrue} to avoid active chars is ref list} % \begin{macro}{\RS@@ref} % \begin{macro}{\RS@@@ref} -% \changes{v0.4}{2010/10/21}{Add \cmd{\ifRSlsttwo} test for list containing only two parameter} +% \changes{v0.4}{2010/10/21}{Add \cmd{\ifRSlsttwo} test for list containing only two parameter} % The command \cmd{\RS@ref}\marg{key}\okeylst\marg{label\_lst} % typeset the references to the comma-separated reference % label list according to the configuration for \meta{key}. @@ -1460,12 +1488,14 @@ % First of all, remove all spaces for the reference label list. % \begin{macrocode} \def\RS@ref#1[#2]#3{% - \begingroup - \RS@setkeys{RS@#1}{#2}% - \edef\RS@tmpa{\zap@space#3 \@empty}% - \edef\RS@tmpa{\noexpand\RS@@ref{#1} \RS@tmpa,\relax\noexpand\@eolst}% - \RS@tmpa% - \endgroup} + \begingroup + \RS@setkeys{RS@#1}{#2}% + \@safe@activestrue% + \edef\RS@tmpa{\zap@space#3 \@empty}% + \@safe@activesfalse% + \edef\RS@tmpa{\noexpand\RS@@ref{#1} \RS@tmpa,\relax\noexpand\@eolst}% + \RS@tmpa% + \endgroup} % \end{macrocode} % \end{macro} % Check if there is a single or multiple references in the @@ -1699,17 +1729,19 @@ % \end{macro} % % \begin{macro}{\DeclareLangOpt} +% \changes{v0.5}{2010/11/02}{Add \cmd{\extras}\meta{language} to beginning of document.} % Command to declare a language option and add % language definitions to the |\extras|\meta{language} token % for \pkg{babel}. % \begin{macrocode} \def\DeclareLangOpt#1#2{% - \edef\RS@tempa{\expandafter\@gobble\string#2}% - \RS@ifundefined{\RS@tempa}% - {\PackageError{\RS@pkgname}% - {Unknown definitions \@backslashchar\RS@tempa\MessageBreak - for language option `#1'}{}}% - {\DeclareOption{#1}{\expandafter\RSaddto\csname extras#1\endcsname #2}}% + \edef\RS@tempa{\expandafter\@gobble\string#2}% + \RS@ifundefined{\RS@tempa}% + {\PackageError{\RS@pkgname}{% + Unknown definitions \@backslashchar\RS@tempa\MessageBreak + for language option `#1'}{}}% + {\DeclareOption{#1}{% + \AtBeginDocument{\expandafter\RSaddto\csname extras#1\endcsname #2}}}% } % \end{macrocode} % \end{macro} |