diff options
author | Karl Berry <karl@freefriends.org> | 2022-08-05 21:33:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-08-05 21:33:03 +0000 |
commit | 16fb143868bcf7876073114e733f9333c7cf7ddc (patch) | |
tree | 141d508ba6de5567683c2fbd241bb507b4c995af /Master/texmf-dist/source | |
parent | 3c9c81692e46bc10f166065bdc5dcf9283315f66 (diff) |
projlib (5aug22)
git-svn-id: svn://tug.org/texlive/trunk@64056 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/projlib/ProjLib.dtx | 141 |
1 files changed, 84 insertions, 57 deletions
diff --git a/Master/texmf-dist/source/latex/projlib/ProjLib.dtx b/Master/texmf-dist/source/latex/projlib/ProjLib.dtx index 788cf84699b..3ab56e9868d 100644 --- a/Master/texmf-dist/source/latex/projlib/ProjLib.dtx +++ b/Master/texmf-dist/source/latex/projlib/ProjLib.dtx @@ -19,84 +19,84 @@ %<*ProjLib> \ProvidesExplPackage {ProjLib} - {2022/08/01} {} + {2022/08/05} {} {Collective interface of the ProjLib toolkit} %</ProjLib> % %<*projlib-author> \ProvidesExplPackage {projlib-author} - {2022/08/01} {} + {2022/08/05} {} {Enhanced author information block} %</projlib-author> % %<*projlib-datetime> \ProvidesExplPackage {projlib-datetime} - {2022/08/01} {} + {2022/08/05} {} {Convert numeric date-time string to natural language} %</projlib-datetime> % %<*projlib-draft> \ProvidesExplPackage {projlib-draft} - {2022/08/01} {} + {2022/08/05} {} {Useful commands during draft stage} %</projlib-draft> % %<*projlib-font> \ProvidesExplPackage {projlib-font} - {2022/08/01} {} + {2022/08/05} {} {Font selection and configuration} %</projlib-font> % %<*projlib-language> \ProvidesExplPackage {projlib-language} - {2022/08/01} {} + {2022/08/05} {} {Multi-language configuration} %</projlib-language> % %<*projlib-logo> \ProvidesExplPackage {projlib-logo} - {2022/08/01} {} + {2022/08/05} {} {The ProjLib logo} %</projlib-logo> % %<*projlib-math> \ProvidesExplPackage {projlib-math} - {2022/08/01} {} + {2022/08/05} {} {Efficient math setup} %</projlib-math> % %<*projlib-paper> \ProvidesExplPackage {projlib-paper} - {2022/08/01} {} + {2022/08/05} {} {Configuration of the paper style} %</projlib-paper> % %<*projlib-text> \ProvidesExplPackage {projlib-text} - {2022/08/01} {} + {2022/08/05} {} {Text-related commands} %</projlib-text> % %<*projlib-theorem> \ProvidesExplPackage {projlib-theorem} - {2022/08/01} {} + {2022/08/05} {} {Configuration of theorem-like environments} %</projlib-theorem> % %<*projlib-titlepage> \ProvidesExplPackage {projlib-titlepage} - {2022/08/01} {} + {2022/08/05} {} {Commands for rendering the title page} %</projlib-titlepage> @@ -3291,6 +3291,14 @@ } \ProcessKeyOptions [ projlib-math ] + +% https://tex.stackexchange.com/a/643233 +\providecommand* \ProvideCommandCopy + { + \declare@commandcopy{\@firstofone}{\@firstoftwo{}} + } + + \RequirePackage { mathtools } \RequirePackage { mathrsfs } \PassOptionsToPackage { warnings-off = { mathtools-colon, mathtools-overbracket } } { unicode-math } @@ -3356,7 +3364,7 @@ } \cs_generate_variant:Nn \__projlib_math_define_operator:nnn { nee } -\NewDocumentCommand \DefineMathOperator { s O{} m O{} } +\NewDocumentCommand \ProjLibDefineMathOperator { s O{} m O{} } { \tl_if_blank:nTF { #2 } { @@ -3366,50 +3374,52 @@ \projlib_math_define_operator:nnn { #1 } { #3 } { #2 } } } -\NewCommandCopy \DefineOperator \DefineMathOperator + +\ProvideCommandCopy \DefineMathOperator \ProjLibDefineMathOperator +\ProvideCommandCopy \DefineOperator \ProjLibDefineMathOperator \msg_new:nnn { projlib-math } - { shortcut-not-define } + { symbol-not-define } { The~symbol~/~shortcut~"\iow_char:N \\#1"~cannot~be~defined,~a~command~with~the~same~name~has~already~existed. } \msg_new:nnn { projlib-math } - { shortcut-type-not-define } + { symbol-type-not-define } { The~symbol~/~shortcut~type~"#1"~is~not~available,~a~command~with~the~same~name~has~already~existed. } -\keys_define:nn { projlib-math-shortcut } +\keys_define:nn { projlib-math-symbol } { - , prefix .clist_set:N = \l__projlib_math_shortcut_prefix_clist - , type .tl_set:N = \l__projlib_math_shortcut_type_tl - , style .tl_set:N = \l__projlib_math_shortcut_style_tl + , prefix .clist_set:N = \l__projlib_math_symbol_prefix_clist + , type .tl_set:N = \l__projlib_math_symbol_type_tl + , style .tl_set:N = \l__projlib_math_symbol_style_tl , unknown .code:n = {} } -\cs_new_protected:Nn \projlib_math_define_shortcut:nnn +\cs_new_protected:Nn \projlib_math_define_symbol:nnn % #1 = bool for star or empty % (currently the starred version is the same as normal version) - % #2 = list of shortcuts + % #2 = list of symbols % #3 = the option { - \clist_clear:N \l__projlib_math_shortcut_prefix_clist - \tl_clear:N \l__projlib_math_shortcut_type_tl - \tl_set:Nn \l__projlib_math_shortcut_style_tl { \mathrm } - \keys_set:nn { projlib-math-shortcut } { #3 } - \tl_if_empty:NF \l__projlib_math_shortcut_type_tl + \clist_clear:N \l__projlib_math_symbol_prefix_clist + \tl_clear:N \l__projlib_math_symbol_type_tl + \tl_set:Nn \l__projlib_math_symbol_style_tl { \mathrm } + \keys_set:nn { projlib-math-symbol } { #3 } + \tl_if_empty:NF \l__projlib_math_symbol_type_tl { - \cs_if_exist:cTF { \l__projlib_math_shortcut_type_tl } + \cs_if_exist:cTF { \l__projlib_math_symbol_type_tl } { \exp_args:Nne \use:n - { \msg_warning:nnn { projlib-math } { shortcut-type-not-define } } - { \l__projlib_math_shortcut_type_tl } + { \msg_warning:nnn { projlib-math } { symbol-type-not-define } } + { \l__projlib_math_symbol_type_tl } } { \exp_args:Nno \use:n { - \exp_args:Nc \NewDocumentCommand { \l__projlib_math_shortcut_type_tl } { m } + \exp_args:Nc \NewDocumentCommand { \l__projlib_math_symbol_type_tl } { m } } { - \l__projlib_math_shortcut_style_tl { ##1 } + \l__projlib_math_symbol_style_tl { ##1 } } } } @@ -3418,59 +3428,79 @@ \str_if_in:nnTF { ##1 } { = } { \seq_set_split:Nnn \l_tmpa_seq { = } { ##1 } - \clist_if_empty:NTF \l__projlib_math_shortcut_prefix_clist + \clist_if_empty:NTF \l__projlib_math_symbol_prefix_clist { - \__projlib_math_define_shortcut:ee { \seq_item:Nn \l_tmpa_seq { 1 } } { \seq_item:Nn \l_tmpa_seq { 2 } } + \__projlib_math_define_symbol:ee { \seq_item:Nn \l_tmpa_seq { 1 } } { \seq_item:Nn \l_tmpa_seq { 2 } } } { - \clist_map_inline:Nn \l__projlib_math_shortcut_prefix_clist + \clist_map_inline:Nn \l__projlib_math_symbol_prefix_clist { - \__projlib_math_define_shortcut:ee { ####1 \seq_item:Nn \l_tmpa_seq { 1 } } { \seq_item:Nn \l_tmpa_seq { 2 } } + \__projlib_math_define_symbol:ee { ####1 \seq_item:Nn \l_tmpa_seq { 1 } } { \seq_item:Nn \l_tmpa_seq { 2 } } } } } { - \clist_if_empty:NTF \l__projlib_math_shortcut_prefix_clist + \clist_if_empty:NTF \l__projlib_math_symbol_prefix_clist { - \__projlib_math_define_shortcut:ee { ##1 } { ##1 } + \__projlib_math_define_symbol:ee { ##1 } { ##1 } } { - \clist_map_inline:Nn \l__projlib_math_shortcut_prefix_clist + \clist_map_inline:Nn \l__projlib_math_symbol_prefix_clist { - \__projlib_math_define_shortcut:ee { ####1 ##1 } { ##1 } + \__projlib_math_define_symbol:ee { ####1 ##1 } { ##1 } } } } } } -\cs_new_protected:Nn \__projlib_math_define_shortcut:nn +\cs_new_protected:Nn \__projlib_math_define_symbol:nn % #1 = command name % #2 = the content { \cs_if_exist:cTF { #1 } { - \msg_warning:nnn { projlib-math } { shortcut-not-define } { #1 } + \msg_warning:nnn { projlib-math } { symbol-not-define } { #1 } } { \exp_args:Nno \use:n { \exp_args:Nc \NewDocumentCommand { #1 } {} } - { \l__projlib_math_shortcut_style_tl { #2 } } + { \l__projlib_math_symbol_style_tl { #2 } } } } -\cs_generate_variant:Nn \__projlib_math_define_shortcut:nn { ee } +\cs_generate_variant:Nn \__projlib_math_define_symbol:nn { ee } -\NewDocumentCommand \DefineMathSymbol { s O{} m O{} } +\NewDocumentCommand \ProjLibDefineMathSymbol { s O{} m O{} } { \tl_if_blank:nTF { #2 } { - \projlib_math_define_shortcut:nnn { #1 } { #3 } { #4 } + \projlib_math_define_symbol:nnn { #1 } { #3 } { #4 } + } + { + \projlib_math_define_symbol:nnn { #1 } { #3 } { #2 } } + } +\ProvideCommandCopy \DefineMathSymbol \ProjLibDefineMathSymbol +\ProvideCommandCopy \DefineShortcut \ProjLibDefineMathSymbol + + +\cs_new:Nn \projlib_math_redefine_in_math_mode:Nn + { + \exp_args:Nc \NewCommandCopy { projlib_math_original_ \cs_to_str:N #1 : } #1 + \RenewDocumentCommand #1 { } { - \projlib_math_define_shortcut:nnn { #1 } { #3 } { #2 } + \mode_if_math:TF + { #2 } + { \use:c { projlib_math_original_ \cs_to_str:N #1 : } } } } -\NewCommandCopy \DefineShortcut \DefineMathSymbol + +\NewDocumentCommand \ProjLibRedefineInMathMode { m m } + { + \projlib_math_redefine_in_math_mode:Nn #1 { #2 } + } + +\ProvideCommandCopy \RedefineInMathMode \ProjLibRedefineInMathMode \cs_new:Nn \__projlib_math_list_of_symbols_entry:nnnn @@ -3503,10 +3533,7 @@ \projlib_math_list_of_symbols:nnn { #1 } { #2 } { #3 } } -\ProvideDocumentCommand \ListOfSymbols { O{0.17\textwidth} O{0.75\textwidth} m } - { - \projlib_math_list_of_symbols:nnn { #1 } { #2 } { #3 } - } +\ProvideCommandCopy \ListOfSymbols \ProjLibListOfSymbols %</projlib-math> % %<*projlib-paper> @@ -5251,7 +5278,7 @@ } \colorlet { titlepage-main } { blue!50!cyan!50!black } -\colorlet { titlepage-back } { blue!50!cyan!10!yellow!30 } +\colorlet { titlepage-back } { blue!50!cyan!15!yellow!25 } \cs_new_protected:Nn \projlib_titlepage_render:n { @@ -5284,8 +5311,8 @@ \fontsize{18pt}{27pt}\selectfont \l_projlib_titlepage_subtitle_tl }; - \node[text~width=.3\paperwidth, text~height=.3\paperheight, align=flush~left] - at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) + \node[text~width=.5\paperwidth, text~height=.4\paperheight, align=flush~left] + at ($(current~page.south)+(.135\paperwidth,.35\paperheight)$) { \color{titlepage-back} \begin{flushright} @@ -5318,8 +5345,8 @@ \fontsize{18pt}{27pt}\selectfont \l_projlib_titlepage_subtitle_tl }; - \node[text~width=.3\paperwidth, text~height=.3\paperheight, align=flush~left] - at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) + \node[text~width=.5\paperwidth, text~height=.4\paperheight, align=flush~left] + at ($(current~page.south)+(.135\paperwidth,.35\paperheight)$) { \color{white} \begin{flushright} |