diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx | 88 |
1 files changed, 47 insertions, 41 deletions
diff --git a/Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx b/Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx index b05e9b8cdf8..1828e3d2aa6 100644 --- a/Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx +++ b/Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx @@ -23,7 +23,7 @@ % % \iffalse %<head>\usepackage{expl3} -%<head>\ProvidesExplPackage{knowledge}{2018/02/17}{1.10}{} +%<head>\ProvidesExplPackage{knowledge}{2018/05/17}{1.11}{} %<*driver> \def\knowledgecode{active} \input{knowledge.tex} @@ -42,7 +42,8 @@ % \changes{1.07}{2017/10/15}{minor improvements} % % \changes{1.08}{2017/10/17}{minor changes and reorganization of the files} % % \changes{1.09}{2017/10/31}{minor changes} % -% \changes{1.10}{2018/17/02}{bug fixes} % +% \changes{1.10}{2018/02/17}{bug fixes} % +% \changes{1.11}{2018/05/17}{bug fixes} % % \GetFileInfo{knowledge.sty} % % \DoNotIndex{} % @@ -62,8 +63,8 @@ This directory contains the package name: knowledge license: LaTeX Project Public License version 1.2 or above - version: v1.10 - date: 2018/02/17 + version: v1.11 + date: 2018/05/17 author: Thomas Colcombet mail: thomas.colcombet@irif.fr web: https://www.irif.fr/~colcombe/knowledge_en.html @@ -244,6 +245,7 @@ Content of the file knowledge-sources.zip: {Some~knowledge~is~used~but~not~introduced.~See~the~'.diagnose'~file~for~more~information.} % \end{macrocode} % +% % \subsection{Option and packages} % % @@ -1050,6 +1052,7 @@ Content of the file knowledge-sources.zip: % \end{macrocode} % \begin{macrocode} \cs_new:Nn\scope_internal_push:n { + \ScopeActivate \tl_gset:Nn\scope_top_area_tl{#1} \int_gincr:c{\scope_tl.area[\scope_top_area_tl].nesting_int} \int_gincr:c{\scope_tl.area[\scope_top_area_tl].count_int} @@ -1301,15 +1304,15 @@ Content of the file knowledge-sources.zip: % like knowledge. % \begin{macrocode} \NewDocumentCommand\ScopeActivate{}{ - \scope_internal_push:n{base} \cs_gset_eq:NN\ScopeActivate\relax + \scope_internal_push:n{base} } \AtBeginDocument{\ScopeActivate} % \end{macrocode} % % \begin{macrocode} \AtBeginDocument{\ScopeHackEnvironments} -%\AtEndDocument{\scope_area_pop:n{document}} +\AtEndDocument{\scope_area_pop:n{document}} % \end{macrocode} % % \begin{macrocode} @@ -1335,7 +1338,7 @@ Content of the file knowledge-sources.zip: {body}{knowledge=none} % \newenvironment{scope} - {\mode_if_preamble:TF{\scope_area_push:n{scope}}{}} + {\mode_if_preamble:TF{\ScopeActivate\scope_area_push:n{scope}}{}} {\mode_if_preamble:TF{\scope_area_pop:n{scope}}{}} \knowledgeconfigureenvironment{scope}{} % \end{macrocode} @@ -2069,11 +2072,12 @@ Content of the file knowledge-sources.zip: % % % The \cs{\kl}, and its internal version \cs{\klTKS} are the central ones in the package. Indeed, all commands such as \cs{\intro}, \cs{\phantomintro}, \cs{\reintro} or the \kl{"...@...@..."} notation eventually end to a call to these functions. -% -% Essentially, \cs{\kl} parses its parameters, and then call its internal version \cs{\knowledge_klTKS:nnn} +%\AP Essentially, \cs{\kl} parses its parameters, and then call its internal version \cs{\knowledge_klTKS:nnn} % with proper parameters: Text, Knowledge, Scope (the scope can be empty): +% +% \AP The macro \csintro{\knowledge_kl:w} is the part of \cs{\kl}-like commands that parses the arguments, and then calls \cs{\knowledge_klTKS:nnn} with proper arguments. % \begin{macrocode} -\NewDocumentCommand\__kl:w{d() o d() m}{ +\NewDocumentCommand\knowledge_kl:w{d() o d() m}{ \IfNoValueTF{#1} {\IfNoValueTF{#3} {\IfNoValueTF{#2} @@ -2088,11 +2092,13 @@ Content of the file knowledge-sources.zip: } % \end{macrocode} % -% The following macro, \cs{\knowledge_klTKS:nnn} is the internal version of \cs{\kl}. it takes explicitely the text to be displayed, +% \AP The following macro, \csintro{\knowledge_klTKS:nnn} is an internal version of \cs{\kl}-like commands. it takes explicitely the text to be displayed, % followed by the \kl{knowledge name} to be used, and a \kl{label} pointing to the \kl[instance]{instance of scope} -% in which the \kl{knowledge name} has to searched. This \kl{label} can be empty, and in this case, this means that +% in which the \kl{knowledge name} has to be searched for. This \kl{label} can be empty, and in this case, this means that % the stack of instances that are visible in the context of the call of the command should be inspected for searching for -% the knowledge. There exists a version \cs{\klTKS} which can be used, and does not require the \kl(package){expl3} syntax. +% the knowledge. +% \AP The macro \csintro{\klTKS} is a version of \cs{\knowledge_klTKS:nnn} +% that can be used without the "expl3@@package" syntax. % \begin{macrocode} \tl_clear_new:N\knowledge_kl_text_tl \tl_clear_new:N\knowledge_kl_base_key_tl @@ -2148,10 +2154,10 @@ Content of the file knowledge-sources.zip: % and then launches the search. % % -% The core of the \cs{\kl} command is \csintro{\knowledge_kl_find:}. +%\AP The core of the \cs{\kl} command is \csintro{\knowledge_kl_find:}. % It uses the variables \cs{\knowledge_kl_recursion_int} for checking non-recursion. % It searches for the entry \cs{\knowledge_kl_key_tl}, either in searching in the \kl{stack of visible scope instances}, -% or following \cs{\knowledge_kl_linkscope_tl} if the label exist. +% or following \cs{\knowledge_kl_linkscope_tl} if the label exists. % It first works on whether a scope label is given or not: % \begin{macrocode} \cs_set:Nn\knowledge_kl_find:{ @@ -2505,7 +2511,7 @@ Content of the file knowledge-sources.zip: % \NewDocumentCommand#1{s} {\knowledge_kl_modifiers_add:N#1 - \IfBooleanF{##1}{\__kl:w}} + \IfBooleanF{##1}{\knowledge_kl:w}} % \tl_new_eq:cN {knowledge_kl_\cs_to_str:N#1_namespace_tl} @@ -2614,25 +2620,25 @@ Content of the file knowledge-sources.zip: % When defining a new use of \texttt{knowledge}, many macros have to be taken into account. % Some have to be defined explicitly. Some other have default behaviours. % \begin{asparaitem} -% \item \csintro{\knowledge_kl_display_preprocess_tl} is the code to be used first before displaying. It does nothing for \cs{\kl}, but is set to \cs{\knowledge_kl_target_preprocess_tl} for \cs{\intro}, which performs the \cs{\label} command fir the introduction. -% \item \csintro{\knowledge_kl_display_process_tl} is the code to be executed for displaying the \kl{knowledge}. This is not defined by default. -% \item \csintro{\knowledge_kl_error_unknown:} The fallback code to execute when the \kl{knowledge} is unknown. +% \itemAP \csintro{\knowledge_kl_display_preprocess_tl} is the code to be used first before displaying. It does nothing for \cs{\kl}, but is set to \cs{\knowledge_kl_target_preprocess_tl} for \cs{\intro}, which performs the \cs{\label} command fir the introduction. +% \itemAP \csintro{\knowledge_kl_display_process_tl} is the code to be executed for displaying the \kl{knowledge}. This is not defined by default. +% \itemAP \csintro{\knowledge_kl_error_unknown:} The fallback code to execute when the \kl{knowledge} is unknown. % By default, it displays a warning and put the name in orange. -% \item \csintro{\knowledge_kl_update:N} is a code to be executed to update the knowledge. By default, it increments the ktuple counter `\cs{countuse_int}'. -% \item \csintro{\knowledge_kl_namespace_tl} is the \kl{namespace} in which the \kl{knowledge} is to be searched. Not defined by default. -% \item \csintro{\knowledge_kl_linkscope_tl} is a label that points to an instance of a \kl{scope}. It can be empty, and in this case, this means that the search proceeds in the \kl{stack of visible scope instances}. By default it is empty. -% \item \csintro{\knowledge_kl_max_recursion_int} is the maximum number of recursion allowed when searching for a \kl{knowledge}. It is by default 40. +% \itemAP \csintro{\knowledge_kl_update:N} is a code to be executed to update the knowledge. By default, it increments the ktuple counter `\cs{countuse_int}'. +% \itemAP \csintro{\knowledge_kl_namespace_tl} is the \kl{namespace} in which the \kl{knowledge} is to be searched. Not defined by default. +% \itemAP \csintro{\knowledge_kl_linkscope_tl} is a label that points to an instance of a \kl{scope}. It can be empty, and in this case, this means that the search proceeds in the \kl{stack of visible scope instances}. By default it is empty. +% \itemAP \csintro{\knowledge_kl_max_recursion_int} is the maximum number of recursion allowed when searching for a \kl{knowledge}. It is by default 40. % \end{asparaitem} % % The codes can uses internally the following variables, that are accessible for the user when defining new \cs\kl-like commands: % \begin{asparaitem} -% \item \csintro{\knowledge_kl_command_tl} the command that has triggered the search -% \item \csintro{\knowledge_kl_base_key_tl} contains the name of the knowledge for which the search has started, -% \item \csintro{\knowledge_kl_text_tl} contains the text to be displayed, -% \item \csintro{\knowledge_kl_key_tl} contains the name of the knowledge searched at a particular moment, -% \item \csintro{\knowledge_kl_recursion_int} counts the number of indirection in the current, starting from \cs{\knowledge_kl_max_recursion_int}, and going down, -% \item \csintro{\knowledge_kl_link_tl} contains the link to be followed. -% \item \cs{\knowledge_kl_resourcetoken_tl} contains a single token, which is the location of the knowledge. +% \itemAP \csintro{\knowledge_kl_command_tl} the command that has triggered the search +% \itemAP \csintro{\knowledge_kl_base_key_tl} contains the name of the knowledge for which the search has started, +% \itemAP \csintro{\knowledge_kl_text_tl} contains the text to be displayed, +% \itemAP \csintro{\knowledge_kl_key_tl} contains the name of the knowledge searched at a particular moment, +% \itemAP \csintro{\knowledge_kl_recursion_int} counts the number of indirection in the current, starting from \cs{\knowledge_kl_max_recursion_int}, and going down, +% \itemAP \csintro{\knowledge_kl_link_tl} contains the link to be followed. +% \itemAP \cs{\knowledge_kl_resourcetoken_tl} contains a single token, which is the location of the knowledge. % \end{asparaitem} % % \begin{macrocode} @@ -2960,11 +2966,11 @@ Content of the file knowledge-sources.zip: {\int_compare:nNnTF\l_tmpa_int=1 {} {\int_to_alph:n\l_tmpa_int}} \exp_args:Nx\label{\exp_not:V\knowledge_kl_autoref_tl\l_tmpa_tl}} - \expandafter\ktuple_countintro_gincr:N - \knowledge_kl_resourcetoken_tl - \KAuxWriteX - {\exp_not:N\KAuxAutorefTarget - \exp_not:o\knowledge_kl_resourcearguments_tl}} + \expandafter\ktuple_countintro_gincr:N + \knowledge_kl_resourcetoken_tl + \KAuxWriteX + {\exp_not:N\KAuxAutorefTarget + \exp_not:o\knowledge_kl_resourcearguments_tl}} } \cs_new:Nn\knowledge_kl_compute_code_makeidx:{ \tl_if_exist_ne:NTF\knowledge_kl_index_tl @@ -3472,15 +3478,15 @@ Content of the file knowledge-sources.zip: \knowledgenewvariant\kl{ - namespace=default, - default style={kl,autoref link}, + namespace= default, + default style= {kl,autoref link}, unknown style= kl unknown, - unknown style cont=kl unknown cont, + unknown style cont= kl unknown cont, style directive={style} } \knowledgenewvariant\intro{ - namespace=default, - default style={intro,autoref target}, + namespace= default, + default style= {intro,autoref target}, unknown style= intro unknown, unknown style cont= intro unknown cont, style directive= intro style @@ -3634,7 +3640,7 @@ Content of the file knowledge-sources.zip: \exp_args:NNV\ExplSyntaxOff\knowledgeconfigure\knowledge_configuration_pending_tl % \end{macrocode} % \begin{macrocode} -\ScopeActivate +%\ScopeActivate % \end{macrocode} %</tail> % |