summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/knowledge
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/knowledge')
-rw-r--r--Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx5
-rw-r--r--Master/texmf-dist/source/latex/knowledge/knowledge.dtx127
2 files changed, 111 insertions, 21 deletions
diff --git a/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx b/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx
index 93d265542c7..eb50a561027 100644
--- a/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx
+++ b/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx
@@ -377,7 +377,10 @@
\tl_gput_right:Nn\kaux_command_list_tl{#1}
}
\NewDocumentCommand\KAuxCommand{mmm}
- {\ProvideDocumentCommand#1{#2}{}}
+ { \cs_if_exist:NTF #1
+ {}
+ {\ProvideDocumentCommand#1{#2}}
+ }
% \end{macrocode}
%
% |\ActivateKAuxPhase{phase1,phase2,...}| sets the KAux commands to use
diff --git a/Master/texmf-dist/source/latex/knowledge/knowledge.dtx b/Master/texmf-dist/source/latex/knowledge/knowledge.dtx
index d76b1cab9ba..0732f7d91dd 100644
--- a/Master/texmf-dist/source/latex/knowledge/knowledge.dtx
+++ b/Master/texmf-dist/source/latex/knowledge/knowledge.dtx
@@ -23,9 +23,59 @@
%
% \iffalse
%<head>\usepackage{expl3}
-%<head>\ProvidesExplPackage{knowledge}{2017/10/10}{v1.06}{}
+%<head>\ProvidesExplPackage{knowledge}{2017/10/10}{v1.07}{}
%<*driver>
-\def\knowledgeversion{2017/10/10 v1.06}
+\def\knowledgeversion{v1.07}
+\def\knowledgedate{2017/10/13}
+\def\knowledgeversiondate{\knowledgeversion\ \knowledgedate}
+
+{
+\newwrite\tempfile
+\def\TXT#1{\expandafter\immediate\expandafter\write\expandafter\tempfile\expandafter{\detokenize{#1}}}
+\def\TXTx#1{\edef\tmp{\noexpand\TXT{#1}}\tmp}
+\immediate\openout\tempfile=README.txt
+\TXT{This directory contains the package}
+\TXT{}
+\TXT{ name: knowledge.sty }
+\TXTx{ version: \knowledgeversion }
+\TXTx{ date: \knowledgedate }
+\TXT{ license: LaTeX Project Public License version 1.2 or above }
+\TXT{ }
+\TXT{ author: Thomas Colcombet }
+\TXT{ mail: thomas.colcombet@irif.fr }
+\TXT{ web: https://www.irif.fr/~colcombe/knowledge_en.html }
+\TXT{ }
+\TXT{ }
+\TXT{ Purpose: }
+\TXT{ The knowledge package for LaTeX offers a systematic way to handle }
+\TXT{ notions/concepts/terms throughout a document. It helps building an }
+\TXT{ index. In combination with hyperref it makes it easy to have every }
+\TXT{ references of a concept linked to its introduction. It also offers }
+\TXT{ simple notations. }
+\TXT{ }
+\TXT{ }
+\TXT{Content of the file knowledge-sources.zip: }
+\TXT{ - README.txt: this file, generated while compiling knowledge.dtx }
+\TXT{ - knowledge.sty: the package file (generated) }
+\TXT{ - knowledge.pdf: the user documentation (generated) }
+\TXT{ - makefile: the makefile. Use 'make all' }
+\TXT{ to generate knowledge.sty and knowledge.pdf }
+\TXT{ - knowledge.dtx: the main file }
+\TXT{ (compiling it directly yields a developper version of the }
+\TXT{ documentation that contains the code. Use 'make all' }
+\TXT{ for the regular version. It also produces README.txt) }
+\TXT{ - all.ins: file generating knowledge.sty when compiled (docstrip) }
+\TXT{ - knowledge-configuration.dtx: file containing part of the configuration }
+\TXT{ - knowledge-utils.dtx: file containing several pieces of code not really }
+\TXT{ related specifically to knowledge }
+\TXT{ - knowledge-example.tex: an example file }
+\TXT{}
+\TXT{ Note: this file is created when compiling knowledge.dtx }
+\TXT{}
+\immediate\closeout\tempfile
+}
+
+
\documentclass{ltxdoc}
@@ -574,7 +624,7 @@
\begin{document}
\label{paper:top}
-\title{The \texttt{knowledge} package\\\small[\knowledgeversion]}
+\title{The \texttt{knowledge} package\\\small[\knowledgeversion{} --- \knowledgedate]}
\author{Thomas Colcombet \\ \texttt{thomas.colcombet@irif.fr}}
\maketitle
@@ -592,7 +642,9 @@ Eventually, it is intended to use the package for producing scientific semantic
\begin{quote}
\begin{tabular}{ll}
\texttt{contact:}&\texttt{thomas.colcombet@irif.fr}\\
-\texttt{version:}&\texttt{\knowledgeversion} (produced \today)\\
+\texttt{version:}&\texttt{\knowledgeversion}\\
+\texttt{date:}&\texttt{\knowledgedate}
+(produced \today)\\
\texttt{license:}&\texttt{LaTeX Project Public License 1.2}\\
\texttt{web:}&\url{https://www.irif.fr/~colcombe/knowledge_en.html}\\
\texttt{CTAN:}&\url{https://www.ctan.org/pkg/knowledge}
@@ -703,6 +755,7 @@ This is essentially a list for personal referencing of what has to be done.
\item[2017-09-26] Version 1.05 on CTAN.
\item[2017-10-10] Bug in the implementation of \cs{\knowledgenewvariant} (that was invisible). Found and corrected (thanks to Marc Zeitoun).
\item[2017-10-10] Version 1.06 on CTAN.
+\item[2017-10-15] Diagnose extended. Minor corrections. Version 1.07 on CTAN.
\end{compactdesc}
\normalsize
%\restoregeometry
@@ -1772,10 +1825,10 @@ more than once are listed. When a document reaches its final states, this secti
Note that this may be caused by an \cs{\intro} used in some title (and repeated in the table of contents).
\end{description}
-\AP By default, the "diagnose file" does give the file and the line as a comment before every error or warning it lists.
-This can be cancelled using the "diagnose line" boolean option:
+\AP By default, the "diagnose file" does not give the file and the line of the messages.
+This can be activated using the "diagnose line" boolean option:
\begin{center}
-\smallcode{\cs\knowledgeconfigure\{""diagnose line=""false\}}
+\smallcode{\cs\knowledgeconfigure\{""diagnose line=""true\}}
\end{center}
\iffalse
@@ -2457,6 +2510,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
% \changes{v1.04}{2017/07/28}{minor changes,bug fixes} %
% \changes{v1.05}{2017/09/26}{minor changes,bug fixes} %
% \changes{v1.06}{2017/10/10}{bug correction} %
+% \changes{v1.07}{2017/10/13}{minor improvements} %
% \GetFileInfo{knowledge.sty} %
% \DoNotIndex{}
%
@@ -2474,6 +2528,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
\RequirePackage{l3keys2e}
\RequirePackage{etoolbox}
\RequirePackage{xparse}
+\RequirePackage{etoolbox}
\bool_if_exist:NTF\knowledge_package_loaded_bool
{\endinput}
{\bool_new:N\knowledge_package_loaded_bool
@@ -2624,7 +2679,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
% At the same time, it sets at package loading these options to be `posponed' (these will be executed)
% when the package loading is completed.
% \begin{macrocode}
-\NewDocumentCommand\knowledgeconfigure{m}{
+\newrobustcmd\knowledgeconfigure[1]{
\keys_set:nn{ knowledge~configuration~options }{#1}
}
% \end{macrocode}
@@ -2693,7 +2748,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
% \end{quote}
% is similar to \cs{\KnowledgeConfigureTrigger} but only valid at package loading and not in \cs{\knowledgeconfigure}.
% \begin{macrocode}
-\NewDocumentCommand\KnowledgePackageTrigger{mm}
+\newrobustcmd\KnowledgePackageTrigger[2]
{ \keys_define:nn{ knowledge~package~options }{ #1 .code:n = {#2} }
\keys_define:nn{ knowledge~configuration~options }{
#1 .code:n = {\knowledge_error:n
@@ -2849,11 +2904,14 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
% is called for each package after the options have been processed.
% It loads the package if required, possibly with options.
% \begin{macrocode}
-\cs_new:Nn\knowledge_option_aci_autoload:nn{
+\cs_new:Nn\knowledge_option_aci_autoload:nnn{
\bool_if:cTF{knowledge_#1_active_bool}
{\package_if_loaded:nTF{#1}{}
- {\RequirePackage[#2]{#1}}}{}
+ {\RequirePackage[#2]{#1}{#3}}}
+ {}
}
+\cs_new:Nn\knowledge_option_aci_autoload:nn
+ {\knowledge_option_aci_autoload:nnn{#1}{#2}{}}
% \end{macrocode}
%
% \paragraph{The real options}
@@ -2931,7 +2989,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
%
% \subsubsection{Options post-treatment for the other packages}
% \begin{macrocode}
-\knowledge_option_aci_autoload:nn{ hyperref }{}
+\knowledge_option_aci_autoload:nnn{ hyperref }{}{\hypersetup{hidelinks}}
\knowledge_option_aci_autoload:nn{ xcolor }{}
\knowledge_option_aci_autoload:nn{ makeidx }{}
% \end{macrocode}
@@ -3117,7 +3175,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
%
% \AP The base command for configuring a scope is \csintro{\ScopeConfigure}\{area~list\}\{directives\}.
% \begin{macrocode}
-\NewDocumentCommand\ScopeConfigure{mm}
+\newrobustcmd\ScopeConfigure[2]
{\scope_area_set:nn{#1}{#2}}
% \end{macrocode}
% \begin{macrocode}
@@ -3811,7 +3869,20 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
%
\msg_warning:nn{knowledge}{recap~autoref~not~introduced}
}
- %
+ \int_compare:nNnT\kl_digest_autorefunused_int>0{
+ \knowledge_diagnose:n{***********************************}
+ \knowledge_diagnose:n{*~Autoref~introduced~but~not~used~*}
+ \knowledge_diagnose:n{***********************************}
+ \knowledge_diagnose:n{}
+ %
+ \knowledge_diagnose_reset_line:
+ \KAuxProcess{autoref-introduced-not-used}
+ %
+ \knowledge_diagnose:n{}
+ \knowledge_diagnose:n{}
+ %
+ }
+ %
\iffalse
\knowledge_diagnose:n{***********************}
\knowledge_diagnose:n{*~Exported~knowledges~*}
@@ -4161,7 +4232,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
{\knowledge_set_now:nnnn{#1}{#2}{#3}{#4}}
% \end{macrocode}
% \begin{macrocode}
-\NewKAuxCommand\KAuxExport{mmmm}
+\newrobustcmd\KAuxExport[4]
{Package~knowledge:~undefined~so~far.}
% \end{macrocode}
%
@@ -4573,6 +4644,7 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
{{#1}{#2}{\exp_not:n{#3}}}
\exp_args:NNc\tl_set:Nn\knowledge_kl_resourcetoken_tl
{\knowledge_id:nnn{#1}{#2}{#3}}
+ \expandafter\ktuple_countuse_gincr:N\knowledge_kl_resourcetoken_tl
%
\tl_clear:N\knowledge_kl_link_tl
\tl_clear:N\knowledge_kl_linkscope_tl
@@ -5118,10 +5190,14 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
\knowledge_at:N\ktuple_countuse_get_int:NN\kl_countuse_int
\knowledge_at:N\ktuple_countintro_get_int:NN\kl_countintro_int
\int_compare:nNnT\kl_countintro_int=1
- {\int_gincr:N\kl_digest_autorefused_int}
- \int_compare:nNnT\kl_countintro_int=0
- {\int_compare:nNnTF\kl_countuse_int=0
+ {
+ \int_compare:nNnTF\kl_countuse_int=1
{\int_gincr:N\kl_digest_autorefunused_int}
+ {\int_gincr:N\kl_digest_autorefused_int}
+ }
+ \int_compare:nNnT\kl_countintro_int=0
+ {\int_compare:nNnF\kl_countuse_int=0
+ %{\int_gincr:N\kl_digest_autorefunused_int}
{\int_gincr:N\kl_digest_autorefnointro_int}}
\int_compare:nNnT\kl_countintro_int>1
{\int_gincr:N\kl_digest_autoreftwiceintro_int}
@@ -5137,6 +5213,17 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
{\knowledge_diagnose_line:
\knowledge_diagnose:n{\nointro{#1}{#2}{#3}}}}
\group_end:}
+\DeclareKAuxPhaseCommand\KAuxAutoref{autoref-introduced-not-used}
+ {\group_begin:
+ \knowledge_sets_to:nnn{#1}{#2}{#3}
+ \knowledge_at:N\ktuple_countuse_get_int:NN\kl_countuse_int
+ \knowledge_at:N\ktuple_countintro_get_int:NN\kl_countintro_int
+ \int_compare:nNnT\kl_countuse_int=1
+ {\int_compare:nNnT\kl_countintro_int=1
+ {\knowledge_diagnose_line:
+ \knowledge_diagnose:x{\kaux_current_location:\space
+ \exp_not:n{{#3}{#1}{#2}}}}}
+ \group_end:}
\DeclareKAuxPhaseCommand\KAuxAutorefTarget{autoref-introduced-twice}
{\group_begin:
\knowledge_sets_to:nnn{#1}{#2}{#3}
@@ -5144,7 +5231,8 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
\knowledge_at:N\ktuple_countintro_get_int:NN\kl_countintro_int
\int_compare:nNnT\kl_countintro_int>1
{\knowledge_diagnose_line:
- \knowledge_diagnose:x{\kaux_current_location:\space\exp_not:n{knowledge={#3},namespace=#1,scope=#2}}}
+ \knowledge_diagnose:x{\kaux_current_location:\space
+ \exp_not:n{{#3}{#1}{#2}}}}
\group_end:}
% \end{macrocode}
% \begin{macrocode}
@@ -5598,7 +5686,6 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
% creating the pdf names of sections (for avoiding warnings of the "hyperref@@package").
% \begin{macrocode}
\bool_if:NT\knowledge_hyperref_active_bool{
- \hypersetup{hidelinks}
\DeclareExpandableDocumentCommand\knowledge_fake_klTKS{mmm}{#1}
\pdfstringdefDisableCommands{%
\let\klTKS\knowledge_fake_klTKS