summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wtref
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-06-16 03:02:40 +0000
committerNorbert Preining <norbert@preining.info>2020-06-16 03:02:40 +0000
commit305bf45bf758ea76ec5be2a737bd8eb491f68921 (patch)
treea0d6ad7bdfc7a258d831c6dd746484263ff66b10 /macros/latex/contrib/wtref
parent539648a9305d6107a588ecdff34b5cdce48fb930 (diff)
CTAN sync 202006160302
Diffstat (limited to 'macros/latex/contrib/wtref')
-rw-r--r--macros/latex/contrib/wtref/LICENSE2
-rw-r--r--macros/latex/contrib/wtref/README.md10
-rw-r--r--macros/latex/contrib/wtref/doc/wtref-ja.pdfbin120211 -> 0 bytes
-rw-r--r--macros/latex/contrib/wtref/wtref-ja.pdfbin0 -> 117348 bytes
-rw-r--r--macros/latex/contrib/wtref/wtref-ja.tex (renamed from macros/latex/contrib/wtref/doc/wtref-ja.tex)70
-rw-r--r--macros/latex/contrib/wtref/wtref.pdf (renamed from macros/latex/contrib/wtref/doc/wtref.pdf)bin220864 -> 226945 bytes
-rw-r--r--macros/latex/contrib/wtref/wtref.sty155
-rw-r--r--macros/latex/contrib/wtref/wtref.tex (renamed from macros/latex/contrib/wtref/doc/wtref.tex)26
8 files changed, 137 insertions, 126 deletions
diff --git a/macros/latex/contrib/wtref/LICENSE b/macros/latex/contrib/wtref/LICENSE
index 0dddce08b7..a089635538 100644
--- a/macros/latex/contrib/wtref/LICENSE
+++ b/macros/latex/contrib/wtref/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2016-2017 Takuto ASAKURA (wtsnjp)
+Copyright 2016-2020 Takuto ASAKURA (wtsnjp)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/macros/latex/contrib/wtref/README.md b/macros/latex/contrib/wtref/README.md
index b965038d6b..d2af713e5f 100644
--- a/macros/latex/contrib/wtref/README.md
+++ b/macros/latex/contrib/wtref/README.md
@@ -1,17 +1,17 @@
-# WTRef Package (v0.3.2)
+# WTRef Package (v0.4.0)
-WTRef package extend cross-reference system of LaTeX2e and introduce concepts of namespace and scope. This package is a part of the WT Series.
+WTRef package is a small extension for LaTeX2e's cross-reference system. It introduces concepts of namespace and scope. This package is a part of the WT Series.
## System Requirements
* TeX format: LaTeX2e
* TeX engine: any engine
* Document class: any class
-* Prerequisite package: xkeyval
+* Prerequisite package: xparse and xkeyval
## Installation
-Move wtref.sty file to $TEXMF/tex/la­tex/wtref.
+Move wtref.sty file to $TEXMF/tex/latex/wtref.
## Documents
@@ -23,4 +23,4 @@ This package released under [the MIT license](./LICENSE).
---
-Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp)) \ No newline at end of file
+Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp))
diff --git a/macros/latex/contrib/wtref/doc/wtref-ja.pdf b/macros/latex/contrib/wtref/doc/wtref-ja.pdf
deleted file mode 100644
index 8d216eab71..0000000000
--- a/macros/latex/contrib/wtref/doc/wtref-ja.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/wtref/wtref-ja.pdf b/macros/latex/contrib/wtref/wtref-ja.pdf
new file mode 100644
index 0000000000..587f6a731f
--- /dev/null
+++ b/macros/latex/contrib/wtref/wtref-ja.pdf
Binary files differ
diff --git a/macros/latex/contrib/wtref/doc/wtref-ja.tex b/macros/latex/contrib/wtref/wtref-ja.tex
index e8e8eaa0cc..87e1189380 100644
--- a/macros/latex/contrib/wtref/doc/wtref-ja.tex
+++ b/macros/latex/contrib/wtref/wtref-ja.tex
@@ -1,14 +1,18 @@
+%#!uplatex
\documentclass[a4paper,uplatex]{jsarticle}
\usepackage{otf}
\usepackage{enumitem}
\usepackage{shortvrb}
+\usepackage[verb]{bxghost}
+
\MakeShortVerb{\|}
-\newcommand{\PkgName}{\textsf{WTRef}}
+\newcommand{\PkgName}[1]{\textsf{#1}}
+\newcommand{\ThisPkg}{\PkgName{WTRef}}
\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$}
\newenvironment{syntax}{\begin{quote}\small}{\end{quote}}
-\title{\PkgName パッケージ (v0.3.2)}
+\title{\ThisPkg パッケージ (v0.4.0)}
\author{朝倉卓人 (wtsnjp)}
\begin{document}
@@ -17,26 +21,26 @@
\begin{abstract}
WTシリーズは著者が\LaTeX 文書作成にあたってよく利用するマクロを集めたものである.
-\PkgName パッケージはこのWTシリーズを構成するパッケージの1つであり,\LaTeX オリジナルの
+\ThisPkg パッケージはこのWTシリーズを構成するパッケージの1つであり,\LaTeX オリジナルの
相互参照機能を拡張してスコープの指定と名前空間の分離,参照形式の柔軟な指定を可能にする.
-サポート対象は任意の\TeX エンジンと\LaTeXe の組み合わせで,動作には\textsf{xkeyval}
-パッケージが必要である.
+サポート対象は任意の\TeX エンジンと\LaTeXe の組み合わせで,動作には\PkgName{xparse},
+\PkgName{xkeyval}パッケージが必要である.
\end{abstract}
\section{動作要件}
-\PkgName パッケージの動作要件は以下の通りである.
+\ThisPkg パッケージの動作要件は以下の通りである.
%
\begin{itemize}
\item \TeX エンジン:任意
\item \TeX フォーマット:\LaTeXe
\item ドキュメントクラス:任意
-\item 依存パッケージ:\textsf{xkeyval}
+\item 依存パッケージ:\PkgName{xparse}, \PkgName{xkeyval}
\end{itemize}
\section{パッケージ読み込み}
-読み込みには |\usepackage| 命令を用いる.オプションは存在しない.
+読み込みには|\usepackage|命令を用いる.オプションは存在しない.
%
\begin{syntax}
|\usepackage{wtref}|
@@ -46,7 +50,7 @@ WTシリーズは著者が\LaTeX 文書作成にあたってよく利用する
\subsection{相互参照命令の新設}
-|\newref| 命令を用いて相互参照に用いる2つの命令を新設することができる.この命令は
+|\newref|命令を用いて相互参照に用いる2つの命令を新設することができる.この命令は
プリアンブルでのみ使用可能である.
%
\begin{syntax}
@@ -58,9 +62,9 @@ WTシリーズは著者が\LaTeX 文書作成にあたってよく利用する
あってはならない.なお\Meta{ref types}の先頭・末尾およびカンマ前後の連続する空白は
すべて無視される.
-|\newref| 命令は指定した\Meta{ref type}に応じて |\|\Meta{ref type}|label|,
-|\|\Meta{ref type}|ref| という形をもつ,新しい2つの命令を定義する.ここで前者の命令を
-\textbf{ラベル命令},後者の命令を\textbf{参照命令}と呼ぶことにする.|\newref| 命令は同名の
+|\newref|命令は指定した\Meta{ref type}に応じて|\|\Meta{ref type}|label|,
+|\|\Meta{ref type}|ref|という形をもつ,新しい2つの命令を定義する.ここで前者の命令を
+\textbf{ラベル命令},後者の命令を\textbf{参照命令}と呼ぶことにする.|\newref|命令は同名の
命令が既に存在していても,その定義を上書きするので\Meta{ref type}は注意して選ぶ必要がある.
また,\Meta{options}には以下の内容をkey-valueリストで指定可能である:
@@ -93,8 +97,8 @@ WTシリーズは著者が\LaTeX 文書作成にあたってよく利用する
\subsubsection{機能と使い方}
-ラベル命令はラベルを付けるときに用いる.使い方は\LaTeX の |\label| 命令とまったく同様である.
-以下にラベル命令の例 |\exlabel| を用いるときの書式を示しておく.
+ラベル命令はラベルを付けるときに用いる.使い方は\LaTeX の|\label|命令とまったく同様である.
+以下にラベル命令の例|\exlabel|を用いるときの書式を示しておく.
%
\begin{syntax}
|\exlabel{|\Meta{label}|}|
@@ -111,61 +115,61 @@ WTシリーズは著者が\LaTeX 文書作成にあたってよく利用する
\subsection{参照命令}
参照命令は対応するラベル命令によってラベル付けされた番号を,指定した書式で印字するための
-命令である.例として |\exref| の使い方を以下に示す.
+命令である.例として|\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}に参照先のスコープに対応する``|\the|\Meta{counter}''の出力を直接記入する
+ことでスコープの範囲外からラベルを参照することが可能である.なお,スコープ機能が無効
+(|\newref|によって相互参照命令を定義する際に\Meta{options}で|scope|キーを指定しなかった
場合)のときは,\Meta{the scope}は常に無視される.
また,引数にはカンマ区切りで複数の参照先ラベルを指定することが可能である.
\Meta{label list}の先頭・末尾およびカンマ前後の連続する空白はすべて無視される.
-複数のラベルを指定した場合,デフォルトでは該当する番号がカンマ区切りで出力される.この出力書式
-は後述する参照書式変更命令 |\setrefstyle| を用いて柔軟にカスタマイズすることができる.
+複数のラベルを指定した場合,デフォルトでは該当する番号がカンマ区切りで出力される.
+この出力書式は後述する参照書式変更命令|\setrefstyle|を用いて柔軟にカスタマイズすることが
+できる.
\section{参照書式変更命令}
-|\setrefstyle| 命令を用いると,参照命令による出力を柔軟にカスタマイズすることができる.
-最初に |\setrefstyle| 命令の書式を示しておく.
+|\setrefstyle|命令を用いると,参照命令による出力を柔軟にカスタマイズすることができる.
+最初に|\setrefstyle|命令の書式を示しておく.
%
\begin{syntax}
|\setrefstyle{|\Meta{ref types}|}{|\Meta{options}|}|
\end{syntax}
これにより\Meta{ref types}中に含まれる\Meta{ref type}に対応する参照命令が出力する内容の
-書式を変更できる.この |\setrefstyle| 命令はプリアンブルに限らず\LaTeX 文書ソース中全域で
-使用可能であり,設定の有効範囲は |{| や |}| によるブロックの制御を受ける.
+書式を変更できる.この|\setrefstyle|命令はプリアンブルに限らず\LaTeX 文書ソース中全域で
+使用可能であり,設定の有効範囲は|{|や|}|によるブロックの制御を受ける.
\Meta{options}には以下の内容をkey-valueリストで指定可能である:
%
\begin{description}[font=\normalfont]
\item[|refcmd=|\Meta{command}]
\Meta{label list}に与えたラベルの数だけ,指定した\Meta{command}が繰り返し実行・印字される.
-\Meta{command}中に記入された |#1| は適切に整形されたラベル名に置換される.
-規定値は |\ref{#1}|.
+\Meta{command}中に記入された|#1|は適切に整形されたラベル名に置換される.規定値は|\ref{#1}|.
%
\item[|sep=|\Meta{command}]
-\Meta{label list}に3つ以上のラベルが記入されているときに,|refcmd| の各出力の間に印字
-する区切りの内容を指定する.ただし,最後の区切りは |last sep| に指定した値となる.
-規定値は |{,\space}|.
+\Meta{label list}に3つ以上のラベルが記入されているときに,|refcmd|の各出力の間に印字
+する区切りの内容を指定する.ただし,最後の区切りは|last sep|に指定した値となる.
+規定値は|{,\space}|.
%
\item[|last sep|(|=|\Meta{command})]
\Meta{label list}に複数のラベルが記入されている際に出力される,最後の区切りを指定する.
-|=| 以降を記入せず,単に |last sep| と指定した場合,最後の区切りには |sep| の値が適用される.
-規定値は値指定なし(つまり |sep| の値に従属).
+|=|以降を記入せず,単に|last sep|と指定した場合,最後の区切りには|sep|の値が適用される.
+規定値は値指定なし(つまり|sep|の値に従属).
%
\item[|prefix=|\Meta{command}]
参照命令を使用したとき,最初に実行・印字される内容を指定する.
-規定値は |{}|.
+規定値は|{}|.
%
\item[|suffix=|\Meta{command}]
参照命令を使用したとき,最後に実行・印字される内容を指定する.
-規定値は |{}|.
+規定値は|{}|.
\end{description}
%
これらの設定は,明示的に指定したもの以外はそれ以前の設定がそのまま引き継がれる.
diff --git a/macros/latex/contrib/wtref/doc/wtref.pdf b/macros/latex/contrib/wtref/wtref.pdf
index 4787b42025..0022ff251b 100644
--- a/macros/latex/contrib/wtref/doc/wtref.pdf
+++ b/macros/latex/contrib/wtref/wtref.pdf
Binary files differ
diff --git a/macros/latex/contrib/wtref/wtref.sty b/macros/latex/contrib/wtref/wtref.sty
index a196692ae3..856852d69d 100644
--- a/macros/latex/contrib/wtref/wtref.sty
+++ b/macros/latex/contrib/wtref/wtref.sty
@@ -1,12 +1,19 @@
-%
-% wtref.sty
-%
+%%
+%% This is file `wtref.sty'.
+%%
+%% Copyright 2016-2020 Takuto ASAKURA (wtsnjp)
+%% GitHub: https://github.com/wtsnjp
+%% Twitter: @wtsnjp
+%%
+%% This package is distributed under the MIT License.
+%%
% Package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{wtref}[2017/01/17 v0.3.2 Extend cross-reference system]
+\ProvidesPackage{wtref}
+ [2020/06/15 v0.4.0 A small extension for LaTeX2e's cross-referencing]
\def\wtrf@pkgname{WTRef}
-\RequirePackage{xkeyval}
+\RequirePackage{xparse,xkeyval}
% Messages
\def\wtrf@info{\PackageInfo\wtrf@pkgname}
@@ -17,33 +24,37 @@
\newif\if@wtrf@use@scope@
\newif\if@wtrf@use@namespace@
\newif\if@wtrf@set@namespace@
-\newcount\wtrf@tempcnta
-\newcount\wtrf@tempcntb
% Utilities
\def\wtrf@name@def#1{\expandafter\def\csname #1\endcsname}
\def\wtrf@name@edef#1{\expandafter\edef\csname #1\endcsname}
\def\wtrf@name@use#1{\csname #1\endcsname}
-\def\wtrf@if@option@exists{\@ifnextchar[}
\def\wtrf@if@reftype@not@exists#1{\@ifundefined{wtrf@#1@namespace}}
% Check commands
\def\wtrf@check@counter#1{%
\@ifundefined{c@#1}{%
\wtrf@error
- {Undefined LaTeX counter '#1'}
+ {Undefined LaTeX counter `#1'}
{Check the spelling or declare new LaTeX counter}%
}{}}
\def\wtrf@check@command#1{%
\@ifundefined{#1}{}{% else
- \wtrf@warn{Redefining \expandafter\string\csname#1\endcsname}}}
+ \wtrf@warn{Redefining \expandafter\string\csname #1\endcsname}}}
% Trimming spaces
-\def\wtrf@inner@setkeys#1{\setkeys[wtrf]{inner}{key=#1}}
-\def\wtrf@trimming@spaces#1{%
- \define@key[wtrf]{inner}{key}{\def#1{##1}}%
- \expandafter\wtrf@inner@setkeys\expandafter{#1}%
- \disable@keys[wtrf]{inner}{key}}
+\@tempcnta=\catcode`\Q
+\catcode`\Q=3
+\def\wtrf@trim@spaces#1{%
+ \romannumeral-`\q\wtrf@trim@trim@\noexpand#1Q Q}
+\long\def\wtrf@trim@trim@#1 Q{\wtrf@trim@trim@@#1Q}
+\long\def\wtrf@trim@trim@@#1Q#2{#1}
+\catcode`\Q=\@tempcnta
+\def\wtrf@trim@spaces@noexp#1{%
+ \unexpanded\expandafter\expandafter\expandafter
+ {\wtrf@trim@spaces{#1}}}
+\def\wtrf@trim@spaces@in#1{%
+ \edef#1{\expandafter\wtrf@trim@spaces@noexp\expandafter{#1}}}
% Define keys for \newref command
\define@key[wtrf]{ns}{namespace}{%
@@ -56,33 +67,29 @@
\@wtrf@use@scope@true
\def\wtrf@scope@temp{#1}}
-% Define \newref command
-\newcommand{\newref}{%
+% Defining the \newref command
+\NewDocumentCommand{\newref}{om}{%
\let\wtrf@namespace@temp\@empty
\@wtrf@use@namespace@true
\@wtrf@set@namespace@false
\@wtrf@use@scope@false
- \wtrf@if@option@exists
- {\wtrf@set@namespace}
- {\wtrf@@newref}}
+ \IfNoValueF{#1}{\setkeys[wtrf]{ns}{#1}}%
+ \wtrf@@newref{#2}}
\@onlypreamble\newref
-\def\wtrf@set@namespace[#1]{%
- \setkeys[wtrf]{ns}{#1}%
- \wtrf@@newref}
\def\wtrf@@newref#1{%
\@for\wtrf@temp@ref@type:=#1\do{%
- \wtrf@trimming@spaces\wtrf@temp@ref@type
+ \wtrf@trim@spaces@in\wtrf@temp@ref@type
\expandafter\wtrf@newref@pre\expandafter{\wtrf@temp@ref@type}}}
\def\wtrf@newref@pre#1{%
\wtrf@if@reftype@not@exists{#1}{%
\wtrf@newref{#1}%
}{% else
\wtrf@error
- {ref type '#1' already exists}
+ {ref type `#1' already exists}
{You can declare ref type only once}%
}}
\def\wtrf@newref#1{%
- % define namespace
+ % namespace
\if@wtrf@use@namespace@
\ifx\wtrf@namespace@temp\@empty
\@wtrf@set@namespace@false
@@ -92,7 +99,7 @@
\else
\wtrf@name@def{wtrf@#1@namespace}{}%
\fi
- % define scope
+ % scope
\if@wtrf@use@scope@
\wtrf@name@edef{wtrf@#1@scope@cmd}{the\wtrf@scope@temp}%
\wtrf@name@def{wtrf@#1@scope}{\csname\wtrf@name@use{wtrf@#1@scope@cmd}\endcsname:}%
@@ -109,71 +116,67 @@
refcmd=\ref{##1},
sep={,\space}, last sep,
prefix={}, suffix={}}%
- % define label command
+ % the \label-like command
\wtrf@check@command{#1label}%
- \wtrf@name@def{#1label}{\protect\wtrf@name@use{wtrf@#1label}}
- \wtrf@name@def{wtrf@#1label}##1{%
+ \expandafter\DeclareExpandableDocumentCommand\csname #1label\endcsname{m}{%
\label{\wtrf@name@use{wtrf@#1@namespace}\wtrf@name@use{wtrf@#1@scope}##1}}%
- % define ref command
+ % the \ref-like command
\wtrf@check@command{#1ref}%
- \wtrf@name@def{#1ref}{\protect\wtrf@name@use{wtrf@#1ref}}
- \wtrf@name@def{wtrf@#1ref}{%
- \wtrf@if@option@exists
- {\wtrf@name@use{wtrf@#1ref@with@option}}
- {\def\wtrf@scope{\wtrf@name@use{wtrf@#1@scope}}\wtrf@name@use{wtrf@#1@print}}}%
- % when option exists
- \if@wtrf@use@scope@
- \wtrf@name@def{wtrf@#1ref@with@option}[##1]##2{%
- \def\wtrf@scope{##1:}%
- \wtrf@name@use{wtrf@#1@print}{##2}}%
- \else
- \wtrf@name@def{wtrf@#1ref@with@option}[##1]##2{%
- \let\wtrf@scope\@empty
- \wtrf@name@use{wtrf@#1@print}{##2}}%
- \fi
- % print refs
- \wtrf@name@def{wtrf@#1@print}##1{%
- \wtrf@tempcnta\z@
- \@for\wtrf@member:=##1\do{\advance\wtrf@tempcnta\@ne}%
- \ifnum\wtrf@tempcnta<\tw@
- \wtrf@name@use{wtrf@#1@prefix}%
- \wtrf@name@use{wtrf@#1@refcmd}{%
- \wtrf@name@use{wtrf@#1@namespace}\wtrf@scope##1}%
- \wtrf@name@use{wtrf@#1@suffix}%
+ \expandafter\DeclareExpandableDocumentCommand\csname #1ref\endcsname{om}{%
+ \if@wtrf@use@scope@
+ \IfNoValueTF{##1}
+ {\wtrf@name@use{wtrf@#1ref}{\wtrf@name@use{wtrf@#1@scope}}{##2}}
+ {\wtrf@name@use{wtrf@#1ref}{##1:}{##2}}%
\else
- \wtrf@tempcntb\@ne
- \advance\wtrf@tempcnta\m@ne
- \wtrf@name@use{wtrf@#1@prefix}%
- \@for\wtrf@temp@label:=##1\do{%
- \wtrf@trimming@spaces\wtrf@temp@label
- \wtrf@name@use{wtrf@#1@refcmd}{%
- \wtrf@name@use{wtrf@#1@namespace}\wtrf@scope\wtrf@temp@label}%
- \ifnum\wtrf@tempcnta>\wtrf@tempcntb
- \wtrf@name@use{wtrf@#1@sep}%
- \else\ifnum\wtrf@tempcnta=\wtrf@tempcntb
- \wtrf@name@use{wtrf@#1@last@sep}%
- \fi\fi
- \advance\wtrf@tempcntb\@ne}%
- \wtrf@name@use{wtrf@#1@suffix}%
- \fi}%
+ \wtrf@name@use{wtrf@#1ref}{}{##2}%
+ \fi}
+ % construction
+ \wtrf@name@def{wtrf@#1ref}##1##2{%
+ \wtrf@name@use{wtrf@#1@prefix}%
+ \wtrf@construct##2,\wtrf@qmark\wtrf@nil{##1}{#1}%
+ \wtrf@name@use{wtrf@#1@suffix}}
% reset \wtrf@namespace@temp
\if@wtrf@set@namespace@\else
\let\wtrf@namespace@temp\@empty
\fi}
-% Define \setrefstyle command
-\newcommand{\setrefstyle}[2]{%
+% The constructer for \ref-like commands
+\def\wtrf@qmark{\wtrf@qmark}
+\def\wtrf@head#1#2\wtrf@nil{#1}
+%% \wtrf@construct<head>,<rest>\wtrf@nil{<scope>}{<ref type>}
+\def\wtrf@construct#1,#2\wtrf@nil#3#4{%
+ \wtrf@name@use{wtrf@#4@refcmd}{%
+ \wtrf@name@use{wtrf@#4@namespace}#3\wtrf@trim@spaces@noexp{#1}}%
+ \expandafter\ifx\wtrf@head#2\wtrf@nil\wtrf@qmark\else
+ \wtrf@construct@#2,\wtrf@qmark\wtrf@nil{#3}{#4}%
+ \fi}
+\def\wtrf@construct@#1,#2\wtrf@nil#3#4{%
+ \expandafter\ifx\wtrf@head#2\wtrf@nil\wtrf@qmark
+ \wtrf@name@use{wtrf@#4@last@sep}%
+ \wtrf@name@use{wtrf@#4@refcmd}{%
+ \wtrf@name@use{wtrf@#4@namespace}#3\wtrf@trim@spaces@noexp{#1}}%
+ \else
+ \wtrf@name@use{wtrf@#4@sep}%
+ \wtrf@name@use{wtrf@#4@refcmd}{%
+ \wtrf@name@use{wtrf@#4@namespace}#3\wtrf@trim@spaces@noexp{#1}}%
+ \wtrf@construct@#2,\wtrf@qmark\wtrf@nil{#3}{#4}%
+ \fi}
+
+% Defining \setrefstyle command
+\NewDocumentCommand{\setrefstyle}{mm}{%
\@for\wtrf@temp@ref@type:=#1\do{%
- \wtrf@trimming@spaces\wtrf@temp@ref@type
+ \wtrf@trim@spaces@in\wtrf@temp@ref@type
\expandafter\wtrf@setrefstyle\expandafter{\wtrf@temp@ref@type}{#2}}}
\def\wtrf@setrefstyle#1#2{%
\wtrf@if@reftype@not@exists{#1}{%
\wtrf@error
- {ref type '#1' does not exist}
- {You can declare ref type only once}%
+ {ref type `#1' does not exist}
+ {Declare ref type before using it}%
}{% else
\setkeys[wtrf]{#1-style}{#2}%
}}
-% EOF
+% All done
\endinput
+
+%% EOF
diff --git a/macros/latex/contrib/wtref/doc/wtref.tex b/macros/latex/contrib/wtref/wtref.tex
index 02e482ac7f..bfd9bfa913 100644
--- a/macros/latex/contrib/wtref/doc/wtref.tex
+++ b/macros/latex/contrib/wtref/wtref.tex
@@ -1,13 +1,16 @@
+%#!pdflatex
\documentclass[a4paper]{article}
\usepackage{enumitem}
\usepackage{shortvrb}
+
\MakeShortVerb{\|}
-\newcommand{\PkgName}{\textsf{WTRef}}
+\newcommand{\PkgName}[1]{\textsf{#1}}
+\newcommand{\ThisPkg}{\PkgName{WTRef}}
\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$}
\newenvironment{syntax}{\begin{quote}\small}{\end{quote}}
-\title{{\PkgName} Package (v0.3.2)}
+\title{The {\ThisPkg} Package (v0.4.0)}
\author{Takuto ASAKURA (wtsnjp)}
\begin{document}
@@ -15,27 +18,28 @@
\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.
+WT Series collects macros which are useful to create {\LaTeX} documents.
+{\ThisPkg} package is a part of this WT Series that extends cross-reference
+system of {\LaTeX}. It makes enable to divide namespace and scope, further
+arrows users to customise reference formats. {\LaTeXe} on any kind of {\TeX}
+engine is supported. The package requires Package \PkgName{xparse} and
+\PkgName{xkeyval}.
\end{abstract}
\section{System Requirements}
-System requirements of {\PkgName} are shown bellow:
+System requirements of {\ThisPkg} are shown bellow:
%
\begin{itemize}
\item {\TeX} engine: any engine
\item {\TeX} format: \LaTeXe
\item Document class: any class
-\item Required package: \textsf{xkeyval}
+\item Required packages: \PkgName{xparse} and \PkgName{xkeyval}
\end{itemize}
-\section{Loading the {\PkgName} Package}
+\section{Loading the {\ThisPkg} Package}
-To use {\PkgName} package, load \texttt{wtref.sty} file with |\usepackage| command in preamble.
+To use {\ThisPkg} package, load \texttt{wtref.sty} file with |\usepackage| command in preamble.
No package option is available.
%
\begin{syntax}