Skip to content

Commit

Permalink
move rolemapping in dedicated file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Sep 4, 2023
1 parent ba52fa3 commit 7aea29f
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 53 deletions.
1 change: 1 addition & 0 deletions required/latex-lab/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ installfiles = {
"*.ltx",
"*.sty",
"glyphtounicode-cmex.tex",
"tagpdf-ns-latex-lab.def"
}
typesetfiles = {
"latex-lab-*.dtx",
Expand Down
36 changes: 3 additions & 33 deletions required/latex-lab/latex-lab-block.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
%
%
Expand Down Expand Up @@ -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}
{
Expand Down Expand Up @@ -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}
Expand Down
8 changes: 1 addition & 7 deletions required/latex-lab/latex-lab-float.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 2 additions & 7 deletions required/latex-lab/latex-lab-footnotes.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
96 changes: 96 additions & 0 deletions required/latex-lab/latex-lab-namespace.dtx
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions required/latex-lab/latex-lab-new-or-2.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -342,7 +342,7 @@
% short, but the footnotes are not pushed to the bottom.
%
% In \pkg{footmisc} \cs{@outputbox@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}
Expand Down
7 changes: 7 additions & 0 deletions required/latex-lab/latex-lab.ins
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7aea29f

Please sign in to comment.