texlive[47383] Master/texmf-dist: zhlipsum (8apr18)

commits+karl at tug.org commits+karl at tug.org
Sun Apr 8 22:06:41 CEST 2018


Revision: 47383
          http://tug.org/svn/texlive?view=revision&revision=47383
Author:   karl
Date:     2018-04-08 22:06:41 +0200 (Sun, 08 Apr 2018)
Log Message:
-----------
zhlipsum (8apr18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/zhlipsum/README.md
    trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf
    trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex
    trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf
    trunk/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx
    trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def
    trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def
    trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def
    trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty

Modified: trunk/Master/texmf-dist/doc/latex/zhlipsum/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zhlipsum/README.md	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/doc/latex/zhlipsum/README.md	2018-04-08 20:06:41 UTC (rev 47383)
@@ -11,12 +11,12 @@
 -----------
 
     \zhlipsum
-    \zhlipsum*{1-5}
-    \zhlipsum{6-10,18}[name=trad]
+    \zhlipsum*[1-5]
+    \zhlipsum[6-10,18][name=trad]
 
 More information can be found in the package documentation
-[zhlipsum.pdf](http://mirrors.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum.pdf)
-(Chinese version) or [zhlipsum-en.pdf](http://mirrors.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum-en.pdf)
+[zhlipsum.pdf](http://mirror.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum.pdf)
+(Chinese version) or [zhlipsum-en.pdf](http://mirror.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum-en.pdf)
 (English version).
 
 Installation

Modified: trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex	2018-04-08 20:06:41 UTC (rev 47383)
@@ -86,7 +86,7 @@
   {\endenumerate}
 \title{\textbf{The \pkg{zhlipsum} Package: Chinese Dummy Text}}
 \author{Xiangdong Zeng}
-\date{2018/04/03 \quad v1.0.0%
+\date{2018/04/08 \quad v1.1.0%
   \thanks{\url{https://github.com/Stone-Zeng/zhlipsum}.}}
 
 \begin{document}
@@ -129,10 +129,10 @@
 bundle, the correspoding options are \opt{UTF8} and \opt{GBK},
 while the options in \pkg{zhlipsum} are all in \emph{lowercase}.
 
-\begin{function}[updated=2018-03-23]{\zhlipsum}
+\begin{function}[updated=2018-04-08]{\zhlipsum}
   \begin{syntax}
-    \cs{zhlipsum}\Arg{paragraph}\oarg{options}
-    \cs{zhlipsum*}\Arg{paragraph}\oarg{options}
+    \cs{zhlipsum}\oarg{paragraph}\oarg{options}
+    \cs{zhlipsum*}\oarg{paragraph}\oarg{options}
   \end{syntax}
   Produce dummy text. Both arguments \meta{paragraph} and
   \meta{options} are optional. Note that spaces are not allowed
@@ -150,12 +150,12 @@
 
 \begin{ctexexam}
   ! Suppose the dummy text has 50 paragraphs.
-  \zhlipsum{2-4}          ! Can be specified as a-b
-  \zhlipsum{4,12,3-8}     ! A single number is also acceptable
-  \zhlipsum{-10,40-}      ! Produce paragraphs 1-10 and 40-50
-  \zhlipsum{-}            ! Produce all paragraphs, i.e. 1-50
+  \zhlipsum[2-4]          ! Can be specified as a-b
+  \zhlipsum[4,12,3-8]     ! A single number is also acceptable
+  \zhlipsum[-10,40-]      ! Produce paragraphs 1-10 and 40-50
+  \zhlipsum[-]            ! Produce all paragraphs, i.e. 1-50
   \zhlipsum               ! Default value is 1-3
-  \zhlipsum{48-52}        ! Numbers larger than 50 will not be considered
+  \zhlipsum[48-52]        ! Numbers larger than 50 will not be considered
                           ! i.e. only paragraphs 48-50 are produced
 \end{ctexexam}
 
@@ -225,7 +225,7 @@
   \newzhlipsum{jingyesi}{!
     {床前明月光,}, {疑是地上霜。}, {举头望明月,}, {低头思故乡。}}
 
-  \zhlipsum*{-}[name=jingyesi]  ! Print all the four sentences without `\par'
+  \zhlipsum*[-][name=jingyesi]  ! Print all the four sentences without `\par'
 \end{ctexexam}
 
 \section{Programming interface}

Modified: trunk/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx	2018-04-08 20:06:41 UTC (rev 47383)
@@ -46,12 +46,12 @@
 -----------
 
     \zhlipsum
-    \zhlipsum*{1-5}
-    \zhlipsum{6-10,18}[name=trad]
+    \zhlipsum*[1-5]
+    \zhlipsum[6-10,18][name=trad]
 
 More information can be found in the package documentation
-[zhlipsum.pdf](http://mirrors.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum.pdf)
-(Chinese version) or [zhlipsum-en.pdf](http://mirrors.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum-en.pdf)
+[zhlipsum.pdf](http://mirror.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum.pdf)
+(Chinese version) or [zhlipsum-en.pdf](http://mirror.ctan.org/macros/latex/contrib/zhlipsum/zhlipsum-en.pdf)
 (English version).
 
 Installation
@@ -183,7 +183,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\RequirePackage{expl3}
 %<*!(driver|install)>
-%<!readme>\GetIdInfo $Id: zhlipsum.dtx 1.0.0 2018-04-03 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
+%<!readme>\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
 %<package>  {Chinese dummy text}
 %<package>\ProvidesExplPackage{\ExplFileName}
 %<utf8>  {Chinese dummy text with UTF-8 encoding (for zhlipsum)}
@@ -301,11 +301,11 @@
 %
 % \title{\textbf{zhlipsum: 中文乱数假文(Lorem ipsum)}}
 % \author{曾祥东}
-% \date{2018/04/03 \quad v1.0.0^^A
+% \date{2018/04/08 \quad v1.1.0^^A
 %   \thanks{\url{https://github.com/Stone-Zeng/zhlipsum}.}}
 %^^A! \title{\textbf{The \pkg{zhlipsum} Package: Chinese Dummy Text}}
 %^^A! \author{Xiangdong Zeng}
-%^^A! \date{2018/04/03 \quad v1.0.0%
+%^^A! \date{2018/04/08 \quad v1.1.0%
 %^^A!   \thanks{\url{https://github.com/Stone-Zeng/zhlipsum}.}}
 %^^A!
 %
@@ -429,18 +429,18 @@
 %^^A!
 %
 %^^A+
-% \begin{function}[updated=2018-03-23]{\zhlipsum}
+% \begin{function}[updated=2018-04-08]{\zhlipsum}
 %^^A-
 %   \begin{syntax}
-%     \cs{zhlipsum}\Arg{段落}\oarg{选项}
-%     \cs{zhlipsum}*\Arg{段落}\oarg{选项}
+%     \cs{zhlipsum}\oarg{段落}\oarg{选项}
+%     \cs{zhlipsum}*\oarg{段落}\oarg{选项}
 %   \end{syntax}
 %   插入假文文本。参数 \meta{段落} 和 \meta{选项} 都是可选的。注意各
 %   参数之间不可以有空格。
 % \end{function}
 %^^A!   \begin{syntax}
-%^^A!     \cs{zhlipsum}\Arg{paragraph}\oarg{options}
-%^^A!     \cs{zhlipsum*}\Arg{paragraph}\oarg{options}
+%^^A!     \cs{zhlipsum}\oarg{paragraph}\oarg{options}
+%^^A!     \cs{zhlipsum*}\oarg{paragraph}\oarg{options}
 %^^A!   \end{syntax}
 %^^A!   Produce dummy text. Both arguments \meta{paragraph} and
 %^^A!   \meta{options} are optional. Note that spaces are not allowed
@@ -466,21 +466,21 @@
 %
 % \begin{ctexexam}
 %   ! 假设假文最大段落数为 50
-%   \zhlipsum{2-4}          ! 可用 a-b 的形式指定
-%   \zhlipsum{4,12,3-8}     ! 也可用单个数字指定
-%   \zhlipsum{-10,40-}      ! 输出 1-10 段和 40-50 段
-%   \zhlipsum{-}            ! 输出全部段落,即 1-50 段
+%   \zhlipsum[2-4]          ! 可用 a-b 的形式指定
+%   \zhlipsum[4,12,3-8]     ! 也可用单个数字指定
+%   \zhlipsum[-10,40-]      ! 输出 1-10 段和 40-50 段
+%   \zhlipsum[-]            ! 输出全部段落,即 1-50 段
 %   \zhlipsum               ! 默认输出 1-3 段
-%   \zhlipsum{48-52}        ! 超出部分会自动忽略,即只输出 48-50 段
+%   \zhlipsum[48-52]        ! 超出部分会自动忽略,即只输出 48-50 段
 % \end{ctexexam}
 %^^A! \begin{ctexexam}
 %^^A!   ! Suppose the dummy text has 50 paragraphs.
-%^^A!   \zhlipsum{2-4}          ! Can be specified as a-b
-%^^A!   \zhlipsum{4,12,3-8}     ! A single number is also acceptable
-%^^A!   \zhlipsum{-10,40-}      ! Produce paragraphs 1-10 and 40-50
-%^^A!   \zhlipsum{-}            ! Produce all paragraphs, i.e. 1-50
+%^^A!   \zhlipsum[2-4]          ! Can be specified as a-b
+%^^A!   \zhlipsum[4,12,3-8]     ! A single number is also acceptable
+%^^A!   \zhlipsum[-10,40-]      ! Produce paragraphs 1-10 and 40-50
+%^^A!   \zhlipsum[-]            ! Produce all paragraphs, i.e. 1-50
 %^^A!   \zhlipsum               ! Default value is 1-3
-%^^A!   \zhlipsum{48-52}        ! Numbers larger than 50 will not be considered
+%^^A!   \zhlipsum[48-52]        ! Numbers larger than 50 will not be considered
 %^^A!                           ! i.e. only paragraphs 48-50 are produced
 %^^A! \end{ctexexam}
 %^^A!
@@ -607,7 +607,7 @@
 %   \newzhlipsum{jingyesi}{!
 %     {床前明月光,}, {疑是地上霜。}, {举头望明月,}, {低头思故乡。}}
 %
-%   \zhlipsum*{-}[name=jingyesi]  ! 输出全部四句假文,且不分段
+%   \zhlipsum*[-][name=jingyesi]  ! 输出全部四句假文,且不分段
 % \end{ctexexam}
 %^^A! \begin{ctexexam}
 %^^A!   ! Fullwidth comma `,' is used in Chinese language.
@@ -615,7 +615,7 @@
 %^^A!   \newzhlipsum{jingyesi}{!
 %^^A!     {床前明月光,}, {疑是地上霜。}, {举头望明月,}, {低头思故乡。}}
 %^^A!
-%^^A!   \zhlipsum*{-}[name=jingyesi]  ! Print all the four sentences without `\par'
+%^^A!   \zhlipsum*[-][name=jingyesi]  ! Print all the four sentences without `\par'
 %^^A! \end{ctexexam}
 %^^A!
 %
@@ -1104,10 +1104,11 @@
 % \changes{v0.5}{2018/01/05}{支持选项设置。}
 % \changes{v1.0.0}{2018/03/23}{更改参数形式,允许利用逗号分隔列表选择
 %   段落。}
+% \changes{v1.1.0}{2018/04/08}{改回使用方括号指定段落数的形式。}
 % 输出假文,第一个可选参数表示段落数,默认为 |1-3|;第二个可选参数为选
-% 项列表。注意第一个可选参数需要用花括号包围。
+% 项列表。
 %    \begin{macrocode}
-\NewDocumentCommand \zhlipsum { s G { 1 - 3 } +o }
+\NewDocumentCommand \zhlipsum { s o +o }
   {
     \group_begin:
       \IfBooleanF {#1}
@@ -1116,13 +1117,43 @@
           \tl_set:Nn \l_@@_after_tl  { \@@_par: }
           \tl_set:Nn \l_@@_inter_tl  { \@@_par: }
         }
-      \IfValueT {#3} { \keys_set:nn { zhlipsum } {#3} }
-      \zhlipsum_use:Vn \l_@@_name_tl {#2}
+      \IfValueTF {#3}
+        {
+          \keys_set:nn { zhlipsum } {#3}
+          \zhlipsum_use:Vn \l_@@_name_tl {#2}
+        }
+        {
+          \IfValueTF {#2}
+            {
+%    \end{macrocode}
+% 如果只带一个参数,那么根据其是否含有 |=| 来判断该参数是段落数还是
+% 选项列表。
+%    \begin{macrocode}
+              \@@_if_key_value_list:nTF {#2}
+                {
+                  \keys_set:nn { zhlipsum } {#2}
+                  \zhlipsum_use:Vn \l_@@_name_tl { 1 - 3 }
+                }
+                { \zhlipsum_use:Vn \l_@@_name_tl {#2} }
+            }
+            { \zhlipsum_use:Vn \l_@@_name_tl { 1 - 3 } }
+        }
     \group_end:
   }
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}[TF]{\@@_if_key_value_list:n}
+% 判断是否为键值列表,即是否含有 |=|。
+%    \begin{macrocode}
+\prg_new_protected_conditional:Npnn \@@_if_key_value_list:n #1 { TF }
+  {
+    \tl_if_in:nnTF {#1} { = }
+      { \prg_return_true: } { \prg_return_false: }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{variable}{\l_@@_par_num_seq}
 % 保存段落编号。
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def	2018-04-08 20:06:41 UTC (rev 47383)
@@ -35,7 +35,7 @@
 %%                                     zhlipsum-en.pdf,
 %%                                 and README.md.
 %% 
-\GetIdInfo $Id: zhlipsum.dtx 1.0.0 2018-04-03 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
+\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
   {Chinese dummy text with Big5 encoding (for zhlipsum)}
 \ProvidesExplFile{\ExplFileName-big5.def}
   {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}

Modified: trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def	2018-04-08 20:06:41 UTC (rev 47383)
@@ -35,7 +35,7 @@
 %%                                     zhlipsum-en.pdf,
 %%                                 and README.md.
 %% 
-\GetIdInfo $Id: zhlipsum.dtx 1.0.0 2018-04-03 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
+\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
   {Chinese dummy text with GBK encoding (for zhlipsum)}
 \ProvidesExplFile{\ExplFileName-gbk.def}
   {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}

Modified: trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def	2018-04-08 20:06:41 UTC (rev 47383)
@@ -35,7 +35,7 @@
 %%                                     zhlipsum-en.pdf,
 %%                                 and README.md.
 %% 
-\GetIdInfo $Id: zhlipsum.dtx 1.0.0 2018-04-03 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
+\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
   {Chinese dummy text with UTF-8 encoding (for zhlipsum)}
 \ProvidesExplFile{\ExplFileName-utf8.def}
   {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}

Modified: trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty	2018-04-08 20:06:28 UTC (rev 47382)
+++ trunk/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty	2018-04-08 20:06:41 UTC (rev 47383)
@@ -36,7 +36,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
-\GetIdInfo $Id: zhlipsum.dtx 1.0.0 2018-04-03 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
+\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96 at gmail.com> $
   {Chinese dummy text}
 \ProvidesExplPackage{\ExplFileName}
   {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -188,7 +188,7 @@
 \__zhlipsum_if_encoding:nTF { big5 }
   { \keys_set:nn { zhlipsum } { name = trad } }
   { \keys_set:nn { zhlipsum } { name = simp } }
-\NewDocumentCommand \zhlipsum { s G { 1 - 3 } +o }
+\NewDocumentCommand \zhlipsum { s o +o }
   {
     \group_begin:
       \IfBooleanF {#1}
@@ -197,10 +197,30 @@
           \tl_set:Nn \l__zhlipsum_after_tl  { \__zhlipsum_par: }
           \tl_set:Nn \l__zhlipsum_inter_tl  { \__zhlipsum_par: }
         }
-      \IfValueT {#3} { \keys_set:nn { zhlipsum } {#3} }
-      \zhlipsum_use:Vn \l__zhlipsum_name_tl {#2}
+      \IfValueTF {#3}
+        {
+          \keys_set:nn { zhlipsum } {#3}
+          \zhlipsum_use:Vn \l__zhlipsum_name_tl {#2}
+        }
+        {
+          \IfValueTF {#2}
+            {
+              \__zhlipsum_if_key_value_list:nTF {#2}
+                {
+                  \keys_set:nn { zhlipsum } {#2}
+                  \zhlipsum_use:Vn \l__zhlipsum_name_tl { 1 - 3 }
+                }
+                { \zhlipsum_use:Vn \l__zhlipsum_name_tl {#2} }
+            }
+            { \zhlipsum_use:Vn \l__zhlipsum_name_tl { 1 - 3 } }
+        }
     \group_end:
   }
+\prg_new_protected_conditional:Npnn \__zhlipsum_if_key_value_list:n #1 { TF }
+  {
+    \tl_if_in:nnTF {#1} { = }
+      { \prg_return_true: } { \prg_return_false: }
+  }
 \seq_new:N \l__zhlipsum_par_num_seq
 \cs_new_protected:Npn \zhlipsum_use:nn #1#2
   {



More information about the tex-live-commits mailing list