texlive[42388] Master: wtref (30oct16)

commits+karl at tug.org commits+karl at tug.org
Sun Oct 30 22:48:36 CET 2016


Revision: 42388
          http://tug.org/svn/texlive?view=revision&revision=42388
Author:   karl
Date:     2016-10-30 22:48:35 +0100 (Sun, 30 Oct 2016)
Log Message:
-----------
wtref (30oct16)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/wtref/
    trunk/Master/texmf-dist/doc/latex/wtref/LICENSE
    trunk/Master/texmf-dist/doc/latex/wtref/README.md
    trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.pdf
    trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.tex
    trunk/Master/texmf-dist/doc/latex/wtref/wtref.pdf
    trunk/Master/texmf-dist/doc/latex/wtref/wtref.tex
    trunk/Master/texmf-dist/tex/latex/wtref/
    trunk/Master/texmf-dist/tex/latex/wtref/wtref.sty
    trunk/Master/tlpkg/tlpsrc/wtref.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/wtref/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/wtref/LICENSE	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/wtref/LICENSE	2016-10-30 21:48:35 UTC (rev 42388)
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 WatsonDNA
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

Added: trunk/Master/texmf-dist/doc/latex/wtref/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/wtref/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/wtref/README.md	2016-10-30 21:48:35 UTC (rev 42388)
@@ -0,0 +1,28 @@
+# WTRef Package (v0.3.1)
+
+WTRef package extend cross-reference system of LaTeX2e and introduce concepts of namespace and scope. This package is a part of the [WT Series](https://watson-lab.com/wt-series/).
+
+## System Requirements
+
+* TeX format: LaTeX2e
+* TeX engine: any engine
+* Document class: any class
+* Prerequisite package: xkeyval
+
+## Installation
+
+Move wtref.sty file to $TEXMF/tex/la­tex/wtref.
+
+## Documents
+
+Documents for this pacakge are available in [English](./wtref.pdf) and [Japanese](./wtref-ja.pdf).
+
+## License
+
+This package released under [the MIT license](./LICENSE).
+
+
+---
+
+Takuto ASAKURA (a.k.a. wtsnjp)  
+<https://watson-lab.com>


Property changes on: trunk/Master/texmf-dist/doc/latex/wtref/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.pdf	2016-10-30 21:47:55 UTC (rev 42387)
+++ trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.pdf	2016-10-30 21:48:35 UTC (rev 42388)

Property changes on: trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.tex	2016-10-30 21:48:35 UTC (rev 42388)
@@ -0,0 +1,173 @@
+\documentclass[a4paper,uplatex]{jsarticle}
+
+\usepackage{otf}
+\usepackage{enumitem}
+\usepackage{shortvrb}
+\MakeShortVerb{\|}
+\newcommand{\PkgName}{\textsf{WTRef}}
+\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$}
+\newenvironment{syntax}{\begin{quote}\small}{\end{quote}}
+
+\title{\PkgName パッケージ (v0.3.1)}
+\author{ワトソン}
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+WTシリーズは著者が\LaTeX 文書作成にあたってよく利用するマクロを集めたものである.
+\PkgName パッケージはこのWTシリーズを構成するパッケージの1つであり,\LaTeX オリジナルの
+相互参照機能を拡張してスコープの指定と名前空間の分離,参照形式の柔軟な指定を可能にする.
+サポート対象は任意の\TeX エンジンと\LaTeXe の組み合わせで,動作には\textsf{xkeyval}
+パッケージが必要である.
+\end{abstract}
+
+\section{動作要件}
+
+\PkgName パッケージの動作要件は以下の通りである.
+%
+\begin{itemize}
+\item \TeX エンジン:任意
+\item \TeX フォーマット:\LaTeXe
+\item ドキュメントクラス:任意
+\item 依存パッケージ:\textsf{xkeyval}
+\end{itemize}
+
+\section{パッケージ読み込み}
+
+読み込みには |\usepackage| 命令を用いる.オプションは存在しない.
+%
+\begin{syntax}
+|\usepackage{wtref}|
+\end{syntax}
+
+\section{相互参照命令}
+
+\subsection{相互参照命令の新設}
+
+|\newref| 命令を用いて相互参照に用いる2つの命令を新設することができる.この命令は
+プリアンブルでのみ使用可能である.
+%
+\begin{syntax}
+|\newref[|\Meta{options}|]{|\Meta{ref types}|}|
+\end{syntax}
+
+上記書式中の\Meta{ref types}は\Meta{ref type}のカンマ区切りリストである.\Meta{ref type}は
+制御綴に使用できる文字のみで構成された文字列で(半角英字のみにしておくことを推奨),空で
+あってはならない.なお\Meta{ref types}の先頭・末尾およびカンマ前後の連続する空白は
+すべて無視される.
+
+|\newref| 命令は指定した\Meta{ref type}に応じて |\|\Meta{ref type}|label|,
+|\|\Meta{ref type}|ref| という形をもつ,新しい2つの命令を定義する.ここで前者の命令を
+\textbf{ラベル命令},後者の命令を\textbf{参照命令}と呼ぶことにする.|\newref| 命令は同名の
+命令が既に存在していても,その定義を上書きするので\Meta{ref type}は注意して選ぶ必要がある.
+
+また,\Meta{options}には以下の内容をkey-valueリストで指定可能である:
+%
+\begin{description}[font=\normalfont]
+%
+\item[|namespace=|\Meta{string}]
+与えられた値を用いて\Meta{namespace}を``\Meta{string}|:|''に設定する.|namespace|キーも
+|nonamespace|キーも指定しない場合,および|namespace|に与えた\Meta{string}が空文字列であった
+場合\Meta{namespace}は``\Meta{ref type}|:|''に設定される.
+%
+\item[|nonamespace|]
+このキーを指定すると,\Meta{namespace}は空となる.すなわち,名前空間機能を無効化できる.
+なお,|nonamespace|キーに値を指定してもエラーにはならないが,単に無視される.
+%
+\item[|scope=|\Meta{counter}]
+スコープとして利用するカウンタを指定する.\Meta{counter}には任意の\LaTeX カウンタを指定する
+ことが可能だが,文書内で一意性のあるカウンタを指定することが望ましい.これにより\Meta{scope}は
+``|\the|\Meta{counter}|:|''の形に設定される.
+\end{description}
+%
+これらの設定は,\Meta{ref types}で指定したすべての\Meta{ref type}に対応する相互参照命令に
+ついて適用される.
+
+ここで\Meta{options}に何も指定しない場合\Meta{namespace}は\Meta{ref type}が転用されて
+``\Meta{ref type}|:|''の形となり\Meta{scope}は空に設定される.言い換えると,デフォルトでは
+名前空間機能が有効,スコープ機能は無効に設定されている.
+
+\subsection{ラベル命令}
+
+\subsubsection{機能と使い方}
+
+ラベル命令はラベルを付けるときに用いる.使い方は\LaTeX の |\label| 命令とまったく同様である.
+以下にラベル命令の例 |\exlabel| を用いるときの書式を示しておく.
+%
+\begin{syntax}
+|\exlabel{|\Meta{label}|}|
+\end{syntax}
+
+\subsubsection{内部処理}
+
+ラベル命令は最終的に次のような形に展開される.
+%
+\begin{syntax}
+|\label{|\Meta{namespace}\Meta{scope}\Meta{label}|}|
+\end{syntax}
+
+\subsection{参照命令}
+
+参照命令は対応するラベル命令によってラベル付けされた番号を,指定した書式で印字するための
+命令である.例として |\exref| の使い方を以下に示す.
+%
+\begin{syntax}
+|\exref[|\Meta{the scope}|]{|\Meta{label list}|}|
+\end{syntax}
+
+参照するラベルが同じスコープ内に存在する場合は\Meta{the scope}は省略可能である.
+\Meta{the scope}に参照先のスコープに対応する``|\the|\Meta{counter}''の出力を直接記入することで
+スコープの範囲外からラベルを参照することが可能である.なお,スコープ機能が無効
+(|\newref| によって相互参照命令を定義する際に\Meta{options}で |scope| キーを指定しなかった
+場合)のときは,\Meta{the scope}は常に無視される.
+
+また,引数にはカンマ区切りで複数の参照先ラベルを指定することが可能である.
+\Meta{label list}の先頭・末尾およびカンマ前後の連続する空白はすべて無視される.
+複数のラベルを指定した場合,デフォルトでは該当する番号がカンマ区切りで出力される.この出力書式
+は後述する参照書式変更命令 |\setrefstyle| を用いて柔軟にカスタマイズすることができる.
+
+\section{参照書式変更命令}
+
+|\setrefstyle| 命令を用いると,参照命令による出力を柔軟にカスタマイズすることができる.
+最初に |\setrefstyle| 命令の書式を示しておく.
+%
+\begin{syntax}
+|\setrefstyle{|\Meta{ref types}|}{|\Meta{options}|}|
+\end{syntax}
+
+これにより\Meta{ref types}中に含まれる\Meta{ref type}に対応する参照命令が出力する内容の
+書式を変更できる.この |\setrefstyle| 命令はプリアンブルに限らず\LaTeX 文書ソース中全域で
+使用可能であり,設定の有効範囲は |{| や |}| によるブロックの制御を受ける.
+
+\Meta{options}には以下の内容をkey-valueリストで指定可能である:
+%
+\begin{description}[font=\normalfont]
+\item[|refcmd=|\Meta{command}]
+\Meta{label list}に与えたラベルの数だけ,指定した\Meta{command}が繰り返し実行・印字される.
+\Meta{command}中に記入された |#1| は適切に整形されたラベル名に置換される.
+規定値は |\ref{#1}|.
+%
+\item[|sep=|\Meta{command}]
+\Meta{label list}に3つ以上のラベルが記入されているときに,|refcmd| の各出力の間に印字
+する区切りの内容を指定する.ただし,最後の区切りは |last sep| に指定した値となる.
+規定値は |{,\space}|.
+%
+\item[|last sep|(|=|\Meta{command})]
+\Meta{label list}に複数のラベルが記入されている際に出力される,最後の区切りを指定する.
+|=| 以降を記入せず,単に |last sep| と指定した場合,最後の区切りには |sep| の値が適用される.
+規定値は値指定なし(つまり |sep| の値に従属).
+%
+\item[|prefix=|\Meta{command}]
+参照命令を使用したとき,最初に実行・印字される内容を指定する.
+規定値は |{}|.
+%
+\item[|suffix=|\Meta{command}]
+参照命令を使用したとき,最後に実行・印字される内容を指定する.
+規定値は |{}|.
+\end{description}
+%
+これらの設定は,明示的に指定したもの以外はそれ以前の設定がそのまま引き継がれる.
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/wtref/wtref-ja.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/wtref/wtref.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/wtref/wtref.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/wtref/wtref.pdf	2016-10-30 21:47:55 UTC (rev 42387)
+++ trunk/Master/texmf-dist/doc/latex/wtref/wtref.pdf	2016-10-30 21:48:35 UTC (rev 42388)

Property changes on: trunk/Master/texmf-dist/doc/latex/wtref/wtref.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/wtref/wtref.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/wtref/wtref.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/wtref/wtref.tex	2016-10-30 21:48:35 UTC (rev 42388)
@@ -0,0 +1,169 @@
+\documentclass[a4paper]{article}
+
+\usepackage{enumitem}
+\usepackage{shortvrb}
+\MakeShortVerb{\|}
+\newcommand{\PkgName}{\textsf{WTRef}}
+\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$}
+\newenvironment{syntax}{\begin{quote}\small}{\end{quote}}
+
+\title{{\PkgName} Package (v0.3.1)}
+\author{Watson}
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+WT Series collects macros which author frequently use to create {\LaTeX} documents.
+{\PkgName} package is a part of this WT Series that extend {\LaTeX} original
+cross-reference system. It makes enable to divide namespace and scope, further arrows users
+to customise reference formats. {\LaTeXe} on any kind of {\TeX} engine is supported, and
+\textsf{xkeyval} package is required.
+\end{abstract}
+
+\section{System Requirements}
+
+System requirements of {\PkgName} are shown bellow:
+%
+\begin{itemize}
+\item {\TeX} engine: any engine
+\item {\TeX} format: \LaTeXe
+\item Document class: any class
+\item Required package: \textsf{xkeyval}
+\end{itemize}
+
+\section{Loading the {\PkgName} Package}
+
+To use {\PkgName} package, load \texttt{wtref.sty} file with |\usepackage| command in preamble.
+No package option is available.
+%
+\begin{syntax}
+|\usepackage{wtref}|
+\end{syntax}
+
+\section{Cross-Reference Commands}
+
+\subsection{Definition of New Cross-Reference Commands}
+
+|\newref| command create a set of cross-reference commands. This command can only be used
+in preamble.
+%
+\begin{syntax}
+|\newref[|\Meta{options}|]{|\Meta{ref types}|}|
+\end{syntax}
+%
+\Meta{ref types} are comma-separated list of \Meta{ref type}. All characters of \Meta{ref type}
+must be able to use in control sequence (only ordinary alphabet is recommended) and can not be
+empty. Notice that leading and trailing spaces and successive spaces arround commas are ignored.
+
+|\newref| command defines two commands: |\|\Meta{ref type}|label|, |\|\Meta{ref type}|ref|.
+In this document, the formar are called \textbf{label commands} and the latter are called
+\textbf{reference commands}. |\newref| command overwrites existing commands, so \Meta{ref name}
+should be decided carefully.
+
+In \Meta{options}, you can set following parameters by key-value list:
+%
+\begin{description}[font=\normalfont]
+\item[|namespace=|\Meta{string}]
+Set \Meta{namespace} to ``\Meta{string}:''. If neither |namespace| nor |nonamespace| are
+specified, or in case \Meta{string} of |namespace| is empty, \Meta{namespace} is set to
+``\Meta{ref type}:''.
+%
+\item[|nonamespace|]
+Set \Meta{namespace} to empty. That is to say, invalidation of function that dividing
+namespace. It should be noted that you can specify value for |nonamespace| and that
+will not make any errors, but the value will simply be ignored.
+%
+\item[|scope=|\Meta{counter}]
+Specify counter which used as scope. You can specify any {\LaTeX} counter to \Meta{counter}
+but one which has uniqueness in a document is desirable. This key sets \Meta{scope} to
+``|\the|\Meta{counter}:''.
+\end{description}
+%
+These optional settings apply to all cross-referece commands relate to \Meta{ref type}
+in specified \Meta{ref types}.
+
+Identically, if any keys do not specified in \Meta{options}, \Meta{namespace} is set to
+``\Meta{ref type}'' and \Meta{scope} is set to empty. In other words, the function of
+namespace is active and function of scope is inactive as default.
+
+\subsection{Label Commands}
+
+\subsubsection{Function and Usage}
+
+Label commands are used to create new labels. Usage of those are same to |\label| command
+of standard {\LaTeX}. Usage of |\exlabel| is shown bellow as an example:
+%
+\begin{syntax}
+|\exlabel{|\Meta{label}|}|
+\end{syntax}
+
+\subsubsection{Internal Processing}
+
+Label commands finaly are expanded to following format:
+%
+\begin{syntax}
+|\label{|\Meta{namespace}\Meta{scope}\Meta{label}|}|
+\end{syntax}
+
+\subsection{Reference Commands}
+
+Reference commands print contents of counters which labeled by label commands in specified
+formats. Usage of |\exref| is shown bellow as an example:
+%
+\begin{syntax}
+|\exref[|\Meta{the scope}|]{|\Meta{label list}|}|
+\end{syntax}
+
+The option argument \Meta{the scope} can be ommited when refering label exists in the
+same scope. You can refer outside of scope by writing down the output of proper
+|\the|\Meta{counter}. Notice that if the function of scope is inactive
+(i.e. in case |scope| key does not specified in \Meta{options} of |\newref|), this argument
+is always unnecessary, and in other words it will be ignored all the time.
+
+In argument \Meta{label list}, plural labels can be written in comma-separated. Note that
+leading and trailing spaces and successive spaces arround commas are ignored. If actually
+plural labels are filled in, pertinent counters should be printed out in comma-separate
+form in default. You can change this format flexibly with |\setrefstyle| command.
+
+\section{Setting Referece Style}
+
+The output format of reference commands can be customised with |\setrefstyle| command.
+The syntax of |\setrefstyle| is shown bellow:
+%
+\begin{syntax}
+|\setrefstyle{|\Meta{ref types}|}{|\Meta{options}|}|
+\end{syntax}
+
+The |\setrefstyle| command can be used any place of {\LaTeX} document (not only preamble),
+and change reference format locally.
+
+In \Meta{options}, you can set following parameters by key-value list:
+%
+\begin{description}[font=\normalfont]
+\item[|refcmd=|\Meta{command}]
+Specified \Meta{command} repeated for the number of labels which filled in \Meta{label list}
+time. String |#1| in \Meta{command} may be replaced into appropriate label name. The default
+value is |\ref{#1}|.
+%
+\item[|sep=|\Meta{command}]
+Specified \Meta{command} is output as a separater of each |refcmd| when more than three
+labels filled in \Meta{label list}. Notice that last one separater is given by |last sep|.
+The default value is |{,\space}|.
+%
+\item[|last sep|(|=|\Meta{command})]
+Specified \Meta{command} is output as a last separater when plura labels filled in
+\Meta{label list}. Behind the |=| can be ommited, and in that case |last sep| is set
+to identical value of |sep| (and this is the default).
+%
+\item[|prefix=|\Meta{command}]
+Specified \Meta{command} put out first when referece command used. The default value is |{}|.
+%
+\item[|suffix=|\Meta{command}]
+Specified \Meta{command} put out last when referece command used. The default value is |{}|.
+\end{description}
+%
+Parameters which do not set explicitly will not be changed.
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/wtref/wtref.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/wtref/wtref.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/wtref/wtref.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/wtref/wtref.sty	2016-10-30 21:48:35 UTC (rev 42388)
@@ -0,0 +1,166 @@
+%
+% wtref.sty
+%
+
+%%%% package declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{wtref}[2016/08/09 v0.3.1]
+\def\wtrf at pkgname{WTRef}
+\RequirePackage{xkeyval}
+
+%%%% error messages
+\def\wtrf at info{\PackageInfo\wtrf at pkgname}
+\def\wtrf at error{\PackageError\wtrf at pkgname}
+
+%%%% new ifs and new counts
+\newif\if at wtrf@use at scope@
+\newif\if at wtrf@use at namespace@
+\newif\if at wtrf@set at namespace@
+\newcount\wtrf at tempcnta
+\newcount\wtrf at tempcntb
+
+%%%% utility
+\def\wtrf at name@def#1{\expandafter\def\csname #1\endcsname}
+\def\wtrf at name@edef#1{\expandafter\edef\csname #1\endcsname}
+\def\wtrf at name@use#1{\csname #1\endcsname}
+\def\wtrf at if@option at exist{\@ifnextchar[}
+\def\wtrf at if@reftype at not@exist#1{\@ifundefined{wtrf@#1 at namespace}}
+
+%%%% check commands
+\def\wtrf at check@counter#1{%
+  \@ifundefined{c@#1}
+    {\wtrf at error{Undefined LaTeX counter '#1'}}
+    {}}
+\def\wtrf at check@command#1{%
+  \@ifundefined{#1}
+    {}
+    {\wtrf at info{Redefining \expandafter\string\csname#1\endcsname}}}
+
+%%%% trimming spaces
+\define at cmdkeys[wtrf]{ts}[wtrf at temp@]{ref at name, label}
+\def\wtrf at set@ref at name#1{\setkeys[wtrf]{ts}{ref at name=#1}}
+\def\wtrf at set@label#1{\setkeys[wtrf]{ts}{label=#1}}
+
+%%%% define keys for new ref
+\define at key[wtrf]{ns}{namespace}{%
+  \@wtrf at set@namespace at true
+  \def\wtrf at namespace@temp{#1}}
+\define at key[wtrf]{ns}{nonamespace}[\@empty]{%
+  \@wtrf at use@namespace at false}
+\define at key[wtrf]{ns}{scope}{%
+  \wtrf at check@counter{#1}%
+  \@wtrf at use@scope at true
+  \def\wtrf at scope@temp{#1}}
+
+%%%% new ref
+\newcommand{\newref}{%
+  \let\wtrf at namespace@temp\@empty
+  \@wtrf at use@namespace at true
+  \@wtrf at set@namespace at false
+  \@wtrf at use@scope at false
+  \wtrf at if@option at exist
+    {\wtrf at set@namespace}
+    {\wtrf@@newref}}
+\@onlypreamble\newref
+\def\wtrf at set@namespace[#1]{%
+  \setkeys[wtrf]{ns}{#1}%
+  \wtrf@@newref}
+\def\wtrf@@newref#1{%
+  \@for\wtrf at member:=#1\do{%
+    \expandafter\wtrf at set@ref at name\expandafter{\wtrf at member}%
+    \expandafter\wtrf at newref@pre\expandafter{\wtrf at temp@ref at name}}}
+\def\wtrf at newref@pre#1{%
+  \wtrf at if@reftype at not@exist{#1}%
+    {\wtrf at newref{#1}}
+    {\wtrf at error{ref type '#1' already exists}}}
+\def\wtrf at newref#1{%
+  % define namespace
+  \if at wtrf@use at namespace@
+    \ifx\wtrf at namespace@temp\@empty
+      \@wtrf at set@namespace at false
+      \def\wtrf at namespace@temp{#1}%
+    \fi
+    \wtrf at name@edef{wtrf@#1 at namespace}{\wtrf at namespace@temp:}%
+  \else
+    \wtrf at name@def{wtrf@#1 at namespace}{}%
+  \fi
+  % define scope
+  \if at wtrf@use at scope@
+    \wtrf at name@edef{wtrf@#1 at scope@cmd}{the\wtrf at scope@temp}%
+    \wtrf at name@def{wtrf@#1 at scope}{\csname\wtrf at name@use{wtrf@#1 at scope@cmd}\endcsname:}%
+  \else
+    \wtrf at name@def{wtrf@#1 at scope}{}%
+  \fi
+  % define keys for setting styles
+  \define at key[wtrf]{#1 at style}{refcmd}{\wtrf at name@def{wtrf@#1 at refcmd}####1{##1}}%
+  \define at key[wtrf]{#1 at style}{last sep}[\wtrf at name@use{wtrf@#1 at sep}]{%
+    \wtrf at name@def{wtrf@#1 at last@sep}{##1}}%
+  \define at cmdkeys[wtrf]{#1 at style}[wtrf@#1@]{sep, prefix, suffix}%
+  % default key settings
+  \setkeys[wtrf]{#1 at style}{%
+    refcmd=\ref{##1},
+    sep={,\space}, last sep,
+    prefix={}, suffix={}}%
+  % define label command
+  \wtrf at check@command{#1label}%
+  \wtrf at name@def{#1label}{\protect\wtrf at name@use{wtrf@#1label}}
+  \wtrf at name@def{wtrf@#1label}##1{%
+    \label{\wtrf at name@use{wtrf@#1 at namespace}\wtrf at name@use{wtrf@#1 at scope}##1}}%
+  % define ref command
+  \wtrf at check@command{#1ref}%
+  \wtrf at name@def{#1ref}{\protect\wtrf at name@use{wtrf@#1ref}}
+  \wtrf at name@def{wtrf@#1ref}{%
+    \wtrf at if@option at exist
+      {\wtrf at name@use{wtrf@#1ref at with@option}}
+      {\def\wtrf at scope{\wtrf at name@use{wtrf@#1 at scope}}\wtrf at name@use{wtrf@#1 at print}}}%
+  % when option exist
+  \if at wtrf@use at scope@
+    \wtrf at name@def{wtrf@#1ref at with@option}[##1]##2{%
+      \def\wtrf at scope{##1:}%
+      \wtrf at name@use{wtrf@#1 at print}{##2}}%
+  \else
+    \wtrf at name@def{wtrf@#1ref at with@option}[##1]##2{%
+      \let\wtrf at scope\@empty
+      \wtrf at name@use{wtrf@#1 at print}{##2}}%
+  \fi
+  % print refs
+  \wtrf at name@def{wtrf@#1 at print}##1{%
+    \wtrf at tempcnta\z@
+    \@for\wtrf at member:=##1\do{\advance\wtrf at tempcnta\@ne}%
+    \ifnum\wtrf at tempcnta<\tw@
+      \wtrf at name@use{wtrf@#1 at prefix}%
+      \wtrf at name@use{wtrf@#1 at refcmd}{%
+        \wtrf at name@use{wtrf@#1 at namespace}\wtrf at scope##1}%
+      \wtrf at name@use{wtrf@#1 at suffix}%
+    \else
+      \wtrf at tempcntb\@ne
+      \advance\wtrf at tempcnta\m at ne
+      \wtrf at name@use{wtrf@#1 at prefix}%
+      \@for\wtrf at member:=##1\do{%
+        \expandafter\wtrf at set@label\expandafter{\wtrf at member}%
+        \wtrf at name@use{wtrf@#1 at refcmd}{%
+          \wtrf at name@use{wtrf@#1 at namespace}\wtrf at scope\wtrf at temp@label}%
+        \ifnum\wtrf at tempcnta>\wtrf at tempcntb
+          \wtrf at name@use{wtrf@#1 at sep}%
+        \else\ifnum\wtrf at tempcnta=\wtrf at tempcntb
+          \wtrf at name@use{wtrf@#1 at last@sep}%
+        \fi\fi
+        \advance\wtrf at tempcntb\@ne}%
+      \wtrf at name@use{wtrf@#1 at suffix}%
+    \fi}%
+  % reset \wtrf at namespace@temp
+  \if at wtrf@set at namespace@\else
+    \let\wtrf at namespace@temp\@empty
+  \fi}
+
+%%%% set ref style
+\newcommand{\setrefstyle}[2]{%
+  \@for\wtrf at member:=#1\do{%
+    \expandafter\wtrf at set@ref at name\expandafter{\wtrf at member}%
+    \expandafter\wtrf at setrefstyle\expandafter{\wtrf at temp@ref at name}{#2}}}
+\def\wtrf at setrefstyle#1#2{%
+  \wtrf at if@reftype at not@exist{#1}%
+    {\wtrf at error{ref type '#1' does not exist}}
+    {\setkeys[wtrf]{#1 at style}{#2}}}
+
+%% EOF


Property changes on: trunk/Master/texmf-dist/tex/latex/wtref/wtref.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-10-30 21:47:55 UTC (rev 42387)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-10-30 21:48:35 UTC (rev 42388)
@@ -637,7 +637,7 @@
   wadalab wallpaper warning warpcol was wasy wasy2-ps wasysym webguide
     widetable williams withargs
     wnri wnri-latex wordcount wordlike
-    wrapfig wsemclassic wsuipa
+    wrapfig wsemclassic wsuipa wtref
   xargs xassoccnt xcharter xcite xcjk2uni xcntperchap
     xcolor xcolor-material xcolor-solarized
     xcomment xcookybooky xdoc xduthesis

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2016-10-30 21:47:55 UTC (rev 42387)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2016-10-30 21:48:35 UTC (rev 42388)
@@ -1087,6 +1087,7 @@
 depend wordcount
 depend wordlike
 depend wrapfig
+depend wtref
 depend xargs
 depend xassoccnt
 depend xcntperchap

Added: trunk/Master/tlpkg/tlpsrc/wtref.tlpsrc
===================================================================


More information about the tex-live-commits mailing list