Skip to content

Commit

Permalink
testphase value "latest" (#1590)
Browse files Browse the repository at this point in the history
* add testphase=latest

* update and test new pdfmanagement

* update testfiles to pdfmanagement changes.

* more testfile updates.

* remove unneeded tests

* trim spaces

* changes entry, adapt date

* add news entry

* clarify docu, from review
  • Loading branch information
u-fischer authored Dec 21, 2024
1 parent cd92ac2 commit 7d4ec54
Show file tree
Hide file tree
Showing 69 changed files with 4,585 additions and 4,400 deletions.
6 changes: 6 additions & 0 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ \section{Replacement for the legacy mark mechanism}

\section{News from Tagged PDF project}

The \texttt{testphase} key now takes also the value \texttt{latest}.
This will load all modules that we recommend
so that it is not necessary to specify individual modules. The list of loaded modules
will be adjusted as needed when the project progresses. It is also written to the log.


\emph{to write}

\subsection{Fixing the spacing after display math}
Expand Down
4 changes: 4 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-12-21 Ulrike Fischer <[email protected]>
* documentmetadata-support.dtx: added "latest" as a testphase value.
* remove now unneeded tests.

2024-12-01 Frank Mittelbach <[email protected]>

* latex-lab-block.dtx (subsection{Handling \tn{par} after the end of the list}):
Expand Down
166 changes: 83 additions & 83 deletions required/latex-lab/documentmetadata-support.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
% for those people who are interested or want to report an issue.
%
% \begin{macrocode}
\def\documentmetadatasupportversion{1.0j}
\def\documentmetadatasupportdate{2024-09-13}
\def\documentmetadatasupportversion{1.0k}
\def\documentmetadatasupportdate{2024-12-21}
% \end{macrocode}
%
%
Expand Down Expand Up @@ -68,7 +68,7 @@
% is easier to update it without the need to build a full \LaTeX{}
% release. Over time the functionality will move fully into the
% kernel.
%
%
% \cs{DocumentMetadata} also loads and activates
% the new PDF management code from \pkg{pdfmanagement-testphase}.
% As this forces the loading of the \pkg{l3backend} files, a backend
Expand All @@ -85,12 +85,12 @@
% project~\cite{blueprint}.
%
% \section{The \cs{DocumentMetadata} command}
%
%
% \begin{function}{\DocumentMetadata}
% \begin{syntax}
% \cs{DocumentMetadata}\Arg{key-value list}
% \end{syntax}
%
%
% The command should be used as the first command in a document, before
% \cs{documentclass}. It takes a key-value argument.
% \end{function}
Expand Down Expand Up @@ -137,37 +137,40 @@
% The |u| variants do not enforce unicode,
% but they will pass the information to hyperref. The |a| variants
% do \emph{not} enforce (or even test) a tagged pdf yet.
%
% Starting with version 0.95s of \pkg{pdfmanagement-testphase}
% it is also possible to use the values
% |X-4|, |X-4p|, |X-5g|, |X-5n|, |X-5pg|, |X-6|, |X-6n|, |X-6p|, |UA-1| for
% a PDF/X and PDF/UA standard. These keys currently set \emph{only} the relevant
% XMP-metadata. In version 0.95z support for |UA-2| has been added but
% note that |UA-2| hasn't been released yet. It should be used only together
% with pdf version 2.0.
%
% Beside the A-standards it is also possible to use the values
% |X-4|, |X-4p|, |X-5g|, |X-5n|, |X-5pg|, |X-6|, |X-6n|, |X-6p| for
% a PDF/X and |UA-1| and |UA-2| for PDF/UA standard.
% |UA-2| should only be used together with PDF 2.0.
% Currently these keys set \emph{only} the relevant XMP-metadata.
% They do not validate or enforce special requirements
% (e.g., the |UA| standards do not automatically activate tagging).
%
% |pdfstandard| can be used more than once to set overlapping standards, e.g:\\
% |pdfstandard=A-2b,pdfstandard=X-4,pdfstandard=UA-1|
%
%
% If XMP-metadata are added (see the following key \texttt{xmp})
% the needed conformance marker for the standards are set.
%
% the necessary conformance marker for the standards are set.
%
% More information can be found in the documentation
% of \pkg{l3pdfmeta}.
% of \pkg{l3pdfmeta}.
%
% \item[\texttt{xmp}] A boolean, if set to false no XMP metadata are added to the PDF.
% The initial value is true. Details are described in the documentation of \pkg{l3pdfmeta}.
%
%
% \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details
% are described in the documentation of \pkg{l3pdfmeta}.
%
% \item[\texttt{testphase}] This key is used to load testphase code.
% \item[\texttt{testphase}] This key is used to load testphase code.
% The |testphase| key can only be used in the first \cs{DocumentMetadata}.
% The values it accepts and their effect will change over time, when testphase packages are added or
% removed or when the code is moved into the kernel. The key accepts a list of values
% and it can be used more than once.
%
% The \texttt{phase} key bundle testphase modules. They also all activate tagging.
%
% The value \texttt{latest} loads all modules that we recommend
% so that it is not necessary to specify individual modules.
%
% The \texttt{phase} keys bundle testphase modules. They also all activate tagging.
% \begin{description}
% \item[\texttt{phase-I}]
% This value loads code implementing the first phase of the project~\cite{blueprint}, i.e., it
Expand All @@ -183,37 +186,37 @@
% This is the current development phase.
% It differs from \texttt{phase-II} \emph{a lot}: It will
% load new code for the tagging of lists, sectioning commands,
% table of contents and similar lists, graphics, minipages and floats.
% As it redefines many internals it is currently restricted to the use of
% standard classes (article, report, and book)
% and it supports only a limited number of add-on packages.
% table of contents and similar lists, graphics, minipages and floats.
% As it redefines many internals it is currently restricted to the use of
% standard classes (article, report, and book)
% and it supports only a limited number of add-on packages.
% \end{description}
%
%
% The various testphase modules can also be loaded individually (at least in theory,
% there can be hidden dependencies). If loaded like this, the tagpdf package is not
% loaded and tagging is not activated! The list of modules will change over time.
% \begin{description}
% \begin{description}
% \item[\texttt{new-or-1}] This patches a few commands related
% to the output routine. The patches are needed for the tagging
% of paragraphs, for the tagging of header and footer and
% of paragraphs, for the tagging of header and footer and
% to allow the PDF management to insert code which avoids that
% links happening at page breaks spills into the header and footer.
% links happening at page breaks spills into the header and footer.
% This code is automatically loaded if the \texttt{testphase} values
% \texttt{phase-I}, \texttt{phase-II} or \texttt{new-or} are used.%
% \item[\texttt{new-or}] This loads more changes to the output routine required for the
% tagging. It is not compatible with every class! The code is also loaded by the
% \texttt{phase-I}, \texttt{phase-II} or \texttt{new-or} are used.%
% \item[\texttt{new-or}] This loads more changes to the output routine required for the
% tagging. It is not compatible with every class! The code is also loaded by the
% \texttt{phase-II} value.
% \item[\texttt{sec}] This adapts commands related to sectioning to make them tagging aware.
% The \texttt{sec} module is loaded by \texttt{phase-III}.
% \item[\texttt{toc}] This adapts commands related to the table of contents and
% similar list to make them tagging aware. The \texttt{toc} module is loaded by \texttt{phase-III}.
% similar list to make them tagging aware. The \texttt{toc} module is loaded by \texttt{phase-III}.
% \item[\texttt{graphic}] This enables tagging support for
% the \cs{includegraphics} command and the \texttt{picture} environment.
% the \cs{includegraphics} command and the \texttt{picture} environment.
% This code is also loaded by the \texttt{phase-III} key.
% \item[\texttt{block}] This reimplements lists and blocks environments and
% add tagging support.
% This code is also loaded by the \texttt{phase-III} key.
% \item[\texttt{minipage}] This adds tagging support to \texttt{minipage}
% \item[\texttt{minipage}] This adds tagging support to \texttt{minipage}
% and \cs{parbox}.
% This code is also loaded by the \texttt{phase-III} key.
% \item[\texttt{float}] This adds tagging support to floats.
Expand All @@ -230,16 +233,16 @@
% and \cs{author} commands to fill the XMP-metadata and set the window title.
% It is not compatible with packages and classes which redefine these commands
% too. The module is currently not loaded by any \texttt{phase} key.
% \item[\texttt{math}] This adapts math for tagging. This is only a prototype.
% The module is currently not loaded by any \texttt{phase} key.
% \item[\texttt{table}] This provides basic tagging for
% \texttt{tabular}, \texttt{longtable} and similar table environments.
% The module is currently not loaded by any \texttt{phase} key. Its use and
% restrictions is documented in \texttt{latex-lab-table.pdf}.%
% \item[\texttt{math}] This adapts math for tagging. This is only a prototype.
% The module is currently not loaded by any \texttt{phase} key.
% \item[\texttt{table}] This provides basic tagging for
% \texttt{tabular}, \texttt{longtable} and similar table environments.
% The module is currently not loaded by any \texttt{phase} key. Its use and
% restrictions is documented in \texttt{latex-lab-table.pdf}.%
% \item[\texttt{firstaid}] This contains small adjustments to external packages.
% The module is currently not loaded by any \texttt{phase} key.
% The module is currently not loaded by any \texttt{phase} key.
% \end{description}
%
%
%
% \item[\texttt{debug}] This key activates some debug options. It takes a list of key-values
% as value. Currently the following keys are known:
Expand All @@ -253,12 +256,12 @@
% related to them. More information can be found in the documentation of
% \pkg{pdfmanagement-firstaid}.
% \item[\texttt{xmp-export}] This will export the XMP-metadata to a file \verb+\jobname.xmpi+.
% with \texttt{debug=\{xmp-export=filename\}} the file name can be changed.
% with \texttt{debug=\{xmp-export=filename\}} the file name can be changed.
% More information can be found in the documentation of \pkg{l3pdfmeta} of the \pkg{pdfmanagement-testphase}
% bundle.
% bundle.
% \item[\texttt{tagpdf}] This loads the package tagpdf-debug which enhances
% various commands from tagpdf with additional debugging options. This can slow down
% the compilation!
% the compilation!
% \end{description}
% \end{description}
%
Expand Down Expand Up @@ -304,7 +307,7 @@
% \begin{macrocode}
\clist_if_exist:NF \g_@@_firstaidoff_clist
{ \clist_new:N \g_@@_firstaidoff_clist }
% \end{macrocode}
% \end{macrocode}
% \end{variable}
% \begin{variable}{\g_@@_testphase_tl}
% a tl to store the testphase loading code so that we can load them at
Expand All @@ -314,7 +317,7 @@
{ \tl_new:N \g_@@_testphase_tl }
% \end{macrocode}
% \end{variable}
%
%
% \subsection{Kernel changes with \cs{DocumentMetadata}}
% \begin{macro}{\@kernel@before@DocumentMetadata}
% \begin{macrocode}
Expand All @@ -329,7 +332,7 @@
% \end{macro}

% \subsection{\cs{DocumentMetadata}}
%
%
% \begin{macro}{\DocumentMetadata}
%
% \cs{DocumentMetadata} should not be used after
Expand Down Expand Up @@ -375,27 +378,27 @@
{
\PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
% \end{macrocode}
% Finally we setup the language default.
% Finally we setup the language default.
% This is done after the begindocument hook so that it can pick up settings
% from babel. If the Catalog dictionary already contains a lang value we do nothing,
% otherwise we use the value stored in \cs{BCPdata}, either the main language
% (if its exists) or the fall back language.
% (if its exists) or the fall back language.
% Note: if babel is loaded without a language this gives the language \texttt{und}.
% \begin{macrocode}
% \begin{macrocode}
\g@addto@macro\@kernel@after@begindocument
{
{
\pdfdict_get:nnN {g__pdf_Core/Catalog}{Lang}\l_@@_tmpa_tl
\quark_if_no_value:NT\l_@@_tmpa_tl
\quark_if_no_value:NT\l_@@_tmpa_tl
{
\tl_if_empty:eTF { \BCPdata{main.language} }
{ \tl_set:Ne \l_@@_tmpb_tl { \BCPdata{language} } }
{ \tl_set:Ne \l_@@_tmpb_tl { \BCPdata{main.language} } }
\msg_warning:nne { meta } { lang-missing }{ \l_@@_tmpb_tl }
\exp_last_unbraced:Ne
\AddToDocumentProperties{[document]{lang}{\l_@@_tmpb_tl}}
\pdfmanagement_add:nne {Catalog} {Lang}{(\l_@@_tmpb_tl)}
\AddToDocumentProperties{[document]{lang}{\l_@@_tmpb_tl}}
\pdfmanagement_add:nne {Catalog} {Lang}{(\l_@@_tmpb_tl)}
}
}
}
}
% \end{macrocode}
% \cs{pdfmanagement_add:nnn} has collected values in this hook.
Expand Down Expand Up @@ -428,6 +431,7 @@
% \end{macro}

%\subsection{\cs{DocumentMetadata} keys}
%\changes{1.0k}{2024-12-17}{added latest value for testphase key.}
% \begin{macrocode}
\keys_define:nn { document / metadata }
{
Expand Down Expand Up @@ -466,41 +470,32 @@
,_pdfstandard .choices:nn =
{A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U,A-4}
{
\prop_if_exist:cT { g__pdfmeta_standard_pdf/#1_prop }
{
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/#1 _prop }
}
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/#1 _prop }
\AddToDocumentProperties [document]{pdfstandard}{#1}
}
,_pdfstandard / A-4F .code:n =
,_pdfstandard / A-4F .code:n =
{
\prop_if_exist:cTF { g__pdfmeta_standard_pdf/A-4F_prop }
{
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4F_prop }
}
{
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4_prop }
\prop_gput:Nnn \g__pdfmeta_standard_prop{conformance}{F}
}
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4F_prop }
\AddToDocumentProperties [document]{pdfstandard}{A-4F}
}
,_pdfstandard / A-4E .code:n =
,_pdfstandard / A-4E .code:n =
{
\prop_if_exist:cTF { g__pdfmeta_standard_pdf/A-4E_prop }
{
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4E_prop }
}
{
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4_prop }
\prop_gput:Nnn \g__pdfmeta_standard_prop{conformance}{E}
}
\prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4E_prop }
\AddToDocumentProperties [document]{pdfstandard}{A-4E}
}
}
,_pdfstandard / unknown .code:n =
{
\msg_error:nnn{pdf}{unknown-standard}{#1}
}
,testphase .multichoice:
,testphase / latest .code:n =
{
\keys_set:nn
{document / metadata}
{testphase={phase-III,title,table,math,firstaid}}
\msg_note:nnn { meta } { testphase-latest-loading }
{ phase-III,~title,~table,~math,~firstaid }
}
,testphase / tagpdf .code:n =
{
\tl_gput_right:Nn\g_@@_testphase_tl
Expand Down Expand Up @@ -568,7 +563,7 @@
{
\RequirePackage{tagpdf-debug}
}
}
}
,debug / uncompress .code:n =
{
\pdf_uncompress:
Expand Down Expand Up @@ -596,9 +591,14 @@
}
\msg_new:nnn { meta } { lang-missing }
{
The~language~has~not~been~set~in~\token_to_str:N
The~language~has~not~been~set~in~\token_to_str:N
\DocumentMetadata.\\Setting~it~to~'#1'~as~fallback.
}
}
\msg_new:nnn { meta } { testphase-latest-loading }
{
Loading~testphase~modules\\
#1
}
% \end{macrocode}
%
% \begin{macrocode}
Expand Down
6 changes: 3 additions & 3 deletions required/latex-lab/testfiles-OR-luatex/footmisc-003.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Completed box being shipped out [1]
.....\penalty 10000
.....\pdfliteral page <lua data reference ...>
.....\pdfliteral page <lua data reference ...>
.....\pdfstartlink(*+*)x* attr{/Contents (ref) /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 2 } action struct name{footnote*.5} goto name{footnote*.5}
.....\pdfstartlink(*+*)x* attr{/Contents <FEFF0047006F00200074006F002000640065007300740069006E006100740069006F006E00200066006F006F0074006E006F00740065002A002E0035> /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 2 } action struct name{footnote*.5} goto name{footnote*.5}
.....\hbox(8.14003+0.0)x4.48613, direction TLT
......\mathon
......\hbox(0.0+0.0)x0.0, direction TLT
Expand Down Expand Up @@ -101,7 +101,7 @@ Completed box being shipped out [1]
.....\penalty 10000
.....\pdfliteral page <lua data reference ...>
.....\pdfliteral page <lua data reference ...>
.....\pdfstartlink(*+*)x* attr{/Contents (ref) /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 3 } action struct name{footnote*.13} goto name{footnote*.13}
.....\pdfstartlink(*+*)x* attr{/Contents <FEFF0047006F00200074006F002000640065007300740069006E006100740069006F006E00200066006F006F0074006E006F00740065002A002E00310033> /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 3 } action struct name{footnote*.13} goto name{footnote*.13}
.....\hbox(8.14003+0.0)x4.48613, direction TLT
......\mathon
......\hbox(0.0+0.0)x0.0, direction TLT
Expand Down Expand Up @@ -272,7 +272,7 @@ Completed box being shipped out [2]
.....\penalty 10000
.....\pdfliteral page <lua data reference ...>
.....\pdfliteral page <lua data reference ...>
.....\pdfstartlink(*+*)x* attr{/Contents (ref) /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 4 } action struct name{footnote*.21} goto name{footnote*.21}
.....\pdfstartlink(*+*)x* attr{/Contents <FEFF0047006F00200074006F002000640065007300740069006E006100740069006F006E00200066006F006F0074006E006F00740065002A002E00320031> /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 4 } action struct name{footnote*.21} goto name{footnote*.21}
.....\hbox(8.14003+0.0)x4.48613, direction TLT
......\mathon
......\hbox(0.0+0.0)x0.0, direction TLT
Expand Down
Loading

0 comments on commit 7d4ec54

Please sign in to comment.