diff options
Diffstat (limited to 'macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx')
-rw-r--r-- | macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx | 103 |
1 files changed, 99 insertions, 4 deletions
diff --git a/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx b/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx index 8a783b7697..0679203098 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95f, released 2021-06-29} +% \date{Version 0.95g, released 2021-07-21} % % \maketitle % \begin{documentation} @@ -115,9 +115,24 @@ % are described in the documentation of \pkg{l3pdfmeta}. % \item[\texttt{pdfmanagement}] Boolean. This activates/deactivates % the core management code. By default the value is true. -% \item[firstaidoff] This accepts a comma lists of keysword and disable the patches +% \item[\texttt{firstaidoff}] This accepts a comma lists of keysword and disable the patches % related to them. More information can be found in the documentation of % \pkg{pdfmanagement-firstaid}. +% \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts +% and their effect will change over time, when testphase packages are added or +% removed when the code is moved into the kernel. Currently the accepted values are +% \texttt{tagpdf}, this load the tagpdf package, \texttt{headings}, this loads +% code which reimplements heading commands, and \texttt{ptagging} this loads code +% to allow paragraph tagging to work with engine other than luatex. +% \item[\texttt{activate}] This key is used to enable some document wide functions. It is +% currently in an experimental state. The values and their behaviour are subject to change. +% Currently the only value is |tagging|, +% which will do |\tagpdfsetup{activate,paratagging,interwordspace}|. It requires that +% \pkg{tagpdf} has been loaded first with the |testphase| key. +% \item[\texttt{debug}] This key activates some debug options. Currently only the +% keys |para| (with the default and only value |show|), +% and |log| (with the values of \pkg{tagpdf}) and |uncompress| (which does the same +% as |uncompress| as main key) are known. % \end{description} % % \subsection{Container for document properties} @@ -167,7 +182,7 @@ % \begin{macrocode} %<@@=pdfmanagement> %<*header> -\ProvidesExplPackage{ltdocinit}{2021-06-29}{0.95f} +\ProvidesExplPackage{ltdocinit}{2021-07-21}{0.95g} {Initialize document metadata} %</header> % \end{macrocode} @@ -235,8 +250,9 @@ } } % \end{macrocode} -% Load more modules and the firstaid code. +% Load more modules, the testphase code and the firstaid code. % \begin{macrocode} + \g_@@_testphase_tl \RequirePackage{pdfmanagement-firstaid} } } @@ -296,6 +312,13 @@ \clist_new:N \g_@@_firstaidoff_clist % \end{macrocode} % \end{variable} +% \begin{variable}{\g_@@_testphase_tl} +% a tl to store the testphase loading code so that we can load them at +% the end of the command. +% \begin{macrocode} +\tl_new:N \g_@@_testphase_tl +% \end{macrocode} +% \end{variable} % \begin{macrocode} \keys_define:nn { document / metadata } { @@ -346,6 +369,78 @@ } ,pdfmanagement .bool_gset:N = \g_@@_active_bool ,firstaidoff .clist_gset:N = \g_@@_firstaidoff_clist + ,testphase .multichoice: + ,testphase / tagpdf .code:n = + { + \tl_gput_right:Nn\g_@@_testphase_tl + { + \RequirePackage{tagpdf} + \AddToDocumentProperties [document]{testphase/tagpdf}{loaded} + } + } + ,testphase / headings .code:n = + { + \tl_gput_right:Nn\g_@@_testphase_tl + { + \RequirePackage{headings-testphase} + \AddToDocumentProperties [document]{testphase/headings}{loaded} + } + } + ,testphase / ptagging .code:n = + { + \tl_gput_right:Nn\g_@@_testphase_tl + { + \AddToHook{class/after} + { + \RequirePackage{ptagging-testphase} + \AddToDocumentProperties [document]{testphase/ptagging}{loaded} + } + } + } + ,testphase / unknown .code:n = + { + \tl_gput_right:Nn\g_@@_testphase_tl + { + \AddToHook{class/after} + { + \RequirePackage{#1-testphase} + \AddToDocumentProperties [document]{testphase/#1}{loaded} + } + } + } + ,activate .multichoice: + ,activate / tagging .code:n = + { + \AddToHook{package/after/tagpdf} + { + \tagpdfsetup{activate,paratagging,interwordspace} + \AddToDocumentProperties [document]{tagging}{active} + \AddToDocumentProperties [document]{tagging/para}{active} + \AddToDocumentProperties [document]{tagging/interwordspace}{active} + } + } + ,debug .code:n = + { + \keys_set:nn { document / metadata / debug } {#1} + } + ,debug / para .code:n = + { + \AddToHook{package/after/tagpdf} + { + \tagpdfsetup{paratagging-show} + } + } + ,debug / log .code:n = + { + \AddToHook{package/after/tagpdf} + { + \tagpdfsetup{log=#1} + } + } + ,debug / uncompress .code:n = + { + \pdf_uncompress: + } } % \end{macrocode} % \begin{macrocode} |