diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/sref/sref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/sref/sref.sty | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/sref/sref.sty b/Master/texmf-dist/tex/latex/stex/sref/sref.sty index 52f4b1c7d12..36d10f60386 100644 --- a/Master/texmf-dist/tex/latex/stex/sref/sref.sty +++ b/Master/texmf-dist/tex/latex/stex/sref/sref.sty @@ -8,10 +8,11 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{sref}[2010/06/25 v0.9 Semantic Cross-References] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\ifextrefs\extrefsfalse \DeclareOption{extrefs}{\extrefstrue} \ProcessOptions -\RequirePackage{omd} +\RequirePackage{metakeys} \newcommand{\sref}[2][]{% \@ifundefined{sref@part}{\sref@hlink[#1]{#2}}{\sref@hlink[#1]{\sref@part @#2}}} \newcommand{\srefs}[3][]{% @@ -33,17 +34,20 @@ \ifextrefs\newwrite\refs@file\else\def\refs@file{\@auxout}\fi \def\sref@def#1#2#3{%\@sref@def{#1}{#2}{#3}% \protected@write\refs@file{}{\string\@sref@def{#1}{#2}{#3}}} -\omdaddkey{srefaddidkey}{prefix} -\newcommand\srefaddidkey[2][]{\omdsetkeys{srefaddidkey}{#1}% -\@omd@ext@clear@keys{#2}{sref@id}{}% id cannot have a default -\define@key{#2}{id}{\edef\sref@id{\srefaddidkey@prefix ##1}}} +\addmetakey{srefaddidkey}{prefix} +\newcommand\srefaddidkey[2][]{\metasetkeys{srefaddidkey}{#1}% +\@metakeys@ext@clear@keys{#2}{sref@id}{}% id cannot have a default +\metakeys@ext@clear@keys{#2}{id}{}% +\metakeys@ext@showkeys{#2}{id}% +\define@key{#2}{id}{\edef\sref@id{\srefaddidkey@prefix ##1}% +\expandafter\edef\csname #2@id\endcsname{\srefaddidkey@prefix ##1}}} \def\makeextrefs#1{\gdef\sref@part{#1}% \makeatletter \IfFileExists{\jobname.refs}{\input{\jobname.refs}}{}% \immediate\openout\refs@file=\jobname.refs \makeatother} \def\sref@label#1#2{% -\sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{page}{\thepage} +\sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{page}{\thepage}% \sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{label}{#1}} \def\sref@label@id#1{\ifx\sref@id\@empty\else\sref@label{#1}{\sref@id}\fi} \newcommand{\sref@hlink}[2][]{\def\@test{#1}% @@ -78,12 +82,12 @@ \makeatother} \srefaddidkey{sequation} \def\sref@sequation@heading{equation} -\newenvironment{sequation}[1][]{\omdsetkeys{sequation}{#1}% +\newenvironment{sequation}[1][]{\metasetkeys{sequation}{#1}% \ifx\sref@id\@empty\begin{displaymath}\else% no id, using equation* \begin{equation}\sref@target\sref@label@id{\sref@sequation@heading~(\theequation)}\fi} {\ifx\sref@id\@empty\end{displaymath}\else\end{equation}\fi} \newenvironment{seqnarray}[1][]% -{\omdsetkeys{sequation}{#1}\begin{eqnarray*}\sref@target% +{\metasetkeys{sequation}{#1}\begin{eqnarray*}\sref@target% \sref@label@id{\sref@sequation@heading~(\theequation)}} {\end{eqnarray*}} \endinput |