diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3keys.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3keys.dtx | 84 |
1 files changed, 51 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 54167b15c25..8045b98036a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-01-12} +% \date{Released 2020-01-22} % % \maketitle % @@ -270,22 +270,26 @@ % does not trigger an error. % \end{function} % -% \begin{function}{.dim_set:N, .dim_set:c, .dim_gset:N, .dim_gset:c} +% \begin{function}[updated = 2020-01-17] +% {.dim_set:N, .dim_set:c, .dim_gset:N, .dim_gset:c} % \begin{syntax} % \meta{key} .dim_set:N = \meta{dimension} % \end{syntax} % Defines \meta{key} to set \meta{dimension} to \meta{value} (which % must a dimension expression). If the variable does not exist, it -% is created globally at the point that the key is set up. +% is created globally at the point that the key is set up. The key will +% require a value at point-of-use unless a default is set. % \end{function} % -% \begin{function}{.fp_set:N, .fp_set:c, .fp_gset:N, .fp_gset:c} +% \begin{function}[updated = 2020-01-17] +% {.fp_set:N, .fp_set:c, .fp_gset:N, .fp_gset:c} % \begin{syntax} % \meta{key} .fp_set:N = \meta{floating point} % \end{syntax} % Defines \meta{key} to set \meta{floating point} to \meta{value} % (which must a floating point expression). If the variable does not exist, -% it is created globally at the point that the key is set up. +% it is created globally at the point that the key is set up. The key will +% require a value at point-of-use unless a default is set. % \end{function} % % \begin{function}[added = 2013-07-14] @@ -329,13 +333,15 @@ % \end{quote} % \end{function} % -% \begin{function}{.int_set:N, .int_set:c, .int_gset:N, .int_gset:c} +% \begin{function}[updated = 2020-01-17] +% {.int_set:N, .int_set:c, .int_gset:N, .int_gset:c} % \begin{syntax} % \meta{key} .int_set:N = \meta{integer} % \end{syntax} % Defines \meta{key} to set \meta{integer} to \meta{value} (which % must be an integer expression). If the variable does not exist, it -% is created globally at the point that the key is set up. +% is created globally at the point that the key is set up. The key will +% require a value at point-of-use unless a default is set. % \end{function} % % \begin{function}[updated = 2013-07-10]{.meta:n} @@ -382,14 +388,15 @@ % Choices are discussed in detail in section~\ref{sec:l3keys:choice}. % \end{function} % -% \begin{function}[added = 2019-05-05] +% \begin{function}[added = 2019-05-05, updated = 2020-01-17] % {.muskip_set:N, .muskip_set:c, .muskip_gset:N, .muskip_gset:c} % \begin{syntax} % \meta{key} .muskip_set:N = \meta{muskip} % \end{syntax} % Defines \meta{key} to set \meta{muskip} to \meta{value} (which % must be a muskip expression). If the variable does not exist, it -% is created globally at the point that the key is set up. +% is created globally at the point that the key is set up. The key will +% require a value at point-of-use unless a default is set. % \end{function} % % \begin{function}[added = 2019-01-31] @@ -403,13 +410,15 @@ % is created globally at the point that the key is set up. % \end{function} % -% \begin{function}{.skip_set:N, .skip_set:c, .skip_gset:N, .skip_gset:c} +% \begin{function}[updated = 2020-01-17] +% {.skip_set:N, .skip_set:c, .skip_gset:N, .skip_gset:c} % \begin{syntax} % \meta{key} .skip_set:N = \meta{skip} % \end{syntax} % Defines \meta{key} to set \meta{skip} to \meta{value} (which % must be a skip expression). If the variable does not exist, it -% is created globally at the point that the key is set up. +% is created globally at the point that the key is set up. The key will +% require a value at point-of-use unless a default is set. % \end{function} % % \begin{function}{.tl_set:N, .tl_set:c, .tl_gset:N, .tl_gset:c} @@ -1145,7 +1154,7 @@ % One message for the low level parsing system. % \begin{macrocode} \__kernel_msg_new:nnnn { kernel } { misplaced-equals-sign } - { Misplaced~equals~sign~in~key-value~input~\msg_line_number: } + { Misplaced~equals~sign~in~key-value~input~\msg_line_context: } { LaTeX~is~attempting~to~parse~some~key-value~input~but~found~ two~equals~signs~not~separated~by~a~comma. @@ -1591,6 +1600,7 @@ \cs_set_nopar:cpx { \c_@@_default_root_tl \l_keys_path_tl } { \exp_not:n {#1} } + \@@_value_requirement:nn { required } { false } } } % \end{macrocode} @@ -1766,6 +1776,7 @@ % \end{macro} % % \begin{macro}{\@@_variable_set:NnnN, \@@_variable_set:cnnN} +% \begin{macro}{\@@_variable_set_required:NnnN, \@@_variable_set_required:cnnN} % Setting a variable takes the type and scope separately so that % it is easy to make a new variable if needed. % \begin{macrocode} @@ -1780,8 +1791,15 @@ } } \cs_generate_variant:Nn \@@_variable_set:NnnN { c } +\cs_new_protected:Npn \@@_variable_set_required:NnnN #1#2#3#4 + { + \@@_variable_set:NnnN #1 {#2} {#3} #4 + \@@_value_requirement:nn { required } { true } + } +\cs_generate_variant:Nn \@@_variable_set_required:NnnN { c } % \end{macrocode} % \end{macro} +% \end{macro} % % \subsection{Creating key properties} % @@ -1895,13 +1913,13 @@ % Setting a variable is very easy: just pass the data along. % \begin{macrocode} \cs_new_protected:cpn { \c_@@_props_root_tl .dim_set:N } #1 - { \@@_variable_set:NnnN #1 { dim } { } n } + { \@@_variable_set_required:NnnN #1 { dim } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .dim_set:c } #1 - { \@@_variable_set:cnnN {#1} { dim } { } n } + { \@@_variable_set_required:cnnN {#1} { dim } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .dim_gset:N } #1 - { \@@_variable_set:NnnN #1 { dim } { g } n } + { \@@_variable_set_required:NnnN #1 { dim } { g } n } \cs_new_protected:cpn { \c_@@_props_root_tl .dim_gset:c } #1 - { \@@_variable_set:cnnN {#1} { dim } { g } n } + { \@@_variable_set_required:cnnN {#1} { dim } { g } n } % \end{macrocode} % \end{macro} % \end{macro} @@ -1911,13 +1929,13 @@ % Setting a variable is very easy: just pass the data along. % \begin{macrocode} \cs_new_protected:cpn { \c_@@_props_root_tl .fp_set:N } #1 - { \@@_variable_set:NnnN #1 { fp } { } n } + { \@@_variable_set_required:NnnN #1 { fp } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .fp_set:c } #1 - { \@@_variable_set:cnnN {#1} { fp } { } n } + { \@@_variable_set_required:cnnN {#1} { fp } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .fp_gset:N } #1 - { \@@_variable_set:NnnN #1 { fp } { g } n } + { \@@_variable_set_required:NnnN #1 { fp } { g } n } \cs_new_protected:cpn { \c_@@_props_root_tl .fp_gset:c } #1 - { \@@_variable_set:cnnN {#1} { fp } { g } n } + { \@@_variable_set_required:cnnN {#1} { fp } { g } n } % \end{macrocode} % \end{macro} % \end{macro} @@ -1957,13 +1975,13 @@ % Setting a variable is very easy: just pass the data along. % \begin{macrocode} \cs_new_protected:cpn { \c_@@_props_root_tl .int_set:N } #1 - { \@@_variable_set:NnnN #1 { int } { } n } + { \@@_variable_set_required:NnnN #1 { int } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .int_set:c } #1 - { \@@_variable_set:cnnN {#1} { int } { } n } + { \@@_variable_set_required:cnnN {#1} { int } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .int_gset:N } #1 - { \@@_variable_set:NnnN #1 { int } { g } n } + { \@@_variable_set_required:NnnN #1 { int } { g } n } \cs_new_protected:cpn { \c_@@_props_root_tl .int_gset:c } #1 - { \@@_variable_set:cnnN {#1} { int } { g } n } + { \@@_variable_set_required:cnnN {#1} { int } { g } n } % \end{macrocode} % \end{macro} % \end{macro} @@ -2012,13 +2030,13 @@ % Setting a variable is very easy: just pass the data along. % \begin{macrocode} \cs_new_protected:cpn { \c_@@_props_root_tl .muskip_set:N } #1 - { \@@_variable_set:NnnN #1 { muskip } { } n } + { \@@_variable_set_required:NnnN #1 { muskip } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .muskip_set:c } #1 - { \@@_variable_set:cnnN {#1} { muskip } { } n } + { \@@_variable_set_required:cnnN {#1} { muskip } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .muskip_gset:N } #1 - { \@@_variable_set:NnnN #1 { muskip } { g } n } + { \@@_variable_set_required:NnnN #1 { muskip } { g } n } \cs_new_protected:cpn { \c_@@_props_root_tl .muskip_gset:c } #1 - { \@@_variable_set:cnnN {#1} { muskip } { g } n } + { \@@_variable_set_required:cnnN {#1} { muskip } { g } n } % \end{macrocode} % \end{macro} % @@ -2041,13 +2059,13 @@ % Setting a variable is very easy: just pass the data along. % \begin{macrocode} \cs_new_protected:cpn { \c_@@_props_root_tl .skip_set:N } #1 - { \@@_variable_set:NnnN #1 { skip } { } n } + { \@@_variable_set_required:NnnN #1 { skip } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .skip_set:c } #1 - { \@@_variable_set:cnnN {#1} { skip } { } n } + { \@@_variable_set_required:cnnN {#1} { skip } { } n } \cs_new_protected:cpn { \c_@@_props_root_tl .skip_gset:N } #1 - { \@@_variable_set:NnnN #1 { skip } { g } n } + { \@@_variable_set_required:NnnN #1 { skip } { g } n } \cs_new_protected:cpn { \c_@@_props_root_tl .skip_gset:c } #1 - { \@@_variable_set:cnnN {#1} { skip } { g } n } + { \@@_variable_set_required:cnnN {#1} { skip } { g } n } % \end{macrocode} % \end{macro} % \end{macro} @@ -2711,7 +2729,7 @@ \cs_set:Npn \@@_trim_spaces_auxiii:w #1 / { \quark_if_recursion_tail_stop:n {#1} - \tl_trim_spaces:n { / #1 } + / \tl_trim_spaces:n { #1 } \@@_trim_spaces_auxiii:w } % \end{macrocode} |