From ce5d9ad8db5d1a5ff89837ffa5ecd10a7c8072f0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Jan 2020 21:55:12 +0000 Subject: knowledge (27jan20) git-svn-id: svn://tug.org/texlive/trunk@53572 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/knowledge/knowledge.sty | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/knowledge/knowledge.sty b/Master/texmf-dist/tex/latex/knowledge/knowledge.sty index fab365a87c9..f7109832895 100644 --- a/Master/texmf-dist/tex/latex/knowledge/knowledge.sty +++ b/Master/texmf-dist/tex/latex/knowledge/knowledge.sty @@ -23,7 +23,7 @@ %% LaTeX version 1999/12/01 or later. %% \usepackage{expl3} -\ProvidesExplPackage{knowledge}{2019/12/03}{1.20}{} +\ProvidesExplPackage{knowledge}{2020/01/26}{1.21}{} %%%%%%%%%% \RequirePackage{l3keys2e} \RequirePackage{etoolbox} @@ -1476,8 +1476,8 @@ \knowledge_scopetag_ensure:n{#1} \bool_if:cTF{\knowledge_scopetag_tl[#1]_bool} {} - {\KAuxWriteX*{\exp_not:N\KAuxDeclaredScopeTag{#1}} - \bool_gset_true:c{\knowledge_scopetag_tl[#1]_bool}} + {\bool_gset_true:c{\knowledge_scopetag_tl[#1]_bool}} + \KAuxWriteX*{\exp_not:N\KAuxDeclaredScopeTag{#1}} } \NewDocumentCommand\knowledgescope{ >{\SplitList{,}}m }{ \kl_hide_begin:\group_begin: @@ -1493,18 +1493,18 @@ \bool_gset_true:N\knowledge_configuration_label_autoscope_bool \KnowledgeConfigureBooleanOption[\knowledge_configuration_label_autoscope_bool]{patch~label} \KnowledgeConfigureBooleanOption[\knowledge_configuration_label_autoscope_bool]{label~scope} -\NewDocumentCommand\knowledgelabel{m}{ - \kl_hide_begin: - \bool_if:NTF +\global\let\knowledge_label_before_loading_package:n\label +\cs_gset:Npn\label{ + \mode_if_preamble:TF + \knowledge_label_in_preamble:n + \knowledge_label_before_loading_package:n +} +\cs_new:Npn\knowledge_label_in_preamble:n{ + \bool_if:NTF \knowledge_configuration_label_autoscope_bool \knowledge_knowledgescope_one:n \use_none:n - {#1} - \kl_hide_end: - \cs_if_exist:NTF\LaTeXlabel\LaTeXlabel\use_none:n{#1} } -\let\scopeLabel\knowledgelabel%for backward compatibility -\let\label\knowledgelabel \cs_new:Npn\knowledge_latex_label:n{ \cs_if_exist:NTF\LaTeXlabel\LaTeXlabel\label } @@ -1578,8 +1578,13 @@ \scope_if_triggers_area:nTF{##1} {\scope_area_pop:n{##1}} {}} - \kutils_secure_latex_command:N\label - \let\label\knowledgelabel +} +\AtBeginDocument{ + \kutils_secure_latex_command:N\label + \def\label#1{\bool_if:NT + \knowledge_configuration_label_autoscope_bool + {\knowledge_knowledgescope_one:n{#1}} + \LaTeXlabel{#1}} } \NewDocumentCommand\ScopeActivate{}{ \cs_gset_eq:NN\ScopeActivate\relax @@ -1633,7 +1638,7 @@ {\scope_area_pop:n{knowledge~import~internal}} \NewDocumentEnvironment{knowledge~context}{m} {\ScopeActivate\scope_area_push:n{knowledge~context~internal} - \knowledgelabel{#1}} + \knowledgescope{#1}} {\scope_area_pop:n{knowledge~context~internal}} \KAuxBefore{\IfKAuxReadyTF{\KAuxProcess{init}}{}} \KAuxInit{} -- cgit v1.2.3