[latex3-commits] [latex3/tagpdf] public-mc-stream: add public command for missing mc (6d87529)
github at latex-project.org
github at latex-project.org
Mon Nov 18 14:36:21 CET 2024
Repository : https://github.com/latex3/tagpdf
On branch : public-mc-stream
Link : https://github.com/latex3/tagpdf/commit/6d87529cc98b86792cdd312e94d7b22e0ea9c96a
>---------------------------------------------------------------
commit 6d87529cc98b86792cdd312e94d7b22e0ea9c96a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Nov 18 14:36:21 2024 +0100
add public command for missing mc
>---------------------------------------------------------------
6d87529cc98b86792cdd312e94d7b22e0ea9c96a
CHANGELOG.md | 5 +++++
tagpdf-mc-generic.dtx | 12 ++++++++++--
tagpdf-mc-luacode.dtx | 6 ++++++
tagpdf-mc-shared.dtx | 29 ++++++++++++++++++++++++++++-
tagpdf-user.dtx | 23 +++++++++++++----------
5 files changed, 62 insertions(+), 13 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cc45e0..05a1cca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,11 @@ All notable changes to the `tagpdf` package since the
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
this project uses date-based 'snapshot' version identifiers.
+## [Unreleased]
+
+### Added
+ - \tag_mc_add_missing_to_stream:Nn, \tag_mc_new_stream:n as public function for multicol.
+
## [2024-10-27]
### Fixed
- corrected a few temp variables
diff --git a/tagpdf-mc-generic.dtx b/tagpdf-mc-generic.dtx
index aef94ed..9dba7fd 100644
--- a/tagpdf-mc-generic.dtx
+++ b/tagpdf-mc-generic.dtx
@@ -117,7 +117,14 @@
\seq_new:N \g_@@_mc_multicol_marks_seq
% \end{macrocode}
% \end{variable}
-
+% \begin{macro}{\tag_mc_new_stream:n}
+% \begin{macrocode}
+\cs_new_protected:Npn \tag_mc_new_stream:n #1
+ {
+ \seq_new:c { g_@@_mc_multicol_#1_seq }
+ }
+% \end{macrocode}
+% \end{macro}
% \begin{variable}{\l_@@_mc_firstmarks_seq,\l_@@_mc_botmarks_seq}
% The marks content contains a number of data which we will have to access and
% compare, so we will store it locally in two sequences.
@@ -392,7 +399,7 @@
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\@@_add_missing_mcs_to_stream:Nn}
+% \begin{macro}{\tag_mc_add_missing_to_stream:Nn,\@@_add_missing_mcs_to_stream:Nn}
% This is the main command to add mc to the stream. It is therefore
% guarded by the mc-boolean.
%
@@ -479,6 +486,7 @@
%%
}
}
+\cs_set_eq:NN \tag_mc_add_missing_to_stream:Nn \@@_add_missing_mcs_to_stream:Nn
% \end{macrocode}
% \end{macro}
%
diff --git a/tagpdf-mc-luacode.dtx b/tagpdf-mc-luacode.dtx
index 7e794c2..b7715cf 100644
--- a/tagpdf-mc-luacode.dtx
+++ b/tagpdf-mc-luacode.dtx
@@ -159,6 +159,12 @@
% It should do nothing in luamode.
% \begin{macrocode}
\cs_new_protected:Npn \@@_add_missing_mcs_to_stream:Nn #1#2 {}
+\cs_set_eq:NN \tag_mc_add_missing_to_stream:Nn \@@_add_missing_mcs_to_stream:Nn
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tag_mc_new_stream:n}
+% \begin{macrocode}
+\cs_new_protected:Npn \tag_mc_new_stream:n #1 {}
% \end{macrocode}
% \end{macro}
% \begin{macro}[pTF]{\@@_mc_if_in:,\tag_mc_if_in:}
diff --git a/tagpdf-mc-shared.dtx b/tagpdf-mc-shared.dtx
index 0ba0b26..506d166 100644
--- a/tagpdf-mc-shared.dtx
+++ b/tagpdf-mc-shared.dtx
@@ -110,7 +110,7 @@
% \end{syntax}
% Determines if a mc-chunk is open.
% \end{function}
-
+%
% \begin{function}[ EXP,added=2023-06-11]{\tag_mc_reset_box:N}
% \begin{syntax}
% \cs{tag_mc_reset_box:N} \Arg{box}
@@ -119,6 +119,32 @@
% It does nothing in generic mode.
% \end{function}
%
+% \begin{function}[added=2024-11-18]{\tag_mc_add_missing_to_stream:Nn}
+% \begin{syntax}
+% \cs{tag_mc_add_missing_to_stream:Nn} \Arg{box} \Arg {stream name}
+% \end{syntax}
+% This command is only needed in generic mode, in lua mode it gobbles its arguments.
+% In generic mode it adds MC literals to the stream that are missing because of
+% page breaks.
+% The first argument is the box with the stream, the second a
+% string representing the stream. Predeclared are the names
+% \texttt{main}, \texttt{footnote} and \texttt{multicol}.
+% If more streams should be handle the underlying interface must be enabled
+% with \cs{tag_mc_new_stream:n}
+% The command is only for packages doing deep manipulations
+% of the output routine!
+% Example of use are in the multicol package and in tagpdf itself.
+% \end{function}
+%
+% \begin{function}[added=2024-11-18]{\tag_mc_new_stream:n}
+% \begin{syntax}
+% \cs{\tag_mc_new_stream:n} \Arg {stream name}
+% \end{syntax}
+% This declares the interface needed to handle
+% a new stream with \cs{tag_mc_add_missing_to_stream:Nn}.
+% Predeclared are the names \texttt{main}, \texttt{footnote} and \texttt{multicol}.
+% \end{function}
+%
% \section{Public keys}
% The following keys can be used with |\tag_mc_begin:n|, |\tagmcbegin|,
% |\tag_mc_begin_pop:n|,
@@ -287,6 +313,7 @@
%
%
% \subsection{Functions}
+%
% \begin{macro}{\@@_mc_handle_mc_label:e}
% The commands labels a mc-chunk. It is used if the user explicitly
% labels the mc-chunk with the |label| key. The argument is the
diff --git a/tagpdf-user.dtx b/tagpdf-user.dtx
index 86cd4ac..0fe8693 100644
--- a/tagpdf-user.dtx
+++ b/tagpdf-user.dtx
@@ -1197,26 +1197,29 @@
\cs_if_exist:NT \@kernel at before@footins
{
\tl_put_right:Nn \@kernel at before@footins
- { \@@_add_missing_mcs_to_stream:Nn \footins {footnote} }
+ { \tag_mc_add_missing_to_stream:Nn \footins {footnote} }
\tl_put_right:Nn \@kernel at before@cclv
{
\@@_check_typeout_v:n {====>~In~\token_to_str:N \@makecol\c_space_tl\the\c at page}
- \@@_add_missing_mcs_to_stream:Nn \@cclv {main}
+ \tag_mc_add_missing_to_stream:Nn \@cclv {main}
}
\tl_put_right:Nn \@kernel at tagsupport@@@@makecol
{
\@@_check_typeout_v:n {====>~In~\token_to_str:N \@makecol\c_space_tl\the\c at page}
- \@@_add_missing_mcs_to_stream:Nn \@outputbox {main}
+ \tag_mc_add_missing_to_stream:Nn \@outputbox {main}
}
- \tl_put_right:Nn \@mult at ptagging@hook
- {
- \@@_check_typeout_v:n {====>~In~\string\page at sofar}
- \process at cols\mult at firstbox
+ \tl_if_exist:NT \@mult at ptagging@hook
+ {
+ \tl_put_right:Nn \@mult at ptagging@hook
{
- \@@_add_missing_mcs_to_stream:Nn \count@ {multicol}
+ \@@_check_typeout_v:n {====>~In~\string\page at sofar}
+ \process at cols\mult at firstbox
+ {
+ \tag_mc_add_missing_to_stream:Nn \count@ {multicol}
+ }
+ \tag_mc_add_missing_to_stream:Nn \mult at rightbox {multicol}
}
- \@@_add_missing_mcs_to_stream:Nn \mult at rightbox {multicol}
- }
+ }
}
}
}
More information about the latex3-commits
mailing list.