diff --git a/required/latex-lab/latex-lab-block.dtx b/required/latex-lab/latex-lab-block.dtx index 09529e3a7..b0f8315f6 100644 --- a/required/latex-lab/latex-lab-block.dtx +++ b/required/latex-lab/latex-lab-block.dtx @@ -9,7 +9,7 @@ % % https://www.latex-project.org/lppl.txt % -\def\ltlabblockdate{2024-12-01} +\def\ltlabblockdate{2025-01-06} \def\ltlabblockversion{0.8x} %<*driver> \documentclass[kernel]{l3doc} @@ -1749,7 +1749,7 @@ % \end{macrocode} % We start by looking at the user supplied keys in \texttt{\#1}. If % there aren't any we reset \cs{@@_evaluate_saved_user_keys:nn} to -% do nothing. Otherwise we evaluate and set the keys in the contect +% do nothing. Otherwise we evaluate and set the keys in the context % of the current list template. In addition we prepare % \cs{@@_evaluate_saved_user_keys:nn} for execution in the % template for \tn{item}. @@ -1760,8 +1760,25 @@ { \cs_set_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn } { \SetTemplateKeys{list}{std}{#1} +% \end{macrocode} +% The setup for \cs{@@_evaluate_saved_user_keys:nn} is a bit trcky +% and has to be done with \cs{cs_set:Npe} even though we don't want +% to expand anything and therefore use \cs{exp_not:n} inside. All +% this does is that any \texttt{\#} passed in via \texttt{\#1} is +% doubled (e.g., from \verb/label-format=\fbox{#1}/ which is +% represented as \verb/...\fbox{##1}/). Otherwise, we would end up +% with a replacement text like +%\begin{verbatim} +% \SetTemplateKeys {#1}{#2}{label-format=\fbox {#1}} +%\end{verbatim} +% instead of +%\begin{verbatim} +% \SetTemplateKeys {#1}{#2}{label-format=\fbox {##1}} +%\end{verbatim} +% resulting in very odd and puzzling behavior. +% \begin{macrocode} \cs_set:Npe \@@_evaluate_saved_user_keys:nn ##1##2 - { \SetTemplateKeys{##1}{##2}{ \exp_not:n{#1} } } + { \SetTemplateKeys{##1}{##2}{ \exp_not:n{ #1 } } } } % \end{macrocode} % Has this list a counter name defined in the instance?