diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-24 23:51:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-24 23:51:19 +0000 |
commit | 7af65506fa2152224f81b051fd958eb3dca5c1c2 (patch) | |
tree | ddd509586abf214f5ee0f9a2b4494da6140fdc08 /Master/texmf-dist/tex/latex | |
parent | 0c4528cceb79f3a737dfba22f77cfe787889f057 (diff) |
kantlipsum 0.5 (24dec11)
git-svn-id: svn://tug.org/texlive/trunk@24935 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/kantlipsum/kantlipsum.sty | 118 |
1 files changed, 61 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/latex/kantlipsum/kantlipsum.sty b/Master/texmf-dist/tex/latex/kantlipsum/kantlipsum.sty index 0cea7633394..4f70dda534e 100644 --- a/Master/texmf-dist/tex/latex/kantlipsum/kantlipsum.sty +++ b/Master/texmf-dist/tex/latex/kantlipsum/kantlipsum.sty @@ -24,7 +24,7 @@ %% The released version of this bundle is available from CTAN. %% \RequirePackage{expl3} -\GetIdInfo$Id: kantlipsum.dtx 0.1 2011-11-18 12:00:00Z Enrico $ +\GetIdInfo$Id: kantlipsum.dtx 0.5 2011-12-23 12:00:00Z Enrico $ {Dummy text in Kantian style} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -40,71 +40,75 @@ \tex_endinput:D } \DeclareOption { par } - {\cs_set:Nn \kgl_star: { \c_space_tl } - \cs_set:Nn \kgl_nostar: { \par } } + { + \cs_set:Nn \kgl_star: { \c_space_tl } + \cs_set:Nn \kgl_nostar: { \par } + } \DeclareOption{ nopar } - { \cs_set:Nn \kgl_star: { \par } - \cs_set:Nn \kgl_nostar: { \c_space_tl } } + { + \cs_set:Nn \kgl_star: { \par } + \cs_set:Nn \kgl_nostar: { \c_space_tl } + } \DeclareOption{ numbers } - { \cs_set:Nn \kgl_number:n {#1~\textbullet\space} } + { \cs_set:Nn \kgl_number:n { #1\nobreakspace\textbullet\nobreakspace } } \cs_new_eq:NN \kgl_number:n \use_none:n \ExecuteOptions{par} \ProcessOptions \scan_stop: \RequirePackage{xparse} -\tl_new:N \l_kgl_start_tl -\tl_new:N \l_kgl_end_tl -\tl_new:N \l_kgl_total_tl \msg_new:nnn {kantlipsum}{how-many} - {The~package~provides~paragraphs~1~to~#1\\ - Values~outside~this~range~will~be~ignored} + {The~package~provides~paragraphs~1~to~#1.~ + Values~outside~this~range~will~be~ignored.} \msg_new:nnnn {kantlipsum}{already-defined} - {Control~sequence~#1~defined} - {The~control~sequence~#1~is~already~defined\\ + {Control~sequence~#1~already~defined.} + {The~control~sequence~#1~is~already~defined,~ I'll~ignore~it} -\NewDocumentCommand{\kant}{s>{\SplitArgument{1}{-}}o}{ - \group_begin: - \IfBooleanTF{#1} - { \cs_set_eq:NN \kgl_par: \kgl_star: } - { \cs_set_eq:NN \kgl_par: \kgl_nostar: } - \IfNoValueTF{#2} - { \tl_set:Nn \l_kgl_start_tl {1} \tl_set:Nn \l_kgl_end_tl {7} } - { \kgl_process:nn #2 } - \kgl_print: - \group_end: -} -\NewDocumentCommand{\kantdef}{mm}{ - \group_begin: - \cs_set_eq:NN \kgl_number:n \use_none:n - \cs_set_eq:NN \kgl_par: \prg_do_nothing: - \cs_if_exist:NTF #1 - { \msg_error:nnx {kantlipsum}{already-defined} +\int_new:N \l_kgl_start_int +\int_new:N \l_kgl_end_int +\seq_new:N \g_kgl_pars_seq +\seq_gput_right:Nx \g_kgl_pars_seq {This~is~the~Kant~lipsum~generator.} +\NewDocumentCommand{\kant}{s>{\SplitArgument{1}{-}}O{1-7}} + { + \group_begin: + \IfBooleanTF{#1} + { \cs_set_eq:NN \kgl_par: \kgl_star: } + { \cs_set_eq:NN \kgl_par: \kgl_nostar: } + \kgl_process:nn #2 + \kgl_print: + \group_end: + } +\NewDocumentCommand{\kantdef}{mm} + { + \group_begin: + \cs_set_eq:NN \kgl_number:n \use_none:n + \cs_set_eq:NN \kgl_par: \prg_do_nothing: + \cs_if_exist:NTF #1 + { + \msg_error:nnx {kantlipsum}{already-defined} {\token_to_str:N #1} - } - { \cs_new:Npx #1 { \cs:w c_kgl_\int_to_roman:w #2 _tl \cs_end: } } - \group_end: -} -\cs_new:Nn \kgl_process:nn { - \tl_set:Nn \l_kgl_start_tl {#1} - \IfNoValueTF{#2} - { \tl_set:Nn \l_kgl_end_tl {#1} } - { \tl_set:Nn \l_kgl_end_tl {#2} } -} -\cs_new_protected:Nn \kgl_print: { - \int_set:Nn \l_tmpa_int {\l_kgl_start_tl} - \int_do_until:nNnn \l_tmpa_int > \l_kgl_end_tl - { - \cs:w c_kgl_\int_to_roman:w \l_tmpa_int _tl \cs_end: - \int_incr:N \l_tmpa_int - } -} -\cs_new:Nn \kgl_newpara:n { - \int_incr:N \l_tmpa_int - \tl_gset:cx {c_kgl_\int_to_roman:w \l_tmpa_int _tl} - {\exp_not:N \kgl_number:n {\int_to_arabic:n \l_tmpa_int} - \exp_not:n {#1\kgl_par:} } -} + } + { \cs_new:Npx #1 { \kgl_use:n {#2} } } + \group_end: + } +\cs_new:Nn \kgl_process:nn + { + \int_set:Nn \l_kgl_start_int {#1} + \IfNoValueTF{#2} + { \int_set:Nn \l_kgl_end_int {#1} } + { \int_set:Nn \l_kgl_end_int {#2} } + } +\cs_new:Nn \kgl_print: + { + \prg_stepwise_function:nnnN + {\l_kgl_start_int} {1} {\l_kgl_end_int} \kgl_use:n + } +\cs_new:Nn \kgl_use:n + { + \kgl_number:n {#1} + \seq_item:Nn \g_kgl_pars_seq {#1} + } +\cs_new:Nn \kgl_newpara:n + { \seq_gput_right:Nn \g_kgl_pars_seq {#1\kgl_par:} } \group_begin: -\int_set:Nn \l_tmpa_int {0} \char_set_catcode_space:n {`\ } \kgl_newpara:n {As any dedicated reader can clearly see, the Ideal of practical reason is a representation of, as far as I know, the things @@ -3014,8 +3018,8 @@ and time; still, the noumena, in the case of necessity, constitute the whole content of philosophy.} \group_end: - -\msg_info:nnx{kantlipsum}{how-many}{ \int_to_arabic:n \l_tmpa_int } +\msg_info:nnx{kantlipsum}{how-many} + { \int_eval:n {\seq_length:N \g_kgl_pars_seq - 1} } %% %% %% End of file `kantlipsum.sty'. |