summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wtref
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-12-25 03:00:43 +0000
committerNorbert Preining <norbert@preining.info>2023-12-25 03:00:43 +0000
commit04394251f8dab08ff9ce469f57fd910ae79ecf3b (patch)
tree7d5e1b982233557d1191afd1d85791c9edc2c6b2 /macros/latex/contrib/wtref
parent4730d615ef9f92ac5b55492b0eadad6023d991e0 (diff)
CTAN sync 202312250300
Diffstat (limited to 'macros/latex/contrib/wtref')
-rw-r--r--macros/latex/contrib/wtref/LICENSE2
-rw-r--r--macros/latex/contrib/wtref/README.md8
-rw-r--r--macros/latex/contrib/wtref/wtref-ja.pdfbin117348 -> 117157 bytes
-rw-r--r--macros/latex/contrib/wtref/wtref-ja.tex2
-rw-r--r--macros/latex/contrib/wtref/wtref.pdfbin226945 -> 222572 bytes
-rw-r--r--macros/latex/contrib/wtref/wtref.sty14
-rw-r--r--macros/latex/contrib/wtref/wtref.tex182
7 files changed, 108 insertions, 100 deletions
diff --git a/macros/latex/contrib/wtref/LICENSE b/macros/latex/contrib/wtref/LICENSE
index a089635538..b9f02ad78f 100644
--- a/macros/latex/contrib/wtref/LICENSE
+++ b/macros/latex/contrib/wtref/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright 2016-2020 Takuto ASAKURA (wtsnjp)
+Copyright 2016-2023 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 d2af713e5f..0eb5718de0 100644
--- a/macros/latex/contrib/wtref/README.md
+++ b/macros/latex/contrib/wtref/README.md
@@ -1,6 +1,6 @@
-# WTRef Package (v0.4.0)
+# Package WTRef (v1.0.0)
-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.
+The WTRef package is a small extension for the LaTeX cross-reference system. It introduces concepts of namespace and scope. This package is part of the WT bundle.
## System Requirements
@@ -15,7 +15,7 @@ Move wtref.sty file to $TEXMF/tex/latex/wtref.
## Documents
-Documents for this pacakge are available in [English](http://mirrors.ctan.org/macros/latex/contrib/wtref/wtref.pdf) and [Japanese](http://mirrors.ctan.org/macros/latex/contrib/wtref/wtref-ja.pdf).
+Documents for this package are available in [English](http://mirrors.ctan.org/macros/latex/contrib/wtref/wtref.pdf) and [Japanese](http://mirrors.ctan.org/macros/latex/contrib/wtref/wtref-ja.pdf).
## License
@@ -23,4 +23,4 @@ This package released under [the MIT license](./LICENSE).
---
-Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp))
+Takuto Asakura ([wtsnjp](https://twitter.com/wtsnjp))
diff --git a/macros/latex/contrib/wtref/wtref-ja.pdf b/macros/latex/contrib/wtref/wtref-ja.pdf
index 587f6a731f..77f026f670 100644
--- a/macros/latex/contrib/wtref/wtref-ja.pdf
+++ b/macros/latex/contrib/wtref/wtref-ja.pdf
Binary files differ
diff --git a/macros/latex/contrib/wtref/wtref-ja.tex b/macros/latex/contrib/wtref/wtref-ja.tex
index 87e1189380..fcebf128cf 100644
--- a/macros/latex/contrib/wtref/wtref-ja.tex
+++ b/macros/latex/contrib/wtref/wtref-ja.tex
@@ -12,7 +12,7 @@
\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$}
\newenvironment{syntax}{\begin{quote}\small}{\end{quote}}
-\title{\ThisPkg パッケージ (v0.4.0)}
+\title{\ThisPkg パッケージ (v1.0.0)}
\author{朝倉卓人 (wtsnjp)}
\begin{document}
diff --git a/macros/latex/contrib/wtref/wtref.pdf b/macros/latex/contrib/wtref/wtref.pdf
index 0022ff251b..b019af7f47 100644
--- a/macros/latex/contrib/wtref/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 856852d69d..cb1cc9ffc5 100644
--- a/macros/latex/contrib/wtref/wtref.sty
+++ b/macros/latex/contrib/wtref/wtref.sty
@@ -1,7 +1,7 @@
%%
%% This is file `wtref.sty'.
%%
-%% Copyright 2016-2020 Takuto ASAKURA (wtsnjp)
+%% Copyright 2016-2023 Takuto Asakura (wtsnjp)
%% GitHub: https://github.com/wtsnjp
%% Twitter: @wtsnjp
%%
@@ -11,7 +11,7 @@
% Package declaration
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{wtref}
- [2020/06/15 v0.4.0 A small extension for LaTeX2e's cross-referencing]
+ [2023/12/24 v1.0.0 A small extension for LaTeX2e's cross-referencing]
\def\wtrf@pkgname{WTRef}
\RequirePackage{xparse,xkeyval}
@@ -46,7 +46,7 @@
\@tempcnta=\catcode`\Q
\catcode`\Q=3
\def\wtrf@trim@spaces#1{%
- \romannumeral-`\q\wtrf@trim@trim@\noexpand#1Q Q}
+ \romannumeral-`>\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
@@ -119,7 +119,9 @@
% the \label-like command
\wtrf@check@command{#1label}%
\expandafter\DeclareExpandableDocumentCommand\csname #1label\endcsname{m}{%
- \label{\wtrf@name@use{wtrf@#1@namespace}\wtrf@name@use{wtrf@#1@scope}##1}}%
+ \expandafter\expandafter\expandafter\label\expandafter\expandafter\expandafter
+ {\csname wtrf@#1@namespace\expandafter\endcsname
+ \romannumeral-`>\csname wtrf@#1@scope\endcsname ##1}}%
% the \ref-like command
\wtrf@check@command{#1ref}%
\expandafter\DeclareExpandableDocumentCommand\csname #1ref\endcsname{om}{%
@@ -148,7 +150,7 @@
\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}%
+ \wtrf@construct@#2\wtrf@nil{#3}{#4}%
\fi}
\def\wtrf@construct@#1,#2\wtrf@nil#3#4{%
\expandafter\ifx\wtrf@head#2\wtrf@nil\wtrf@qmark
@@ -159,7 +161,7 @@
\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}%
+ \wtrf@construct@#2\wtrf@nil{#3}{#4}%
\fi}
% Defining \setrefstyle command
diff --git a/macros/latex/contrib/wtref/wtref.tex b/macros/latex/contrib/wtref/wtref.tex
index bfd9bfa913..583cb558b9 100644
--- a/macros/latex/contrib/wtref/wtref.tex
+++ b/macros/latex/contrib/wtref/wtref.tex
@@ -9,26 +9,26 @@
\newcommand{\ThisPkg}{\PkgName{WTRef}}
\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$}
\newenvironment{syntax}{\begin{quote}\small}{\end{quote}}
+\newcommand{\eg}{e.g.,\,}
+\newcommand{\ie}{i.e.,\,}
-\title{The {\ThisPkg} Package (v0.4.0)}
-\author{Takuto ASAKURA (wtsnjp)}
+\title{The {\ThisPkg} Package (v1.0.0)}
+\author{Takuto Asakura (wtsnjp)}
\begin{document}
\maketitle
\begin{abstract}
-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}.
+Package {\ThisPkg} is a small extension for {\LaTeXe}'s cross-referencing. It
+enables you to divide namespace and scope. It also provides a few ways to
+customise referencing formats. {\LaTeXe} on any kind of {\TeX} engine is
+supported. The package requires Package \PkgName{xparse} and \PkgName{xkeyval}.
\end{abstract}
-\section{System Requirements}
+\section{System requirements}
-System requirements of {\ThisPkg} are shown bellow:
+{\ThisPkg} requires the following.
%
\begin{itemize}
\item {\TeX} engine: any engine
@@ -37,137 +37,143 @@ System requirements of {\ThisPkg} are shown bellow:
\item Required packages: \PkgName{xparse} and \PkgName{xkeyval}
\end{itemize}
-\section{Loading the {\ThisPkg} Package}
+\section{Loading the package}
-To use {\ThisPkg} package, load \texttt{wtref.sty} file with |\usepackage| command in preamble.
-No package option is available.
+The package should be loaded in the usual {\LaTeXe} way. No package option is
+available.
%
\begin{syntax}
|\usepackage{wtref}|
\end{syntax}
-\section{Cross-Reference Commands}
+\section{Cross-reference commands}
-\subsection{Definition of New Cross-Reference Commands}
+\subsection{Declaring new cross-reference commands}
-|\newref| command creates a set of cross-reference commands. This command can only be used
-in preamble.
+The |\newref| command creates a pair of cross-reference commands. This command
+can be used in preamble only.
%
\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.
+Herein, \Meta{ref types} is a comma-separated list of \Meta{ref type}. All
+characters consisting of \Meta{ref type} must be `letter' so that they can be
+used for control sequences (recommended to use ASCII alphabets only) and may
+not be empty. Notice that leading and trailing spaces and successive spaces
+around 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.
+The |\newref| command defines pairs of cross-referencing commands, |\|\Meta{ref
+type}|label| and |\|\Meta{ref type}|ref| for each given \Meta{ref type}. In
+this document, we call the former \emph{label commands} and the latter
+\emph{reference commands}. Notice that the |\newref| command may overwrites
+existing commands (with warning messages), so \Meta{ref name} should be decided
+carefully.
-In \Meta{options}, you can set following parameters by key-value list:
+In \Meta{options}, you can set the following parameters with 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
+\item[|namespace=|\Meta{string}] sets \Meta{namespace} to ``\Meta{string}:''.
+In case neither |namespace| nor |nonamespace| is specified, or \Meta{string} of
+|namespace| is empty, the \Meta{namespace} parts in labels are 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[|nonamespace|] sets \Meta{namespace} to empty. That is to say, the
+namespace function for the package is disabled. You can give a value for the
+|nonamespace| key without any error, but the value will be simply 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}:''.
+\item[|scope=|\Meta{counter}] sets counter which used as scope. Though you can
+specify arbitrary {\LaTeX} counter for \Meta{counter}, normally those which
+have uniqueness in a document are useful. The \Meta{scope} parts in labels are
+set 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}.
+These optional settings apply to all pairs of cross-reference commands
+corresponding to \Meta{ref type}s 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.
+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,
+while the namespace function is enabled by default, the scope function is not.
-\subsection{Label Commands}
+\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:
+Label commands are used for making new labels. The usage of them are the same
+as the standard |\label| command of {\LaTeXe}, \eg
%
\begin{syntax}
|\exlabel{|\Meta{label}|}|
\end{syntax}
-\subsubsection{Internal Processing}
-
-Label commands finaly are expanded to following format:
+The label commands are equivalent to the following after a full-expansion:
%
\begin{syntax}
|\label{|\Meta{namespace}\Meta{scope}\Meta{label}|}|
\end{syntax}
-\subsection{Reference Commands}
+\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:
+Reference commands print contents of counters which labeled by label commands
+in specified formats. The following is the syntax of an example reference
+command |\exref|:
%
\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.
+The option argument \Meta{the scope} can be omitted when the specified label
+exists in the same scope. You can refer to labels outside a scope by specifying
+the target scope explicitly, that is the output of proper |\the|\Meta{counter},
+in the option argument. Notice that if the function of scope is inactive (\ie
+in case |scope| key does not specified in \Meta{options} of |\newref|), this
+argument is always unnecessary, and 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.
+In argument \Meta{label list}, you can specify multiple labels in a form of
+comma-separated list. Note that leading and trailing spaces and successive
+spaces around commas are ignored. In the case, pertinent counters should be
+printed in comma-separate form by default. You can change this format
+flexibly with the |\setrefstyle| command.
-\section{Setting Referece Style}
+\section{Setting referencing style}
-The output format of reference commands can be customised with |\setrefstyle| command.
-The syntax of |\setrefstyle| is shown bellow:
+The output format of reference commands can be customised with the
+|\setrefstyle| command. The syntax of the command is as follows:
%
\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.
+The |\setrefstyle| command can be used anywhere in {\LaTeX} documents, not
+limited to preambles, and sets the reference format locally.
-In \Meta{options}, you can set following parameters by key-value list:
+In \Meta{options}, you can set the following parameters with a 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 |{}|.
+\item[|refcmd=|\Meta{ref command}] sets the \Meta{ref command} to used for actual
+referencing functionality. Herein, |#1| in the \Meta{command} may be replaced
+into suitable label name. The default value is |\ref{#1}|. The \Meta{command}
+may be used repeatedly for the number of labels in the given \Meta{label list}.
+%
+\item[|sep=|\Meta{separator}] sets the \Meta{separator}, which used between
+each \Meta{ref command}, in case more than three labels are given for a
+\Meta{label list}. Notice that last one separator is set by |last sep|. The
+default value is |{,\space}|.
+%
+\item[|last sep|(|=|\Meta{last separator})] sets \Meta{last separator} to used
+for the last separator between the \Meta{ref command}s, in case multiple labels
+are given in \Meta{label list}. The part after |=| can be omitted. In that case,
+|last sep| is set to identical value of |sep|, and this is the default
+behavior.
+%
+\item[|prefix=|\Meta{prefix}]
+sets \Meta{prefix} to be put in front of the first \Meta{ref command} when the
+reference commands are used. The default value is |{}|.
+%
+\item[|suffix=|\Meta{suffix}] sets \Meta{suffix} to be put behind the last
+\Meta{ref command} when reference commands are used. The default value is |{}|.
\end{description}
%
-Parameters which do not set explicitly will not be changed.
+Values of the keys which do not set explicitly in the \Meta{options} are left
+unchanged.
\end{document}
+% vim: spell: