diff options
author | Karl Berry <karl@freefriends.org> | 2024-07-15 21:37:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-07-15 21:37:37 +0000 |
commit | 03841d704642b23c2f3019d0b8922e198ab4868d (patch) | |
tree | 9d4d9da41d75d335c568695dbd8d33c9e81ff52e /Master/texmf-dist/tex/latex | |
parent | 4320a78558317d5c6c80ce26a11d9bd30c6164aa (diff) |
passopt (15jul24)
git-svn-id: svn://tug.org/texlive/trunk@71811 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/passopt/passopt.sty | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/passopt/passopt.sty b/Master/texmf-dist/tex/latex/passopt/passopt.sty index f0f3a7d7b9e..b5c24ed9a30 100644 --- a/Master/texmf-dist/tex/latex/passopt/passopt.sty +++ b/Master/texmf-dist/tex/latex/passopt/passopt.sty @@ -8,53 +8,49 @@ % The latest version of this license is in % https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2021/11/15] -\ProvidesExplPackage{passopt}{2024/07/11}{1.00b} +\ProvidesExplPackage{passopt}{2024/07/15}{1.01} {Passing options to packages or classes} -\cs_generate_variant:Nn \tl_if_blank:nF { v } -\cs_new:Npn \po_save_option_list:n #1 { #1 } -\cs_new:Npn \po_add_before_hook:nnn #1#2 - { \AddToHook{#1/#2/before}[passopt] } -\NewDocumentCommand{\SetOptionsToPackage}{smm} +\cs_generate_variant:Nn \tl_if_blank:nTF { v } +\cs_new_protected:Npn \po_add_before_hook:nnn #1#2 + { \hook_gput_code:nnn { #1/#2/before } { passopt } } +\cs_new_protected:Npn \po_set_options_list:nnnnn #1#2#3#4#5 { - \po_add_before_hook:nnn { package } {#3} + \po_add_before_hook:nnn {#1} {#5} { - \cs_gset:cpx { @raw@opt@#3.sty } + \cs_set:cpx { @raw@opt@#5.#2 } { - \IfBooleanF{#1} + \IfBooleanTF{#3} + {\exp_not:o {#4}} { - \tl_if_blank:vF { opt@#3.sty } - { \use:c { opt@#3.sty }, } + \tl_if_blank:vTF { @raw@opt@#5.#2 } + { \exp_not:o {#4} } + { \exp_not:v { @raw@opt@#5.#2 },\exp_not:o {#4} } } - \po_save_option_list:n {#2} + } + \exp_args:Nc \protected@edef { opt@#5.#2 } + { + \exp_last_unbraced:Nv + \zap@space { @raw@opt@#5.#2 }~\@empty } } } -\NewDocumentCommand{\SetOptionsToClass}{smm} +\cs_new_protected:Npn \po_clear_options_list:nnn #1#2#3 { - \po_add_before_hook:nnn { class } {#3} + \po_add_before_hook:nnn {#1} {#3} { - \cs_gset:cpx { @raw@opt@#3.cls } - { - \IfBooleanF{#1} - { - \tl_if_blank:vF { opt@#3.cls } - { \use:c { opt@#3.cls }, } - } - \po_save_option_list:n {#2} - } + \tl_clear:c { @raw@opt@#3.#2 } + \tl_clear:c { opt@#3.#2 } } } +\NewDocumentCommand{\SetOptionsToPackage}{smm} + {\po_set_options_list:nnnnn { package } { sty } {#1} {#2} {#3}} +\NewDocumentCommand{\SetOptionsToClass}{smm} + {\po_set_options_list:nnnnn { class } { cls } {#1} {#2} {#3}} \cs_new_protected:Npn \ClearPackageOptions #1 - { - \po_add_before_hook:nnn { package } {#1} - { \tl_clear:c { opt@#1.sty } } - } + { \po_clear_options_list:nnn { package } { sty } {#1} } \cs_new_protected:Npn \ClearClassOptions #1 - { - \po_add_before_hook:nnn { class } {#1} - { \tl_clear:c { opt@#1.cls } } - } + { \po_clear_options_list:nnn { class } { cls } {#1} } \endinput % % End of file `passopt.sty'.
\ No newline at end of file |