summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/knowledge/README.md4
-rw-r--r--Master/texmf-dist/doc/latex/knowledge/knowledge.pdfbin721136 -> 729501 bytes
-rw-r--r--Master/texmf-dist/doc/latex/knowledge/knowledge.tex135
-rw-r--r--Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx50
-rw-r--r--Master/texmf-dist/tex/latex/knowledge/knowledge.sty32
5 files changed, 164 insertions, 57 deletions
diff --git a/Master/texmf-dist/doc/latex/knowledge/README.md b/Master/texmf-dist/doc/latex/knowledge/README.md
index 398b3d74bfb..864921ac527 100644
--- a/Master/texmf-dist/doc/latex/knowledge/README.md
+++ b/Master/texmf-dist/doc/latex/knowledge/README.md
@@ -3,8 +3,8 @@ This directory contains the package
name: knowledge
license: LaTeX Project Public License version 1.2 or above
- version: v1.21
- date: 2020/01/26
+ version: v1.22
+ date: 2020/03/05
author: Thomas Colcombet
mail: thomas.colcombet@irif.fr
web: https://www.irif.fr/~colcombe/knowledge_en.html
diff --git a/Master/texmf-dist/doc/latex/knowledge/knowledge.pdf b/Master/texmf-dist/doc/latex/knowledge/knowledge.pdf
index f9d20e3e271..0dd621bdd46 100644
--- a/Master/texmf-dist/doc/latex/knowledge/knowledge.pdf
+++ b/Master/texmf-dist/doc/latex/knowledge/knowledge.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/knowledge/knowledge.tex b/Master/texmf-dist/doc/latex/knowledge/knowledge.tex
index 13b42406637..720156a3ea4 100644
--- a/Master/texmf-dist/doc/latex/knowledge/knowledge.tex
+++ b/Master/texmf-dist/doc/latex/knowledge/knowledge.tex
@@ -4,7 +4,8 @@
\usepackage{paralist}
\usepackage[svgnames]{xcolor}
\usepackage{expl3}
-\usepackage[hidelinks]{hyperref}
+\usepackage{hyperref}
+%\usepackage{complexity}
\usepackage[quotation,scope]{knowledge}
\knowledgeconfigure{visible anchor points=false}
\knowledgeconfigure{notion,diagnose line=false}
@@ -332,6 +333,7 @@
\knowledge{autoref target}{directive}
\knowledge{also now}{directive}
\knowledge{notion}{directive}
+\knowledge{no patch}{directive}
\knowledge{invisible=}[invisible]{directive}
\knowledge{detokenize}{directive}
\knowledge{remove space}{directive}
@@ -381,6 +383,7 @@
%\def\mydebug{\tl_show:N\knowledge_knowledge_instance_tl}
%\ExplSyntaxOff
\knowledge{knowledge}{doc notion, package}
+ \knowledge{complexity}{package,url={https://www.ctan.org/pkg/complexity}}
\knowledge{expl3}{package,url={https://www.ctan.org/pkg/expl3}}
\knowledge{hyperref}{package,url={https://www.ctan.org/pkg/hyperref}}
\knowledge{tikzcd}{package,url={https://www.ctan.org/pkg/tikz-cd}}
@@ -638,11 +641,11 @@ I have seen Till Tantau who explained me how to test whether a material is displ
|beamer@slideinframe| could also be intersting.
\item make quotation work properly in the titles of section...,
\item allow to protect quotation in commands, and not only environments (for instance xymatrix)
-\item remove the warnings about redefining commands
+%\item remove the warnings about redefining commands
\item proper mathematics handling. Write a new \csintro{\NewDocumentCommand}-like macro
-\item detect using some trick that the previous compilation failed, and deactivate the Kaux file in this case
- (for the moment, removing the aux file deactivates the kaux file. This is convenient but not sufficient.)
-\item proper code for \cs{\nointro}.
+%\item detect using some trick that the previous compilation failed, and deactivate the Kaux file in this case
+% (for the moment, removing the aux file deactivates the kaux file. This is convenient but not sufficient.)
+%\item proper code for \cs{\nointro}.
\item improving the \cs{\AP} and \cs{\itemAP} commands. For the moment \cs{\AP} silently fails inside the
optional argument of \cs{\item}, and probably elsewhere too. See how this can be improved. I tried to use the \cs{inner_mode} test, but it also detects situations when where \cs{\AP} si allowed (like in minipage).
\item solve the \kl(package){amsmath} problem that \cs{\label} is deactivated in unnumbered environment, while knowledge would nevertheless like to point to the place...
@@ -740,6 +743,7 @@ I have seen Till Tantau who explained me how to test whether a material is displ
\item[2019-12-03] Corrected bug in the scope access. V1.20.
\item[2020-01-25] Corrected bug when "knowledge@@package" is used without "hyperref@@package" (thanks to Rémi Nollet).
\item[2020-01-25] Corrected bug that made the kaux file not stabilize (thanks to Rémi Nollet). V1.21 on CTAN.
+\item[2020-03-05] No \texttt{hidelinks} and \texttt{breaklinks} are automatically activated unless the new option \kl{no patch} is activated. Doc update. V1.22 on CTAN.
\end{compactdesc}
\normalsize
%\restoregeometry
@@ -787,14 +791,18 @@ You may use other options like \kl(option){xcolor} for allowing debugging with c
\begin{code}[8cm]
\cs{\usepackage}["hyperref@@package",\kl(option){quotation}]\{"knowledge@@package"\}
\end{code}
-\noindent or even better:
+\noindent or equivalently:
\begin{code}[8cm]
-\cs\usepackage["hidelinks"]\{\kl(package){hyperref}\}\\
+\cs\usepackage\{\kl(package){hyperref}\}\\
\cs\usepackage[\kl(option){quotation}\footnote{If you want to use the \kl{"..."} notation.}]\{"knowledge@@package"\}
\end{code}
-Then, in the preamble (or in an external file), one uses commands of the form:
-
+Then, in the preamble (or in an external file), one uses commands of the form either:
+\begin{code}
+\cs\knowledge\{\kl{url=}\{https://en.wikipedia.org/wiki/LaTeX\}\}\par
+\qquad\kl{|}\quad latex
+\end{code}
+or equivalently
\begin{code}
\cs\knowledge\{latex\}\{\kl{url=}\{https://en.wikipedia.org/wiki/LaTeX\}\}
\end{code}
@@ -1063,7 +1071,8 @@ The examples above show various techniques for using \kl{knowledges} for enhanci
\end{code}\noindent
Imagine that furthermore, you would like to hyperlink to the definition of a monoid. A standard \cs{\kl} command does the job\footnote{It is highly advised to not use the "quotation notation" in math mode or macros.}:
\begin{code}[9cm]
-\cs\newrobustcmd\kl[@token]\monoid\{\cs\kl[monoid]\{\cs\mathcal\ M\}\}\\~
+\cs\newrobustcmd\kl[@token]\monoid\{\cs\kl
+monoid]\{\cs\mathcal\ M\}\}\\~
What is \$\kl[@token]\monoid\$ ?
\end{code}\noindent
\noindent
@@ -1133,6 +1142,7 @@ These modes change several rendering settings.
\itemAP[Other packages] some of the options concern the loading and the use of other packages (\kl(package){hyperref}, \kl(package){xcolor}, \kl (package){makeidx}, \dots). Note that these package can also be loaded before "knowledge@@package". This is explained in Section~\ref{subsubsection:packages-loading}.
\itemAP[Configuration options] as used by the command \cs{\knowledgeconfigure} can be used when loading the package.
\itemAP[Scoping] The \kl[scope option]{scope} "option@package option" makes the package aware at a fine level of the structure of the document (see Section~\ref{subsection:scoping} for explanations). This provides, for instance, the possibility to define pieces of "knowledge" that are attached to a sections of the document.
+\itemAP[Other] The "no patch" option prevents the "knowledge@@package" to apply some patches that are convenient by default.
\end{compactdesc}
\subsubsection{Writing mode}
@@ -1244,9 +1254,12 @@ and to false when the "paper mode" or the "electronic mode" are used.
\end{description}
-%\subsubsection{Other configuration}
+\subsubsection{Other configuration option}
-%Another option at loading is "scope@scope option": it is used for activating some macros for keeping track of the structure of the document. This is in particular helpful for making "knowledges" attached to specific parts of the document, or helping in the resolution of ambiguities. See Section~\ref{subsection:scoping} for more information on its use.
+\begin{itemize}
+\itemAP[""no patch""] deactivates some patches which otherwise are applied automatically.
+ Currently, the option \texttt{hidelinks} and \texttt{breaklinks} of the package \kl(package){hyperref} are automatically applied, unless "no patch" is used while loading the package. Without \texttt{hidelinks} the links in the document are surrounded by red or light blue boxes (it depends also on the pdf viewer): while this may be acceptable when links are seldom used, this becomes problematic in combination with the "knowledge@@package" package. Without \texttt{breaklinks}, links are not broken as normal text: this may corrupt the appearance of paragraphs, in particular in a multi column context.
+\end{itemize}
\subsection{What is a \kl{knowledge}?}
@@ -2093,8 +2106,9 @@ This is done either by the command:
\marginpar{%
\begin{hint}
The "hyperref@@package" surrounds by default links by boxes that are graphically heavy
- (this are visible in some viewers, and not in some others): this is deactivated by the
- "knowledge@@package" package using the "hidelinks" option of "hyperref@@package".
+ (this are visible in some viewers, and not in some others): this is automatically deactivated when loading
+ the "knowledge@@package" package. Such automatic behavior can ba avoided using the \kl{no patch}
+ option at loading.
\end{hint}}
%
\begin{center}
@@ -2366,7 +2380,7 @@ Here the situation is slightly more complicated since a variable could be intro
\end{description}
The first use is fairly easy. The second one requires a bit more care. We review them one after the other.
-\subsubsection{Defining macros for math}
+\subsubsection{Defining macros for math: the "mathcommand@@package" package}
Defining macros is standard in \TeX, and it should be used systematically in writing scientific documents, in particular
when using the "knowledge@@package" package.
@@ -2375,8 +2389,7 @@ no optional parameters, is then expandable, and it is better to avoid it using i
package (it has the same syntax).
Another package "mathcommand@@package" has been designed to be used in conjunction with "knowledge@@package".
-We shall use it in the advanced examples below
-It allows:
+We shall use it in the advanced examples below. It allows:
\begin{itemize}
\item to define/redefine commands to be used in math mode only. This allows for instance to use the macro \cs\c\ for producing as usual a cedilla in text mode, and at the same time some variable $\mathbf c$ in math mode. This is achieved using for instance:
\smallcode{\cs\renewmathcommand\cs\c\{\cs\mathbf\{c\}\}}.
@@ -2392,12 +2405,18 @@ It allows:
This code works because a different name \cs\LaTeXpi\ stores the original macro. Using~\cs\pi\ instead would yield an infinite loop.
\item The package also gives access to the exponents and indices as well as primes that follow a command (see the documentation).
\item It also has some facilities for disabling \LaTeX\ commands and provide suggestions of replacement (useful for remembering the macros and working with colleagues).
+\item Finally, it offers some commodity for redefining many variables in one command.
+ E.g. for defining \cs\calA, \cs\calB,\dots to be shortcuts for \smallcode{\cs\cal A}, \smallcode{\cs\cal B},\dots:
+ \begin{code}
+ \cs\LoopCommands\{ABCDEFGHIJKLMNOPQRSTUVWXYZ\}[cal\#1]\par
+ ~~~~\quad\{\cs\newmathcommand\#2\{\cs\cal~\#1\}\}
+ \end{code}
\end{itemize}
\subsubsection{Mathematical objects that are singly introduced}
In this case, this is essentially as in text mode.
-Four points have to be kept in mind:
+Five points have to be kept in mind:
\begin{itemize}
\item Do not use the "quotation notation" in math mode and in macros. Indeed,
some packages, like "tikzcd@@package" use the double-quote symbol in their
@@ -2408,15 +2427,16 @@ Four points have to be kept in mind:
\item Use the control sequence of the macro itself as the "knowledge" name.
This does not cause problems and is easier to maintain.
\item Use the \cs{\intro*} notation for introducing macros.
+\item The surrounding space is broken by using the command \cs{\kl}. Commands like \cs\mathrel\ should be used to recover it.
\end{itemize}
-These four points are illustrated in the following code:
+These five points are illustrated in the following code:
\begin{code}
-\cs\newrobustcmd\cs\myFunction\{\cs\kl[\cs\myFunction]\{\cs\rho\}\}\\
-\cs\knowledge\cs\myFunction\{notion\}\\
+\cs\newrobustcmd\cs\comp\{\cs\mathrel\{\cs\kl[\cs\comp]\{\cs\circ\}\}\}\\
+\cs\knowledge\cs\comp\{notion\}\\
{[...]}\\
-\AP Let \$\cs{\intro*}\cs\myFunction(x)=[...]\$\\
+\cs\AP\ Composition is denoted \$\cs{\intro*}\cs\comp\$.\\
{[...]}\\
-Now, each use of \$\cs\myFunction\$ points to its introduction.
+Now, each use of \$\cs\comp\$ points to its introduction.
\end{code}
Two variation may be comfortable to use.
@@ -2440,13 +2460,13 @@ that in the definition of \cs\myFunction, \cs\LaTeXrho\ is used instead of~\cs\r
but~\cs\LaTeXrho\ gives access to its original meaning.
\paragraph{Redefining the original \TeX\ macro}
-Another situation is that one would like to use the \cs\rho\ control sequence for accessing our function instead \cs\myFunction. Smply because this is more convenient and easy to remember.
+Another situation is that one would like to use the \cs\rho\ control sequence for accessing our function instead of \cs\myFunction (simply because this is more convenient and easy to remember, and we know in advance that no confusion may arise).
In this case, the "mathcommand@@package" package can also be of some help:
\begin{code}
\cs\renewmathcommand\cs\rho\{\cs\kl[\cs\rho]\{\cs\LaTeXrho\}\}\\
\cs\knowledge\cs\rho\{notion\}\\
{[...]}\\
-\AP Let \$\cs{\intro*}\cs\rho(x)=[...]\$\\
+\cs\AP\ Let \$\cs{\intro*}\cs\rho(x)=[...]\$\\
{[...]}\\
Now, each use of \$\cs\rho\$ points to its introduction.
\end{code}
@@ -2454,18 +2474,19 @@ Now, each use of \$\cs\rho\$ points to its introduction.
The effect of \cs\renewmathcommand\ is that it sets~\cs\LaTeXrho\ to have the same effect as the original \cs\rho\ command,
and then redefines~\cs\rho.
-\subsection{Context dependent variables}
+\subsubsection{Context dependent variables}
+This section is not yet written.
+
+\iffalse
We enter now a more advanced situation. We want to track all the variables in a mathematic document...
the first thing to do is to give access to the "knowledge@@package" package to the scope of the document.
The easiest way to do that is to declare in the preamble what are the environments that we want to use.
\begin{code}
\cs\knowledgeconfigureenvironment\{theorem,lemma,proof\}\{\}\par\noindent
-\end{code}
+\end{code}}
-\iffalse
-%\iffalse
The "knowledge@@package" package offers several tools for dealing with mathematics. It is mostly still experimental.
The essential goal is to be able to track the identity variables and to point each of them to its introduction.
For obtaining this, this requires:
@@ -2475,6 +2496,8 @@ For obtaining this, this requires:
\end{itemize}
\fi
+
+
\subsection{Fixes}
\label{subsection:fixes}
@@ -2511,7 +2534,7 @@ A typical document using notion could start by the following commands:
\begin{code}
\cs\documentclass\{article\}\\
\cs\usepackage\{\kl(package){xcolor}\}\\
-\cs\usepackage["hidelinks"]\{\kl(package){hyperref}\}\\
+\cs\usepackage\{\kl(package){hyperref}\}\\
\cs\usepackage[\kl{electronic}]\{"knowledge@@package"\}\\
\cs\knowledgeconfigure\{"notion@@option"\}\\
{[...]}\\
@@ -2660,6 +2683,33 @@ the incriminated environment using \cs\phantomsection, and then use \cs{\reintro
\paragraph{A fatal error occurs in twocolumn mode.} A workaround is to use
\smallcode{\cs\knowledgeconfigure\{\kl{fix hyperref twocolumn}\}}.
+\subsection{Name clash (eg with the "complexity@@package" package)}
+
+It may happen that an already defined command is redefined by the "knowledge@@package" package.
+This happens in particular wen used in combination with the "complexity@@package" package: both package redefine the command \cs\AP. For "complexity@@package", this denotes a complexity class, and for "knowledge@@package", it is an "anchor point".
+The problem has to be resolved by hand. The two following solutions are quick hacks:
+\begin{center}
+\begin{tabular}{ccc}
+\begin{code}[5.2cm]
+\cs\usepackage\{\kl(package){complexity}\}\\
+\cs\let\cs\compAP\robustdisplay\AP\\
+\cs\let\robustdisplay\AP\cs\undefined\\
+\cs\usepackage[...]\{"knowledge@@package"\}
+\end{code}
+&&
+\begin{code}[5.2cm]
+\cs\usepackage[...]\{"knowledge@@package"\}\\
+\cs\let\cs\kAP\robustdisplay\AP\\
+\cs\let\robustdisplay\AP\cs\undefined\\
+\cs\usepackage\{\kl(package){complexity}\}
+\end{code}\\
+for using \texttt{\robustdisplay\AP}from "knowledge@@package",
+ && for using \texttt{\robustdisplay\AP}from "complexity@@package",\\
+and \cs\compAP\ for "complexity@@package",
+ && and \cs\kAP\ for "knowledge@@package".
+\end{tabular}
+\end{center}
+
\subsection{Incorrect display}
\subsubsection{Incorrect breaking at the end of lines (in Arxiv for instance)}
@@ -2680,16 +2730,10 @@ The preamble thus looks like:
\subsubsection{Red boxes around links}
-This is an annoying feature of the "hyperref@@package" package to surround all links by red boxes (that may appear or not depending on the viewer). This is very heavy in document with many links. The solution is to load the "hyperref@@package" package with the "hidelinks" option. Hence the preamble may look like:
-\begin{code}[9cm]
-\cs\usepackage{["hidelinks"]}\{"hyperref@@package"\}\par\noindent
-\cs\usepackage\{\kl(package){knowledge}\}\par\noindent
-\end{code}
-If the package "hyperref@@package" is loaded indirectly (maybe by the class), then the "hidelinks" option can be activated
-at any moment, as soon as "hyperref@@package" is loaded, using \cs\hypersetup:
-\begin{code}[9cm]
-\cs\hypersetup\{"hidelinks"\}
-\end{code}
+This is an annoying feature of the "hyperref@@package" package to surround all links by red boxes (that may appear or not depending on the viewer). This is very heavy in document with many links. By default, this is deactivated when using the "knowledge@@package",
+unless the "no patch" option is used when loading the package. When the "no patch" option is used, the same effect can nevertheless be obtain, eg using \smallcode{\cs\hypersetup\{hidelinks\}}.
+
+
\subsection{Problems with scope}
\subsubsection{Problems in combination with \cs{\bibitem} and "thebibliography@@env"}
@@ -2840,18 +2884,19 @@ If other kind of problems occur, report them to \texttt{thomas.colcombet@irif.fr
\item["composition"] switches to "composition mode",
\item["cyclic colors=@@option"] fixes the cyclic list of colors used by the "directive" "cyclic color".
\item["diagnose line="\textmd{\{true,false\}}] activates or deactivates the line numbering in the "diagnose file".
-\item["electronic"] switches to "electronic mode",
+\item["electronic"] switches to "electronic mode".
\item[\kl{fix hyperref twocolumn}] fixes a known problem between "hyperref@@package"
and the two column mode.
\item[\kl{hyperlinks=}\textmd{\{true,false\}}] activates or deactivates the hyperlinks.
-\item[{{\kl(option){notion}}}] activates the "notion" directive
-\item["paper"] switches to "paper mode",
+\item[{{\kl{no patch}}}] deactivates the default patches made to other packages.
+\item[{{\kl(option){notion}}}] activates the "notion" directive.
+\item["paper"] switches to "paper mode".
\itemAP[\kl{label scope=}\textmd{\{true,false\}}] enables or disables the redefined \cs{\label} command, which helps automatically define scopes (default is~\textmd{true}).
\item[\kl{protect link co} and \kl{unprotect link co}] starts and ends respectively a zone in which the "knowledge@@package" package does not create hyperlinks.
-\item[\kl{protect quotation=}\textmd{\{environment list\}}] declares a list of environment in which the "quotation notation" should be deactivated
+\item[\kl{protect quotation=}\textmd{\{environment list\}}] declares a list of environment in which the "quotation notation" should be deactivated.
\item[{{\kl(option)[quotation]{quotation=}\textmd{\{true,false\}}}}] activates or deactivates the "quotation notation".
\item["strict"] is a Boolean which, when true, makes the compilation more restrictive by turning some of the warnings into errors (in particular in case of redefinition of knowledges).
-\item[\kl{visible anchor points=}\textmd{\{true,false\}}] makes the \kl{anchor points} either visible or invisible
+\item[\kl{visible anchor points=}\textmd{\{true,false\}}] makes the \kl{anchor points} either visible or invisible.
\end{compactdesc}
\newpage
diff --git a/Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx b/Master/texmf-dist/source/latex/knowledge/knowledge-code.dtx
index 92725e4d583..73ec799f183 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}{2020/01/26}{1.21}{}
+%<head>\ProvidesExplPackage{knowledge}{2020/03/05}{1.22}{}
%<*driver>
\def\knowledgecode{active}
\input{knowledge.tex}
@@ -54,6 +54,7 @@
% \changes{1.19}{2019/11/19}{bug fix} %
% \changes{1.20}{2019/12/03}{bug fix} %
% \changes{1.21}{2020/01/26}{bug fix} %
+% \changes{1.22}{2020/03/05}{improvements} %
% \GetFileInfo{knowledge.sty} %
% \DoNotIndex{}
%
@@ -73,8 +74,8 @@ This directory contains the package
name: knowledge
license: LaTeX Project Public License version 1.2 or above
- version: v1.21
- date: 2020/01/26
+ version: v1.22
+ date: 2020/03/05
author: Thomas Colcombet
mail: thomas.colcombet@irif.fr
web: https://www.irif.fr/~colcombe/knowledge_en.html
@@ -476,6 +477,29 @@ Content of the file knowledge-sources.zip:
% this one is for compatibility
\KnowledgePackageTrigger{ final }{\tl_set:Nn\knowledge_option_mode_tl{final}}
% \end{macrocode}
+% Modes are stored in \csintro{\knowledge_option_mode_tl}.
+% \begin{macrocode}
+\bool_new:N\knowledge_option_texpatch_bool
+\bool_set_true:N\knowledge_option_texpatch_bool
+\KnowledgePackageTrigger{ no patch }{\bool_set_false:N\knowledge_option_texpatch_bool}
+% \end{macrocode}
+% \begin{macrocode}
+\tl_new:N\knowledge_option_knowledgeAP_command_tl
+\tl_set:Nn\knowledge_option_knowledgeAP_command_tl{}
+\tl_new:N\knowledge_option_complexityAP_command_tl
+\tl_set:Nn\knowledge_option_complexityAP_command_tl{}
+\KnowledgePackageTrigger{ knowledge AP }{
+ \tl_if_single_token:nTF{#1}
+ {\tl_set:Nn\knowledge_option_knowledgeAP_command_tl{#1}}
+ {\knowledge_error:n{Package~option~'knowledge~AP'~must~be~followed~by~a~single~control~sequence.}}
+}
+\KnowledgePackageTrigger{ complexity AP }{
+ \tl_if_single_token:nTF{#1}
+ {\tl_set:Nn\knowledge_option_complexityAP_command_tl{#1}}
+ {\knowledge_error:n{Package~option~'complexity~AP'~must~be~followed~by~a~single~control~sequence.}}
+}
+% \end{macrocode}
+%
%
% \begin{macrocode}
\KnowledgeConfigureTrigger{ fix~hyperref~twocolumn }
@@ -634,7 +658,7 @@ Content of the file knowledge-sources.zip:
%
% \subsubsection{Options post-treatment for the other packages}
% \begin{macrocode}
-\knowledge_option_aci_autoload:nnn{ hyperref }{}{\hypersetup{hidelinks}}
+\knowledge_option_aci_autoload:nnn{ hyperref }{}{}
\knowledge_option_aci_autoload:nn{ xcolor }{}
\knowledge_option_aci_autoload:nn{ makeidx }{}
% \end{macrocode}
@@ -3443,13 +3467,14 @@ Content of the file knowledge-sources.zip:
% The code for the command \cs{\AP} is inspired from a
% \href{http://tex.stackexchange.com/questions/123392/add-a-marker-to-the-left-of-the-text}{\underline{code}} of \kl{egreg} on \kl{stackexchange}.
% \begin{macrocode}
-\NewDocumentCommand\AP{}
+\NewDocumentCommand\knowledge_anchor_point_cs:{}
{\bool_if:NT\knowledge_hyperref_active_bool
{\strut\vadjust{\knowledge_AP_internal:}}}
\NewDocumentCommand\itemAP{o}{
\IfNoValueTF{#1}
- {\item\AP}
+ {\item\knowledge_anchor_point_cs:}
{\item[\knowledge_itemAP: #1]}}
+\let\AP\knowledge_anchor_point_cs:
% \end{macrocode}
% \begin{macrocode}
\int_new:N\kl_hyperref_kl_nesting_count_int
@@ -3823,6 +3848,19 @@ Content of the file knowledge-sources.zip:
%
% \subsection{configuration}
%
+% \subsubsection{Patching}
+%
+% Since v1.22, the package corrects by default some behaviours that are annoying in other packages.
+% This can be avoided using the trigger \kl{no patch} when you load the document.
+% \begin{macrocode}
+\bool_if:NT\knowledge_option_texpatch_bool{
+ \bool_if:NT\knowledge_hyperref_active_bool{
+ \hypersetup{breaklinks}
+ \hypersetup{hidelinks}
+ }
+}
+% \end{macrocode}
+%
% \subsubsection{Accessing the \kl{writing mode}}
%
% The paper can be compiled either in \kl{composition mode}, in \kl{paper mode}, or in \kl{electronic mode}.
diff --git a/Master/texmf-dist/tex/latex/knowledge/knowledge.sty b/Master/texmf-dist/tex/latex/knowledge/knowledge.sty
index f7109832895..82a7ccfb846 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}{2020/01/26}{1.21}{}
+\ProvidesExplPackage{knowledge}{2020/03/05}{1.22}{}
%%%%%%%%%%
\RequirePackage{l3keys2e}
\RequirePackage{etoolbox}
@@ -979,6 +979,23 @@
\KnowledgePackageTrigger{ electronic }{\tl_set:Nn\knowledge_option_mode_tl{electronic}}
\KnowledgePackageTrigger{ composition }{\tl_set:Nn\knowledge_option_mode_tl{composition}}
\KnowledgePackageTrigger{ final }{\tl_set:Nn\knowledge_option_mode_tl{final}}
+\bool_new:N\knowledge_option_texpatch_bool
+\bool_set_true:N\knowledge_option_texpatch_bool
+\KnowledgePackageTrigger{ no patch }{\bool_set_false:N\knowledge_option_texpatch_bool}
+\tl_new:N\knowledge_option_knowledgeAP_command_tl
+\tl_set:Nn\knowledge_option_knowledgeAP_command_tl{}
+\tl_new:N\knowledge_option_complexityAP_command_tl
+\tl_set:Nn\knowledge_option_complexityAP_command_tl{}
+\KnowledgePackageTrigger{ knowledge AP }{
+ \tl_if_single_token:nTF{#1}
+ {\tl_set:Nn\knowledge_option_knowledgeAP_command_tl{#1}}
+ {\knowledge_error:n{Package~option~'knowledge~AP'~must~be~followed~by~a~single~control~sequence.}}
+}
+\KnowledgePackageTrigger{ complexity AP }{
+ \tl_if_single_token:nTF{#1}
+ {\tl_set:Nn\knowledge_option_complexityAP_command_tl{#1}}
+ {\knowledge_error:n{Package~option~'complexity~AP'~must~be~followed~by~a~single~control~sequence.}}
+}
\KnowledgeConfigureTrigger{ fix~hyperref~twocolumn }
{\knowledgeFixHyperrefTwocolumn}
\KnowledgeConfigureTrigger{ notion }
@@ -1075,7 +1092,7 @@
\keys_set:nV{ knowledge~package~modes }{ composition }}
}
\keys_set:nV{ knowledge~package~modes }\knowledge_option_mode_tl
-\knowledge_option_aci_autoload:nnn{ hyperref }{}{\hypersetup{hidelinks}}
+\knowledge_option_aci_autoload:nnn{ hyperref }{}{}
\knowledge_option_aci_autoload:nn{ xcolor }{}
\knowledge_option_aci_autoload:nn{ makeidx }{}
\tl_const:Nn\scope_tl{SC@PE}
@@ -2948,13 +2965,14 @@
{\exp_not:V\knowledge_kl_text_tl}
}
}
-\NewDocumentCommand\AP{}
+\NewDocumentCommand\knowledge_anchor_point_cs:{}
{\bool_if:NT\knowledge_hyperref_active_bool
{\strut\vadjust{\knowledge_AP_internal:}}}
\NewDocumentCommand\itemAP{o}{
\IfNoValueTF{#1}
- {\item\AP}
+ {\item\knowledge_anchor_point_cs:}
{\item[\knowledge_itemAP: #1]}}
+\let\AP\knowledge_anchor_point_cs:
\int_new:N\kl_hyperref_kl_nesting_count_int
\bool_new:N\kl_hyperref_active_here_bool
\bool_set_true:N\kl_hyperref_active_here_bool
@@ -3193,6 +3211,12 @@
}
\ExplSyntaxOn
\makeatother
+\bool_if:NT\knowledge_option_texpatch_bool{
+ \bool_if:NT\knowledge_hyperref_active_bool{
+ \hypersetup{breaklinks}
+ \hypersetup{hidelinks}
+ }
+}
\bool_if:NF\knowledge_option_composition_bool
{\bool_if:NF\knowledge_option_paper_bool}
{\bool_set_true:N\knowledge_option_composition_bool}