summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/seealso
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-24 22:27:33 +0000
committerKarl Berry <karl@freefriends.org>2017-03-24 22:27:33 +0000
commitae2003403c75fd90aa7273314aad1b78c1feec89 (patch)
tree5539e0cbd55e2bcd0c70c1e0a180eb4d5d61e6a5 /Master/texmf-dist/source/latex/seealso
parent638c484cd54573bf377234d46c5d564c53421bb5 (diff)
seealso (24mar17)
git-svn-id: svn://tug.org/texlive/trunk@43595 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/seealso')
-rw-r--r--Master/texmf-dist/source/latex/seealso/seealso.dtx35
-rw-r--r--Master/texmf-dist/source/latex/seealso/seealso.ins4
2 files changed, 32 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/seealso/seealso.dtx b/Master/texmf-dist/source/latex/seealso/seealso.dtx
index 37af75cd1ef..f3b49e6c3e8 100644
--- a/Master/texmf-dist/source/latex/seealso/seealso.dtx
+++ b/Master/texmf-dist/source/latex/seealso/seealso.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2014 by Leo Liu <leoliu.pku@gmail.com>
+% Copyright (C) 2014, 2017 by Leo Liu <leoliu.pku@gmail.com>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,7 +26,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{seealso}
%<*package>
- [2014/04/10 v1.1 makeidx's see and seealso with page number support.]
+ [2017/03/23 v1.2 makeidx's see and seealso with page number support.]
%</package>
%
%<*driver>
@@ -119,7 +119,7 @@
%</driver>
% \fi
%
-% \CheckSum{253}
+% \CheckSum{279}
%
% \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
@@ -625,8 +625,33 @@
% \subsection{准备工作}
%
% 引入相关编程工具。
+%
+% \pkg{etoolbox} 是基本宏工具。原有的 \cs{ifinlist} 和 \cs{ifinlistcs} 不能用
+% 于带花括号的文字的查找,会限制我们的使用。为此按 \pkg{etoolbox} 手册的建议,
+% 补充了 \cs{seealso@ifstrinlist} 和 \cs{seealso@ifstrinlistcs} 两个宏来在列表
+% 中搜索字符串。它们会比 \cs{ifinlist} 与 \cs{ifinlistcs} 性能略差一点。
+% \changes{v1.2}{2017/03/23}{允许 \cs{see} 等命令参数中带花括号。}
% \begin{macrocode}
\RequirePackage{etoolbox}
+% {<listmacro>}{<string>}{<true>}{<false>}
+\long\def\seealso@ifinlist@#1#2#3#4{%
+ \def\next{#4}%
+ \def\do##1{%
+ \ifstrequal{##1}{#2}
+ {\def\next{#3}\listbreak}
+ {}}%
+ \dolistloop{#1}%
+ \next}
+% {<string>}{<listmacro>}{<true>}{<false>}
+\protected\long\def\seealso@ifinlist#1#2{%
+ \seealso@ifinlist@{#2}{#1}}
+% {<string>}{<listcsname>}{<true>}{<false>}
+\protected\long\def\seealso@ifinlistcs#1#2{%
+ \expandafter\seealso@ifinlist@\csname #2\endcsname{#1}}
+% \end{macrocode}
+%
+% \pkg{kvoptions} 用于处理宏包选项。
+% \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=seealso@opt,
@@ -749,7 +774,7 @@
% \begin{macrocode}
\newcommand#1[2]{%
\seealso@setactivecr
- \ifinlistcs{##1}{seealso@#2@list}
+ \seealso@ifinlistcs{##1}{seealso@#2@list}
{}
{\listcsgadd{seealso@#2@list}{##1}}%
\csuse{seealso@#2@pageformat}{##2}}%
@@ -866,7 +891,7 @@
% 向结束记号列表中增加一项。
% \begin{macrocode}
\def\seealso@enditemlistadd#1{%
- \ifinlist{#1}\seealso@enditemlist
+ \seealso@ifinlist{#1}\seealso@enditemlist
{}
{\listadd\seealso@enditemlist{#1}}}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/seealso/seealso.ins b/Master/texmf-dist/source/latex/seealso/seealso.ins
index f3492ed93a3..2524e5a3e63 100644
--- a/Master/texmf-dist/source/latex/seealso/seealso.ins
+++ b/Master/texmf-dist/source/latex/seealso/seealso.ins
@@ -1,4 +1,4 @@
-%% Copyright (C) 2014 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2014, 2017 by Leo Liu <leoliu.pku@gmail.com>
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -25,7 +25,7 @@
This is a generated file.
-Copyright (C) 2014 by Leo Liu <leoliu.pku@gmail.com>
+Copyright (C) 2014, 2017 by Leo Liu <leoliu.pku@gmail.com>
--------------------------------------------------------------------------
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3