diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/zhlipsum/README.md | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf | bin | 67563 -> 67525 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex | 20 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf | bin | 266087 -> 268081 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx | 87 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty | 28 |
9 files changed, 100 insertions, 49 deletions
diff --git a/Master/texmf-dist/doc/latex/zhlipsum/README.md b/Master/texmf-dist/doc/latex/zhlipsum/README.md index 64b8c0b8ccb..ebbab97309e 100644 --- a/Master/texmf-dist/doc/latex/zhlipsum/README.md +++ b/Master/texmf-dist/doc/latex/zhlipsum/README.md @@ -11,12 +11,12 @@ Basic usage ----------- \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 diff --git a/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf b/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf Binary files differindex 25f8ab1ff42..f4928fd31f4 100644 --- a/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf +++ b/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.pdf diff --git a/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex b/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex index 5d86d83bf62..fb779005bc2 100644 --- a/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex +++ b/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum-en.tex @@ -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 @@ selected automatically according to \CTeX{}. Note that in \CTeX{} 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 @@ list. It can be specified as the following: \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 @@ as well. \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} diff --git a/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf b/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf Binary files differindex 7f9e49c2da0..96a3d791b0b 100644 --- a/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf +++ b/Master/texmf-dist/doc/latex/zhlipsum/zhlipsum.pdf diff --git a/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx b/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx index 2fa2cbf8037..3eb9bac2031 100644 --- a/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx +++ b/Master/texmf-dist/source/latex/zhlipsum/zhlipsum.dtx @@ -46,12 +46,12 @@ Basic usage ----------- \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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. %<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@gmail.com> $ +%<!readme>\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ %<package> {Chinese dummy text} %<package>\ProvidesExplPackage{\ExplFileName} %<utf8> {Chinese dummy text with UTF-8 encoding (for zhlipsum)} @@ -301,11 +301,11 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. % % \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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. %^^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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. % % \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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. % \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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. %^^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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. % \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 @@ Copyright (C) 2017, 2018 by Xiangdong Zeng <xdzeng96@gmail.com>. \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} diff --git a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def index af2917b984a..44d3e671f61 100644 --- a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def +++ b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-big5.def @@ -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@gmail.com> $ +\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ {Chinese dummy text with Big5 encoding (for zhlipsum)} \ProvidesExplFile{\ExplFileName-big5.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def index fb8034a509b..7114dcf3114 100644 --- a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def +++ b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-gbk.def @@ -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@gmail.com> $ +\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ {Chinese dummy text with GBK encoding (for zhlipsum)} \ProvidesExplFile{\ExplFileName-gbk.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def index fa71efdfdf9..af7d4b3c65c 100644 --- a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def +++ b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum-utf8.def @@ -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@gmail.com> $ +\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ {Chinese dummy text with UTF-8 encoding (for zhlipsum)} \ProvidesExplFile{\ExplFileName-utf8.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty index e2819da5521..4797617e17f 100644 --- a/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty +++ b/Master/texmf-dist/tex/latex/zhlipsum/zhlipsum.sty @@ -36,7 +36,7 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: zhlipsum.dtx 1.0.0 2018-04-03 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $ +\GetIdInfo $Id: zhlipsum.dtx 1.1.0 2018-04-08 12:00:00Z Xiangdong Zeng <xdzeng96@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 { |