diff options
author | Karl Berry <karl@freefriends.org> | 2024-06-03 20:04:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-06-03 20:04:07 +0000 |
commit | 095667e8e311bd9b59f53d6d40ac1983ddc50bda (patch) | |
tree | 9d31c0fecac1393f56fc06d611293c137365958a /Master/texmf-dist/source/latex-dev | |
parent | 74e950034080375c2b1e32b02f6d84d750ddcfc4 (diff) |
latex2e-dev (3jun24)
git-svn-id: svn://tug.org/texlive/trunk@71416 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex-dev')
5 files changed, 134 insertions, 42 deletions
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/documentmetadata-support.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/documentmetadata-support.dtx index 54483ec4c90..a629d9c5515 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/documentmetadata-support.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/documentmetadata-support.dtx @@ -350,14 +350,35 @@ \file_input:n {l3backend-testphase-\c_sys_backend_str.def} \ExplSyntaxOff\makeatother % \end{macrocode} -% Set the default language (this requires that the backend has been loaded), -% process the rest of the keys, -% and setup the generic driver. +% +% Process the init keys and setup the generic driver. % \begin{macrocode} - \keys_set_filter:nnn { document / metadata } { init } { lang=en-US, #1 } + \keys_set_filter:nnn { document / metadata } { init } { #1 } \bool_if:NT \g_@@_active_bool { \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref} +% \end{macrocode} +% 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. +% Note: if babel is loaded without a language this gives the language \texttt{und}. +% \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 + { + \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)} + } + } } % \end{macrocode} % \cs{pdfmanagement_add:nnn} has collected values in this hook. @@ -556,6 +577,11 @@ { LaTeX-lab~package~'#1'~not~found. } +\msg_new:nnn { meta } { lang-missing } + { + The~language~has~not~been~set~in~\token_to_str:N + \DocumentMetadata.\\Setting~it~to~'#1'~as~fallback. + } % \end{macrocode} % % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx index ba4addadd26..ce0d46f8155 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx @@ -16,8 +16,8 @@ % % for those people who are interested or want to report an issue. % -\def\ltlabfirstaiddate{2024-03-18} -\def\ltlabfirstaidversion{0.85c} +\def\ltlabfirstaiddate{2024-05-25} +\def\ltlabfirstaidversion{0.85d} %<*driver> \documentclass{l3doc} \EnableCrossrefs @@ -65,6 +65,32 @@ \ltlabfirstaiddate\space v\ltlabfirstaiddate\space Temporary patches to external packages needed for the tagging project] % \end{macrocode} +% \begin{macro}{\FirstAidNeededT} +% This is a very simple help to ensure that we only apply first aid +% to an unmodified package or class. It only works in the case the +% file has already been loaded and the csname \cs{ver@\#1.\#2} got +% defined (holding the current date, version, and short description +% info). We then compare its content to a frozen string and make +% the modification \verb=#3= only if both agree. If they differ we +% assume that the package/class in question got updated by its +% maintainer. +% \begin{macrocode} +\ExplSyntaxOn +\providecommand\FirstAidNeededT[3]{ + \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3} + { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J + \@spaces Expected:^^J + \@spaces\@spaces #3^^J + \@spaces but~ found:^^J + \@spaces\@spaces \use:c{ver@#1.#2}^^J + \@spaces so~ I'm~ assuming~ it~ got~ fixed. + } } + \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3} +} +\ExplSyntaxOff +% \end{macrocode} +% \end{macro} + % \subsection{ams classes} % The amsart and amsbook classes do not use \cs{@author} to store the author list % but a command \cs{authors}. To be able to nevertheless use the authors in the @@ -254,6 +280,41 @@ } % \end{macrocode} % +% \subsection{booktabs} +% In some cases booktabs inserts a +% \cs{multispan} into the table (through the commands \cs{@cmidruleb} +% and \cs{@cmidrulea} and this then errors +% with the tagging code. +% This affects both tabular and longtable +% (but longtable more as booktabs handles lines in longtable differently). +% See also issue \url{https://github.com/latex3/tagging-project/issues/69} +% +% +\ExplSyntaxOn +\AddToHook{package/booktabs/after} + { + \def\@cmidrulea{ + \multispan\@cmidla + &\multispan\@cmidlb + \unskip\hskip\cmrkern@l + { + \tag_mc_begin:n{artifact} + \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@} + \hskip\cmrkern@r + \tag_mc_end: \int_gdecr:N \g__tbl_row_int + \cr} + + \def\@cmidruleb{% + \multispan\@cmidlb + \unskip\hskip \cmrkern@l% + { + \tag_mc_begin:n{artifact} + \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@} + \hskip\cmrkern@r + \tag_mc_end: \int_gdecr:N \g__tbl_row_int + \cr} + } +\ExplSyntaxOff % % \begin{macrocode} %</package> diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx index 4fabde3d11a..0dbc5911852 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx @@ -19,8 +19,8 @@ % for those people who are interested or want to report an issue. % % -\def\ltlabmathdate{2024-02-09} -\def\ltlabmathversion{0.5i} +\def\ltlabmathdate{2024-04-16} +\def\ltlabmathversion{0.5j} % %<*driver> \documentclass{l3doc} @@ -654,15 +654,15 @@ % a simple Desc key, take care that it is a valid string! % \begin{macrocode} \pdfdict_put:nne {l_pdffile/Filespec} {Desc}{(mathml-#1)} - \pdffile_embed_stream:nnN {#4}{mathml-#1.xml}\l_tmpa_tl + \pdffile_embed_stream:nnN {#4}{mathml-#1.xml}\l_@@_tmpa_tl % \end{macrocode} % not strictly necessary but makes the files visible in the file attachment % page % \begin{macrocode} \bool_if:NT \l__tag_math_mathml_pane_bool - {\pdfmanagement_add:nne {Catalog/Names}{EmbeddedFiles}{\l_tmpa_tl}} + {\pdfmanagement_add:nne {Catalog/Names}{EmbeddedFiles}{\l_@@_tmpa_tl}} \tl_new:c{g_@@_mathml_#3_tl} - \tl_gset_eq:cN{g_@@_mathml_#3_tl}\l_tmpa_tl + \tl_gset_eq:cN{g_@@_mathml_#3_tl}\l_@@_tmpa_tl } } % \end{macrocode} @@ -1374,17 +1374,18 @@ \@@_process:nn { math } {#1} % $ % \end{macrocode} % We do not want math tagging in fakemath or when measuring, +% We also do not want math tagging if tagging has been suspended. % \begin{macrocode} \bool_lazy_or:nnTF {\legacy_if_p:n { measuring@ }} { \l_@@_fakemath_bool } { #1 $ } { - \socket_use:n {tagsupport/math/inline/begin} %end P-MC - \socket_use:nn{tagsupport/math/inline/formula/begin}{#1} + \tag_socket_use:n {math/inline/begin} %end P-MC + \tag_socket_use:nn {math/inline/formula/begin}{#1} $ - \socket_use:n {tagsupport/math/inline/formula/end} - \socket_use:n {tagsupport/math/inline/end} % restart P-MC + \tag_socket_use:n {math/inline/formula/end} + \tag_socket_use:n {math/inline/end} % restart P-MC } } } diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx index a6087abe578..cfc06c7b093 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx @@ -26,7 +26,7 @@ % \fi % \title{Prototype reimplementation of \LaTeXe{}'s role mapping} % \author{\LaTeX{} Project, initial implementation Ulrike Fischer} -% \date{v0.8 2023-09-04} +% \date{v0.8b 2024-03-24} % % \maketitle % @@ -62,18 +62,33 @@ % \begin{macrocode} title, Title, pdf2, part, Title, pdf2, +% \end{macrocode} +% Headings differ in article and book class. This here is for article: +% \begin{macrocode} section, H1, pdf2, subsection, H2, pdf2, subsubsection,H3, pdf2, paragraph, H4, pdf2, subparagraph, H5, pdf2, +% \end{macrocode} +% And this here is used in book: +% \begin{macrocode} +%chapter, H1, pdf2, +%section, H2, pdf2, +%subsection, H3, pdf2, +%subsubsection, H4, pdf2, +%paragraph, H5, pdf2, +%subparagraph, H6, pdf2, +% \end{macrocode} +% +% \begin{macrocode} list, L, pdf2, itemize, L, pdf2, enumerate, L, pdf2, description, L, pdf2, quote, BlockQuote,pdf, quotation, BlockQuote,pdf, -verbatim, Div, pdf2, +verbatim, Div, pdf2, % overwritten by block item, LI, pdf2, itemlabel, Lbl, pdf2, itembody, LBody, pdf2, diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx index 5352df95506..38596478aeb 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx @@ -16,8 +16,8 @@ % % for those people who are interested or want to report an issue. % -\def\ltlabtbldate{2024-02-07} -\def\ltlabtblversion{0.85k} +\def\ltlabtbldate{2024-05-25} +\def\ltlabtblversion{0.85i} %<*driver> \documentclass{l3doc} \EnableCrossrefs @@ -121,11 +121,14 @@ % \verb|\tagpdfsetup{table/tagging=false}| or with \verb|\tagpdfsetup{table/tagging=presentation}|% % \footnote{The key has been renamed. The old name `table-tagging` still works but is % deprecated. The value \texttt{presentation} refers to the ARIA role \enquote{presentation}.} -% The first option disables the table tagging code and he content of the tabular +% The first option disables the table tagging code and the content of the tabular % is then treated more or less like running text. This works ok for simple tables using % only hmode-cells (l/c/r) with normal text content, but fails if the table uses vmode-cells % (p/m/b). In such cases the second option works better: it keeps the tagging code active -% but changes the tag names to \texttt{Div} and the grouping structure \texttt{NonStruct}. +% but changes the tag names to \texttt{Div} and the grouping structure \texttt{NonStruct}. It also +% (re)sets the \texttt{table/header-rows} key to empty. +% The key should currently only be used in a group as there is no key (yet) to reset to the default +% tag names. % % Inside cells the automatic tagging of paragraphs is disabled with the exception of % p/m/b-type cells. @@ -570,7 +573,7 @@ \prop_if_exist:cT { g__tag_struct_ \l_@@_tmpa_tl _prop } { - \@@_struct_prop_gput:Vnn \l_@@_tmpa_tl {S}{/Artifact} + \exp_args:No \__tag_struct_prop_gput:nnn {\l_@@_tmpa_tl} {S}{/Artifact} } } } @@ -661,7 +664,7 @@ \prop_if_exist:cT { g__tag_struct_ \l_@@_tmpa_tl _prop } { - \@@_struct_prop_gput:Vnn \l_@@_tmpa_tl {S}{/Artifact} + \exp_args:No\__tag_struct_prop_gput:nnn {\l_@@_tmpa_tl} {S}{/Artifact} } } } @@ -883,6 +886,7 @@ \tl_set:Nn\l_@@_pcelltag_tl {NonStruct} \tl_set:Nn\l_@@_celltag_tl {text} \tl_set:Nn\l_@@_tabletag_tl {Div} + \clist_clear:N \l_@@_header_rows_clist }, table/tagging .default:n = true, table/tagging .initial:n = true @@ -953,28 +957,13 @@ % % \begin{variable}{\l_@@_header_rows_clist} % This holds the numbers of the header rows. Negative numbers are -% possible and count from the back. +% possible and count from the last column backwards. % \begin{macrocode} \clist_new:N \l_@@_header_rows_clist % \end{macrocode} % \end{variable} % % \begin{macro}{\@@_set_header_rows:} -% TEMP: Next tagpdf will have the right command which also updates -% the debug info. -% For now a temporary command: -% \begin{macrocode} -\cs_if_free:NTF \__tag_struct_prop_gput:nnn - { - \cs_new_protected:Npn \@@_struct_prop_gput:nnn #1#2#3 - { \prop_gput:cnn { g__tag_struct_#1_prop }{#2}{#3} } - } - { \cs_new_protected:Npn \@@_struct_prop_gput:nnn #1#2#3 - { \__tag_struct_prop_gput:nnn {#1}{#2}{#3} } - } -\cs_generate_variant:Nn \@@_struct_prop_gput:nnn {nne,Vnn} -% \end{macrocode} -% % \begin{macrocode} \cs_new_protected:Npn \@@_set_header_rows: { @@ -991,7 +980,7 @@ % \begin{macrocode} \prop_if_exist:cT { g__tag_struct_####1_prop } { - \@@_struct_prop_gput:nnn{ ####1 }{S}{/TH} + \__tag_struct_prop_gput:nnn{ ####1 }{S}{/TH} % \end{macrocode} % This need refinement once row headers (and perhaps other attributes) % are used too, but for now it should be ok. @@ -1000,8 +989,8 @@ { g__tag_struct_####1_prop } { C } \l_@@_tmpa_tl - {\@@_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l_@@_tmpa_tl]} } - {\@@_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}} + {\__tag_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l_@@_tmpa_tl]} } + {\__tag_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}} } } } |