Skip to content

Commit

Permalink
Update various latex-lab modules (#1275)
Browse files Browse the repository at this point in the history
* exclude tabular* from math grabbing issue latex3/tagging-project#25

* use cmd hook for array in table code, latex3/tagging-project#28

* step version, update changes.txt

* switch to e-type

* update pdfmanagement

* update pdfmanagement

* correct date

* math docu improvements

* load amsmath earlier

* guard tag variables, issue latex3/tagging-project#15

* docu + spaces

* replace para check by tagpdf command

* update tagpdf to 0.98n

* correct typo in testfile

* Correct typo in testfile

* Correct expl3 loading

* update tests to new tagpdf (removed l3ref-tmp)

* allow also tabular to call table code, issue #1174

* correct tests

* remove processor from \(..\), latex3/tagging-project#29

* add math disable/enable command

* usage of \m@th file

* document table key

* move variables from pdfresources

* add more docu about grabbing and fakemath

* spaces

* add fakemath boolean

* typo

* begin with sockets

* clean up split code

* docu

* update test (MC-push)

* add pdfmanagement version 0.96c

* add tagpdf 0.98p

* handle para counter, issue latex3/tagging-project#34

* missing tlg

* update tests (mc uses push/pop)

* missing \end{variable}

* correct test and message for item outside list, latex3/tagging-project#35

* update changes.txt

* update tests

* use para-wrapper

* update tagpdf to 0.98q

* continue with sockets

* move text content to socket

* grumpf

* add Span in toc for nested links, latex3/tagging-issue#26, WIP [ci-skip]

* revert adding span in toc for now

* more sockets

* more move to sockets

* more documentation

* correct guards

* more docu

* rename plugs

* start with display math sockets

* display math sockets

* remove duplicated intertext definition

* correct sign of intertext

* register alignat and alignat*

* correct intertext also in mathtools

* correct docu

* take latex-lab-table.dtx from uf-review-05

* latex-lab-table: move   \@@_show_curr_cell_data: into socket ;
array: put sockets into array ;
array: updated \insert@column to use sockets

* first stab at tabularx (WIP)

* getting there (tabularx)

* fix docu

* switch to Alt instead of Actualtext as the default

* display sockets

* fix so that the code runs when tagging is not used

* leftover \end{macrocode}

* update testfile (special from unused tagmcend is now hidden)

* remove kernel@math@begin

* update test (tagging code hidden in socket)

* use grabbing with \[ always

* clean up code

* add verst version of lttag.dtx

* simplify tabularx

* provide \ProvideDocElement

* change lttag -> lttagging;
us separate \insert@pcolumn with its own sockets

* WIP (broken)

* WIP

* WIP (working again)

* WIP

* medium rewrite/restructure (WIP)

* would have been too easy

* and a doc issue

* and one more

* move multicolumn changed into array;
change begindocument hook chunk to "kernel"

* better also add the socket declaration in the right file

* starting with L3 layer in array (WIP)

* added missing \MaintainedBy defs

* l3doc needs amsmath :-(

* updated \@array in array

* move \ar@ialign into array

* tracing/debugging now optional

* move \@addamp

* move \@Arraycr

* move \endarry ; add \ar@crcr

* move cell data handling to lttaging;
start with longtable (WIP)

* stray macrocode

* use   \tbl_update_multicolumn_cell_data:n

* more work on longtable (WIP)

* update \endlongtable and \LT@t@bularcr (WIP)

* hopefully fixed logic for \endhead and friends;
also fixed \hline issue (guess \cline needs also attention but not tonight)

* trying to get around l3bitset issue

* using newer kernel with l3bitset included

* l3bibset vanished

* sigh

* and a docu fix

* cleanup docu (WIP)

* docu changes (fail table-14-pbox)

* doc updates for "array"

* really update pdfmanagement

* some typos

* renamed a couple of sockets; but more docu

* add preliminary support for fakemath in tabular

* more updates and documentation

* enable math tagging in tabular if table code is loaded

* add alt text on subformulas to satisfy validator

* getting ready for first draft

* update tests

* implemented most of Ulrike's suggestions

* update test

* more suggestions

* cleanup after merge

* tagging support for maketitle in standard classes

* correct variable

* set metadata from title

* switch hook

* add testfiles

* setup test workflow

* sh for updates

* Update tests

* move \@tabular patch into math code

* add pdfauthor

* remove fakemath commands, probably unneeded

* add math/end socket for luamml flags

* add pdfsubtitle key

* some docu/comments in title module

* start to move mml-code, WIP

* keys for AF, WIP

* mumble

* embed mathml-xml-files if they exist

* add mathml support

* repair tagging if subparts are suppressed

* improve texsource stream

* add missing spaces, see issue latex3/tagging-project#57

* add variables for tag names in tables

* happy new year

* correct date, tabletag variable

* update test files to new tag variables.

* correct destination issue latex3/tagging-project#55

* guard code so that it works also without tagging

* update changes.txt

* handle \mathchoice in \text

* update test

* add mathml statistic

* extend table-disable to support also p-columns

* add support for attribute-class in para-main

* write mathml template, WIP

* Update tagpdf to 0.98s

* correct guard

* make \@title and \@author robust

* add support for authors in amsart.cls

* document html format (WIP)

* switch to html reader

* write html template

* correct html template

* correct docu

* correct docu

* add environment to hash

* update testfile2

* more restrictive catcode changes

* option to activate /Alt with mathml-AF

* disable math grabbing in begindocument

* update tagpdf

* missing testfile update

* more testfiles updates

* update testfiles in tools

* update tagpdf and testfiles

* first draft marginpar tagging

* correct docu errors

* correct case with optional argument

* add testfiles

* Update tagpdf to 0.98v

* one more testfiles

* more luatex testfiles.

* fix caption outside float handling

* use three runs

* update test.

* add missing space, latex3/tagging-project#50

* update tagpdfsetup keys in table

* rename tagpdfsetup keys

* update testfile template->dummy

* add changes entry

* update version float

* add marginpar to phase-III

* rename keys, rename layout value to raster

* force display title if UA-standard is used

* update key names, WIP

* Correct source mime type.

* add keys for AF-files

* remove socket redefinition

* use $ in texsource template (for ngpdf/mathjax)

* update math tests after change from begin{math} to $

* change from raster to presentation (as in ARIA)

* docu improvement

* add some ltnews text

* left align description labels

* update dates, correct some missing references

* update changes.txt

* address Davids comments

---------

Co-authored-by: Ulrike Fischer <fischer@troubleshooting-tex.de>
Co-authored-by: Frank Mittelbach <frank.mittelbach@latex-project.org>
  • Loading branch information
3 people committed Feb 13, 2024
1 parent 10a330e commit 0bc666d
Show file tree
Hide file tree
Showing 280 changed files with 50,186 additions and 15,087 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ jobs:
config: config-table-pdftex
- module: required/latex-lab
config: config-table-luatex
- module: required/latex-lab
config: config-title
- module: required/tools
name: "Tests: ${{ matrix.module }}${{ matrix.config && format(' - {0}', matrix.config) || ''}}${{ matrix.engine && format(' - {0}', matrix.engine) || ''}}${{ (matrix.first || matrix.last) && format(' ({0} - {1})', matrix.first || '<first>', matrix.last || '<last>') || ''}}"
needs: texlive-cache
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pretest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ jobs:
config: config-table-pdftex
- module: required/latex-lab
config: config-table-luatex
- module: required/latex-lab
config: config-title
- module: required/tools
name: "Tests: ${{ matrix.module }}${{ matrix.config && format(' - {0}', matrix.config) || ''}}${{ matrix.engine && format(' - {0}', matrix.engine) || ''}}"
needs: texlive-cache
Expand Down
23 changes: 23 additions & 0 deletions base/doc/ltnews39.tex
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,29 @@ \section{News from the \enquote{\LaTeX{} Tagged PDF} project}
for tagging, which will then also include the information currently
found in various other places, e.g., \texttt{tagpdf.pdf}.

We also added support for a few missing commands
described in Leslie Lamport's \emph{\LaTeX{}
Manual}~\cite{38:Lamport}: If \texttt{phase-III} is used
the \cs{marginpar} command will be properly tagged (depending on
the PDF version) as an \texttt{Aside} or a \texttt{Note} structure.
In the standard classes \cs{maketitle} will be tagged if the additional
testphase module \texttt{title} is used.

The \texttt{math} module has been extended and now includes
options to attach MathML files to the structures.
First tests with a PDF reader and screen reader that support
associated files looks very promising. Examples of PDF files tagged with the
new method can be found at
\url{https://github.com/latex3/tagging-project/discussions/56}.

At last various small bugs and problems reported at
\url{https://github.com/latex3/tagging-project}
has been fixed. Such a feedback is very valuable,
so we hope to see you there and thank you for
any contribution, whether it is an issue or a post on a discussion
thread.



\section{Enhancements to the new mark mechanism}

Expand Down
3 changes: 2 additions & 1 deletion required/latex-lab/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ checkconfigs =
"config-bib",
"config-LM-tagging",
"config-table-pdftex",
"config-table-luatex"
"config-table-luatex",
"config-title"
}


Expand Down
82 changes: 82 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,88 @@
2024-02-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx: left align description labels.

2024-02-07 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: change value layout to presentation (as in ARIA).

2024-02-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: add keys to suppress AF-files locally

2024-02-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-title.dtx: force DisplayDocTitle if UA-standard is detected

2024-02-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-testphase.dtx: add marginpar tagging to phase-III

2024-02-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx, latex-lab-table.dtx: adapt tagpdfsetup keys

2024-02-07 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: change key names from table-tagging to table/tagging

2024-02-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-float.dtx: fix caption outside float error

2024-02-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-toc-kernel-changes.dtx: fix spurious space, tagging-project#50

2024-01-29 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: disable mathgrabbing in begindocument hook.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-firstaid.dtx: add support for \authors from amsart.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-title.dtx: make \@title and \@author robust to avoid errors
if they are not set.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: add support for layout tables.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx: add support to set an attribute-class for para-main.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: add option table-tagging=layout

2024-01-17 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx, latex-lab-amsmath.dtx, redefine \text to
avoid faulty structure and faulty PDF from \mathchoice.
Add statistic for mathml handling.

2024-01-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-float.dtx, correct destination, see tagging issue #55

2024-01-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx, correct error message for environments,
see tagging issue #57

2024-01-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: add some variables for tag names

2024-01-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* move mathml-AF support into latex-lab-math.ltx

2023-12-27 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* added latex-lab-title.dtx for maketitle/title and author tagging.

2023-11-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx, correct error message for items outside lists
see tagging issue #35

2023-11-17 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx, latex-lab-sec.dtx: use wrapper for para counter,
see tagging issue #34

2023-11-12 Joseph Wright <Joseph.Wright@latex-project.org>
* latex-lab-math.dtx: tidy variant creation, switch to e-type expansion

2023-11-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: remove processor in \(..\), see tagging issue #29

2023-11-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: handle also tabular*, see tagging issue #25
* latex-lab-table.dtx: use cmd hook for array, see tagging issue #28

2023-10-30 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* added latex-lab-table.dtx for basic table tagging.

Expand Down
2 changes: 1 addition & 1 deletion required/latex-lab/config-block.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ checkengines = {"pdftex","luatex"}
checksearch = true
testfiledir = "testfiles-block"

checkruns = 2
checkruns = 3
forcecheckruns = true --- for tagged stuff


2 changes: 1 addition & 1 deletion required/latex-lab/config-minipage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ checkengines = {"pdftex","luatex"}
checksearch = true
testfiledir = "testfiles-minipage"

checkruns = 2
checkruns = 3
forcecheckruns = true --- for tagged stuff


11 changes: 11 additions & 0 deletions required/latex-lab/config-title.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Tests for output routine stuff
--
-- Tests here only function locally due to the class not loaded in github actions!


checkengines = {"pdftex","luatex"}
checksearch = true
testfiledir = "testfiles-title"

checkruns = 2

48 changes: 37 additions & 11 deletions required/latex-lab/documentmetadata-support.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,17 @@
% features developed as part of the multi-year ``Tagged PDF''
% 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}

% \section{Currently supported key/values}
%
%
Expand Down Expand Up @@ -215,6 +224,10 @@
% This code is also loaded by the \texttt{phase-III} 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{firstaid}] This contains small adjustments to external packages.
% The module is currently not loaded by any \texttt{phase} key.
% \end{description}
Expand Down Expand Up @@ -274,8 +287,28 @@
\ExplSyntaxOn\makeatletter
% \end{macrocode}

% \subsection{Variables}
% These variable definitions are currently also done in ltdocinit.
% They can be removed from there once latex-lab has been updated to
% provide them too.
% \begin{variable}{\g_@@_firstaidoff_clist}
% A list to store the firstaid code which should be disabled
% \begin{macrocode}
\clist_if_exist:NF \g_@@_firstaidoff_clist
{ \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_if_exist:NF \g_@@_testphase_tl
{ \tl_new:N \g_@@_testphase_tl }
% \end{macrocode}
% \end{variable}


% \subsection{\cs{DocumentMetadata}}
%
% \begin{macro}{\DocumentMetadata}
%
% \cs{DocumentMetadata} should not be used after
Expand Down Expand Up @@ -348,15 +381,8 @@
% \end{macrocode}
% \end{macro}




%\subsection{\cs{DocumentMetadata} keys}
% \begin{macrocode}
%FMi defined elsewhere
%FMi
%FMi \clist_new:N \g_@@_firstaidoff_clist
%FMi \tl_new:N \g_@@_testphase_tl
% UFi should the definition move to here?
\keys_define:nn { document / metadata }
{
backend .choices:nn =
Expand Down
90 changes: 85 additions & 5 deletions required/latex-lab/latex-lab-amsmath.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%
%% File: latex-lab-amsmath.dtx
%
% Copyright (C) 2022,2023 The LaTeX Project
% Copyright (C) 2022-2024 The LaTeX Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
Expand Down Expand Up @@ -66,7 +66,7 @@
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-amsmath.ltx}
[2023-01-05 v0.1a amsmath adaptions]
[2024-02-12 v0.1b amsmath adaptions]
% \end{macrocode}
% \subsection{Tagpdf support}
% To make the code independent from tagging being loaded and active
Expand All @@ -90,7 +90,11 @@
\def\intertext##1{%
\ifvmode\else\\\@empty\fi
\noalign{%
\penalty\postdisplaypenalty\vskip\belowdisplayskip
% \end{macrocode}
% we have to flip the sign and use a negative \cs{belowdisplayskip}
% as we flipped the sign at the outside.
% \begin{macrocode}
\penalty\postdisplaypenalty\vskip-\belowdisplayskip
\vbox{
% \end{macrocode}
% Stop tagging when measuring:
Expand All @@ -105,9 +109,13 @@
% \begin{macrocode}
\tag_mc_end_push:
% \end{macrocode}
% We are already in a par so we change now to Span:
% We are already in a par so we change now to text:
% \begin{macrocode}
\tagpdfsetup{paratag=P}%
% \end{macrocode}
% TODO why \cs{tagpdfparaOn} needed?
% \begin{macrocode}
\tagpdfsetup{paratag=Span}%
\tagpdfparaOn
\noindent\ignorespaces##1\par
% \end{macrocode}
% Restart the MC
Expand All @@ -119,6 +127,78 @@
}
% \end{macrocode}
%
% \subsection{\cs{text}}
%
% The \cs{text} command uses \cs{mathchoice} which \enquote{typesets} the argument
% four times. This makes it quite problematic for tagging. Without precautions
% structure objects would be created four times and would get MC-chunks as kids
% that doesn't really exist. amsmath contains a switch that allows to execute code
% only in the first (displaymath) branch, but that isn't usable here. At first because
% we don't know if the first branch creates the same structure as the one that is
% actually used. At second because the engines executes some commands like \cs{label}
% and \cs{pdfannot} only at shipout from the branch that really was used. So we would
% get structure data from one \cs{mathchoice}-branch and MC-labels and links from another
% one and that gets very messy.
%
% We therefore have to avoid that tagging is active in unused branches. In pdflatex it
% is not possible to detect the mathstyle before, so we use a label. With lualatex is
% is possible to redefine \cs{text} not to use \cs{mathchoice}
%
% \begin{macrocode}
\AddToHook{package/amstext/after}
{
% \end{macrocode}
% currently amsmath is loaded in a begindocument hook, so this
% test is fine. If amstext is loaded earlier (in the kernel), this needs perhaps a change.
% \begin{macrocode}
\tag_if_active:T
{
\sys_if_engine_luatex:TF
{
\def\text@#1{{%
\ifcase\mathstyle
\hbox{{#1}}\or
\hbox{{#1}}\or
\hbox{{#1}}\or
\hbox{{#1}}\or
\hbox{{\let\f@size\sf@size\selectfont#1}}\or
\hbox{{\let\f@size\sf@size\selectfont#1}}\or
\hbox{{\let\f@size\ssf@size\selectfont#1}}\or
\hbox{{\let\f@size\ssf@size\selectfont#1}}\or
\ERROR
\fi
\check@mathfonts
}}
}
{
\def\text@#1
{{
\int_gincr:N\g__math_mathchoice_int
\tag_stop:
\mathchoice
{
\@@_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{0}
\textdef@\displaystyle\f@size{#1}
}
{
\@@_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{2}
\textdef@\textstyle\f@size{\firstchoice@false #1}
}
{
\@@_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{4}
\textdef@\textstyle\sf@size{\firstchoice@false #1}
}
{
\@@_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{6}
\textdef@\textstyle \ssf@size{\firstchoice@false #1}
}
\check@mathfonts
}}
}
}
}
% \end{macrocode}
%
% \begin{macrocode}
\ExplSyntaxOff
% \end{macrocode}
Expand Down

0 comments on commit 0bc666d

Please sign in to comment.