[latex3-commits] [latex3/latex2e] latexlab/tagging-9: move rolemapping in dedicated file (7aea29f3)
github at latex-project.org
github at latex-project.org
Mon Sep 4 19:07:34 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : latexlab/tagging-9
Link : https://github.com/latex3/latex2e/commit/7aea29f376b0da18e94f123a6d04b5929e4a56e9
>---------------------------------------------------------------
commit 7aea29f376b0da18e94f123a6d04b5929e4a56e9
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Sep 4 19:07:34 2023 +0200
move rolemapping in dedicated file
>---------------------------------------------------------------
7aea29f376b0da18e94f123a6d04b5929e4a56e9
required/latex-lab/build.lua | 1 +
required/latex-lab/latex-lab-block.dtx | 36 +----------
required/latex-lab/latex-lab-float.dtx | 8 +--
required/latex-lab/latex-lab-footnotes.dtx | 9 +--
required/latex-lab/latex-lab-namespace.dtx | 96 ++++++++++++++++++++++++++++++
required/latex-lab/latex-lab-new-or-2.dtx | 12 ++--
required/latex-lab/latex-lab.ins | 7 +++
7 files changed, 116 insertions(+), 53 deletions(-)
diff --git a/required/latex-lab/build.lua b/required/latex-lab/build.lua
index 891aaa05..f8049d9a 100644
--- a/required/latex-lab/build.lua
+++ b/required/latex-lab/build.lua
@@ -15,6 +15,7 @@ installfiles = {
"*.ltx",
"*.sty",
"glyphtounicode-cmex.tex",
+ "tagpdf-ns-latex-lab.def"
}
typesetfiles = {
"latex-lab-*.dtx",
diff --git a/required/latex-lab/latex-lab-block.dtx b/required/latex-lab/latex-lab-block.dtx
index a4a028db..3bd06b72 100644
--- a/required/latex-lab/latex-lab-block.dtx
+++ b/required/latex-lab/latex-lab-block.dtx
@@ -1240,12 +1240,6 @@
}
% \end{macrocode}
%
-% Again something that should probably elsewhere: the rolemapping.
-% \begin{macrocode}
-\tag_if_active:T {
- \tagpdfsetup{add-new-tag={tag=list,role=L}}
-}
-% \end{macrocode}
% \end{environment}
%
%
@@ -2839,14 +2833,7 @@
% \subsubsection{Blockquote instances}
%
% \begin{instance}{blockenv quotation}
-%
-% \begin{macrocode}
-\tag_if_active:T {
- \tagpdfsetup{add-new-tag={tag=quote,role=BlockQuote}}
- \tagpdfsetup{add-new-tag={tag=quotation,role=BlockQuote}}
-}
-% \end{macrocode}
-%
+ %
% \begin{macrocode}
\DeclareInstance{blockenv}{quotation}{display}
{
@@ -2939,30 +2926,13 @@
%
% We use \struct{theorem-like} as the structure name and rolemap it
% to a \struct{Sect} because that can hold a \struct{Caption}.
-% \begin{macrocode}
-\tag_if_active:T {
- \tagpdfsetup{add-new-tag={tag=theorem-like,role=Sect}}
-}
-% \end{macrocode}
-%
-%
-%
%
% \subsubsection{Verbatim instances}
%
% \begin{instance}{blockenv verbatim}
%
-% \begin{macrocode}
-\tag_if_active:T {
- \tagpdfsetup{add-new-tag={tag=verbatim,role=P}}
- \tagpdfsetup{add-new-tag={tag=codeline,role=Sub}}
-% \end{macrocode}
-% Possible alternative for PDF 1.7:
-% \begin{macrocode}
-% \tagpdfsetup{add-new-tag={tag=verbatim,role=Div}}
-% \tagpdfsetup{add-new-tag={tag=codeline,role=P}}
-}
-% \end{macrocode}
+% The rolemapping is current verbatim to P and codeline to Sub (which is role mapped
+% to Span in pdf 1.7. Alternatives for PDF 1.7: Div and P.
%
% \begin{macrocode}
\DeclareInstance{blockenv}{verbatim}{display}
diff --git a/required/latex-lab/latex-lab-float.dtx b/required/latex-lab/latex-lab-float.dtx
index 35deb300..3bd34836 100644
--- a/required/latex-lab/latex-lab-float.dtx
+++ b/required/latex-lab/latex-lab-float.dtx
@@ -134,13 +134,7 @@
{Code related to the tagging of floats}
% \end{macrocode}
% \subsection{Variables}
-% We rolemap to Aside, and float sections to Sect
-%
-% \begin{macrocode}
-\tagpdfsetup{add-new-tag=float/Aside}
-\tagpdfsetup{add-new-tag=figures/Sect}
-\tagpdfsetup{add-new-tag=tables/Sect}
-% \end{macrocode}
+% We rolemap to float to Aside, and float sections to Sect.
%
% \begin{variable}{
% \g_@@_float_sect_prop,
diff --git a/required/latex-lab/latex-lab-footnotes.dtx b/required/latex-lab/latex-lab-footnotes.dtx
index fd231e5f..f62d12bf 100644
--- a/required/latex-lab/latex-lab-footnotes.dtx
+++ b/required/latex-lab/latex-lab-footnotes.dtx
@@ -17,8 +17,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfootnotedate{2023-07-26}
-\def\ltlabfootnoteversion{0.8b}
+\def\ltlabfootnotedate{2023-09-04}
+\def\ltlabfootnoteversion{0.8c}
%<*driver>
\documentclass{l3doc}
@@ -715,11 +715,6 @@
%
% \begin{itemize}
%
-% \item tagging destroys footnotes directly following the text with pdflatex.
-%
-%
-% \item there is a dependency to etoolbox as we patch \cs{\@iiiminipage}
-%
% \item Special formatting of footnote marks in the text, e.g. if ranges or commas are
% used require special care as they should normally mark up such text as artifacts and
% perhaps have to insert empty structures to represent an invisible mark. This must be coordinated
diff --git a/required/latex-lab/latex-lab-namespace.dtx b/required/latex-lab/latex-lab-namespace.dtx
new file mode 100644
index 00000000..02032fa1
--- /dev/null
+++ b/required/latex-lab/latex-lab-namespace.dtx
@@ -0,0 +1,96 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-namespace.dtx (C) Copyright 2023 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% https://www.latex-project.org/lppl.txt
+%
+%<*driver>
+\documentclass{l3doc}
+\usepackage{amstext}
+\EnableCrossrefs
+\CodelineIndex
+
+\usepackage{todonotes}
+
+\begin{document}
+ \DocInput{latex-lab-namespace.dtx}
+\end{document}
+%</driver>
+% \title{Prototype reimplementation of \LaTeXe{}'s role mapping}
+% \author{\LaTeX{} Project, initial implementation Ulrike Fischer}
+% \date{v0.8 2023-09-04}
+%
+% \maketitle
+%
+% \begin{documentation}
+%
+%
+%
+% \section{Introduction}
+%
+% This short file collects tag names from the \LaTeX{} namespace and their role mapping used
+% in the latex-lab files. The names are not necessarly the final ones!
+%
+% Later settings of the same tag overwrite previous settings.
+% The syntax of the file is a comma list with three (1) commas per line:
+% \begin{verbatim}
+% latex-tag, PDF-tag, name space,
+% \end{verbatim}
+%
+% The name space is normally pdf2 with the exception of the following PDF-tags
+% which are only in pdf namespace:
+% Art, BlockQuote, TOC, TOCI, Index, Private, Quote, Note,
+% Reference, BibEntry, Code.
+%
+% \begin{macrocode}
+%<*ns-latex-lab>
+%% \ProvidesExplFile {tagpdf-ns-latex-lab.def} {2023-09-04} {0.8}
+%% {latex} {https://www.latex-project.org/ns/lab/2022}{}
+% \end{macrocode}
+% \subsection{Role from tagpdf}
+% The following tags are already set by tagpdf, so deleting here will not remove them.
+% \begin{macrocode}
+title, Title, pdf2,
+part, Title, pdf2,
+section, H1, pdf2,
+subsection, H2, pdf2,
+subsubsection,H3, pdf2,
+paragraph, H4, pdf2,
+subparagraph, H5, pdf2,
+list, L, pdf2,
+itemize, L, pdf2,
+enumerate, L, pdf2,
+description, L, pdf2,
+quote, BlockQuote,pdf,
+quotation, BlockQuote,pdf,
+verbatim, Div, pdf2,
+item, LI, pdf2,
+itemlabel, Lbl, pdf2,
+itembody, LBody, pdf2,
+footnote, FENote, pdf2,
+footnotemark, Lbl, pdf2,
+footnotelabel,Lbl, pdf2,
+text-unit, Part, pdf2,
+text, P, pdf2,
+% \end{macrocode}
+% \subsection{From block code}
+% \begin{macrocode}
+theorem-like, Sect, pdf2,
+verbatim, P, pdf2,
+codeline, Sub, pdf2,
+% \end{macrocode}
+% \subsection{From float code}
+% \begin{macrocode}
+float, Aside, pdf2,
+figures, Sect, pdf2,
+tables, Sect, pdf2,
+% \end{macrocode}
+% \begin{macrocode}
+%</ns-latex-lab>
+% \end{macrocode}
+\endinput
diff --git a/required/latex-lab/latex-lab-new-or-2.dtx b/required/latex-lab/latex-lab-new-or-2.dtx
index fb06f8e0..5f554088 100644
--- a/required/latex-lab/latex-lab-new-or-2.dtx
+++ b/required/latex-lab/latex-lab-new-or-2.dtx
@@ -17,8 +17,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabneworIIdate{2023-07-25}
-\def\ltlabneworIIversion{0.85b}
+\def\ltlabneworIIdate{2023-09-04}
+\def\ltlabneworIIversion{0.85c}
%<*driver>
\documentclass{l3doc}
@@ -85,7 +85,7 @@
% are moved to the defer list in an appropriate way (for now we
% don't offer any interface for that scenario).
%
-% Before the code in the soocket is run, any existing glue at the bottom
+% Before the code in the socket is run, any existing glue at the bottom
% of the \cs{@outputbox} is removed and stored in a safe
% place. If needed, it can be reinserted with one of the helper
% commands.
@@ -141,7 +141,7 @@
% \fmi{Decide on names for these helper commands. We could keep
% them similar to the above (because they are only supposed to be
% used by a few packages). However, we could alternatively use
-% CamelCase names, under the assumption that clases may also
+% CamelCase names, under the assumption that classes may also
% directly define a plug for the socket, instead of loading a
% support package such as \pkg{footmisc} (or in addition
% to). --- decide}
@@ -196,7 +196,7 @@
% the result back into it (and nothing else!). By default it
% does nothing, i.e., has the \plug{noop} assigned.
%
-% If (short) footnotes are run as a pargraph this socket gets
+% If (short) footnotes are run as a paragraph this socket gets
% the plug \plug{para} assigned which is defined elsewhere.
%
% \end{description}
@@ -342,7 +342,7 @@
% short, but the footnotes are not pushed to the bottom.
%
% In \pkg{footmisc} \cs{@outputbox at removebskip} is only applied when
-% \pkg{footmisc} is called with with an option specifying the
+% \pkg{footmisc} is called with an option specifying the
% footnote placement, i.e., not in the default case.
% In new documents we apply it always.
% \begin{macrocode}
diff --git a/required/latex-lab/latex-lab.ins b/required/latex-lab/latex-lab.ins
index d7e73e1a..a4aeb728 100644
--- a/required/latex-lab/latex-lab.ins
+++ b/required/latex-lab/latex-lab.ins
@@ -152,6 +152,13 @@ where one can also log issues in case there are any.
\generate{\file{firstaid-latex-lab-testphase.ltx}{\from{latex-lab-firstaid.dtx}{latex-lab}}}
\generate{\file{latex-lab-testphase-firstaid.sty}{\from{latex-lab-firstaid.dtx}{package}}}
+% stop docstrip adding \endinput
+\preamble
+\endpreamble
+\postamble
+\endpostamble
+% namespace definitions
+\generate{\file{tagpdf-ns-latex-lab.def}{\from{latex-lab-namespace.dtx}{ns-latex-lab}}}
\endbatchfile
More information about the latex3-commits
mailing list.