diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-04 19:56:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-04 19:56:48 +0000 |
commit | c6f718451f35986fa822e0b82133b5b2a2a573ec (patch) | |
tree | 09048a17b2ba72523be562be352a99c84557adfa /Master/texmf-dist/tex/lualatex/letgut/letgut.cls | |
parent | e474c34586e7bcfbec69ae432af6e0eb14069fa0 (diff) |
letgut (4oct22)
git-svn-id: svn://tug.org/texlive/trunk@64618 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/letgut/letgut.cls')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/letgut/letgut.cls | 85 |
1 files changed, 75 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/lualatex/letgut/letgut.cls b/Master/texmf-dist/tex/lualatex/letgut/letgut.cls index bae4ae10681..319dfc2badd 100644 --- a/Master/texmf-dist/tex/lualatex/letgut/letgut.cls +++ b/Master/texmf-dist/tex/lualatex/letgut/letgut.cls @@ -44,8 +44,8 @@ } \ExplSyntaxOff \ProvidesExplClass{letgut} -{2022-03-17} -{0.9} +{2022-10-03} +{0.9.4} { Class for the newsletter “The GUTenberg Letter” } @@ -1210,12 +1210,12 @@ \NewExpandableDocumentCommand { \gut } { } { \c__letgut_gutenberg_tl } -\NewExpandableDocumentCommand { \lettre } { } { - \c__letgut_Lettre_tl - } - \NewExpandableDocumentCommand { \lettregut } { } { - \lettre \c_space_tl \gutenberg - } +% \NewExpandableDocumentCommand { \lettre } { } { +% \c__letgut_Lettre_tl +% } +% \NewExpandableDocumentCommand { \lettregut } { } { +% \lettre \c_space_tl \gutenberg +% } \NewExpandableDocumentCommand { \Cahier } { } { \c__letgut_cahier_tl } @@ -1261,6 +1261,58 @@ \NewExpandableDocumentCommand { \windows } { } { \c__letgut_windows_tl } +\cs_new_protected:Npn \__letgut_get_lettre_number:n #1 +{ + \tl_if_empty:nTF {#1}{ + \int_use:N \g__letgut_number_int + }{ + \tl_set:Nx \l_tmpa_tl {\tl_head:n { #1 }} + \tl_set:Nn \l_tmpb_tl { #1 } + \tl_case:NnF \l_tmpa_tl { + {\c__letgut_plus_tl} {\int_eval:n {\g__letgut_number_int\l_tmpa_tl\tl_range:Nnn \l_tmpb_tl { 2 } { -1 }}} + {\c__letgut_minus_tl} {\int_eval:n {\g__letgut_number_int\l_tmpa_tl\tl_range:Nnn \l_tmpb_tl { 2 } { -1 }}} + {\c__letgut_dot_tl} {\int_use:N \g__letgut_number_int} + } + {\l_tmpb_tl} + } +} +\NewDocumentCommand { \lettrenumber } { s O{} } { + \IfBooleanT{#1}{ + \no + } + \__letgut_get_lettre_number:n { #2 } +} +\tl_const:Nn \c__letgut_plus_tl { + } +\tl_const:Nn \c__letgut_minus_tl { - } +\tl_const:Nn \c__letgut_dot_tl { . } +\cs_new_protected:Npn \__letgut_lettre:nnn #1 #2 #3 +{ + \c__letgut_Lettre_tl #2 + \tl_if_empty:nF {#1} + { + #3 + \c_space_tl + \__letgut_get_lettre_number:n {#1} + } +} +\NewDocumentCommand { \lettre } { s O{} } { + \IfBooleanTF{#1}{ + \__letgut_lettre:nnn { #2 } { } { + \tl_if_empty:nF {#2}{ + \c_space_tl\no + } + } + }{ + \__letgut_lettre:nnn { #2 } { } { } + } +} +\NewDocumentCommand { \lettregut } { s O{} } { + \IfBooleanTF{#1}{ + \__letgut_lettre:nnn { #2 } { \c_space_tl \c__letgut_gutenberg_tl } { \c_space_tl\no } + }{ + \__letgut_lettre:nnn { #2 } { \c_space_tl \c__letgut_gutenberg_tl } { } + } +} \cs_new_protected:Npn \__letgut_emphasis:n #1 { \emph{#1} @@ -1271,6 +1323,17 @@ \NewDocumentCommand { \latinloc } { m } { \__letgut_emphasis:n {#1} } +\cs_new_protected:Npn \__letgut_unicode_code:nn #1 #2 +{ + U+\bgroup\addfontfeature{Numbers={Lining,Proportional}}#2\egroup + \tl_if_empty:nF {#1}{ + \c_space_tl + ({\addfontfeature{RawFeature={smcp,c2sc}}#1}) + } +} +\NewDocumentCommand { \Ucode } { O{} m } { + \__letgut_unicode_code:nn {#1}{#2} +} \AddToHook{begindocument/end}{ \pdfstringdefDisableCommands{ \RenewExpandableDocumentCommand\person { m }{#1} @@ -2157,8 +2220,10 @@ overlay={ } \lst@RestoreCatcodes \file_if_exist:nT {./\c__letgut_local_config_file_tl}{ - \use:n { \ExplSyntaxOff \file_input:n {./\c__letgut_local_config_file_tl} } - \ExplSyntaxOn + \@pushfilename + \xdef\@currname{\c__letgut_local_config_file_tl} + \file_input:n {./\c__letgut_local_config_file_tl} + \@popfilename } \ExecuteBibliographyOptions[bookreview]{skipbib,skiplab} \endinput |