summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-checks.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-checks.dtx92
1 files changed, 90 insertions, 2 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
index 7ae61bb808..5cdbc60cf6 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
@@ -52,7 +52,7 @@
% }^^A
% }
%
-% \date{Version 0.91, released 2021-07-03}
+% \date{Version 0.92, released 2021-08-27}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -174,9 +174,21 @@
% & |tree-mcid-index-wrong|
% & warning
% TODO: should trigger a standard rerun message.
+% \\
+% in |enddocument/info|-hook
+% & |para-hook-count-wrong|
+% & error (warning?)
% \end{tabular}
%
% \normalsize
+% \subsection{Messages from the ptagging code}
+% A few messages are issued in generic
+% mode from the code which reinserts missing TMB/TME.
+% This is currently done if log-level is larger than zero.
+% TODO: reconsider log-level and messages when this code
+% settles down.
+%
+%
% \subsection{Warning messages from the lua-code}
% The messages are triggered if the log-level is at least equal to the number.
%
@@ -239,7 +251,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2021-07-03} {0.91}
+\ProvidesExplPackage {tagpdf-checks-code} {2021-08-27} {0.92}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -383,6 +395,25 @@
{engine/output~mode~#1~doesn't~support~the~interword~spaces}
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_check_typeout_v:n}
+% A simple logging function. By default is gobbles its argument, but
+% the log-keys sets it to typeout.
+% \begin{macrocode}
+\cs_set_eq:NN \@@_check_typeout_v:n \use_none:n
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{para-hook-count-wrong}
+% At the end of the document we check if the count of para-begin and para-end is
+% identical. If not we issue a warning: this is normally a coding error and
+% and breaks the structure.
+% \begin{macrocode}
+\msg_new:nnnn { tag } {para-hook-count-wrong}
+ {The~number~of~automatic~begin~(#1)~and~end~(#2)~para~hooks~differ!}
+ {This~quite~probably~a~coding~error~and~the~structure~will~be~wrong!}
+% \end{macrocode}
+% \end{macro}
% \section{Retrieving data}
% \begin{macro}[EXP]{\tag_get:n}
% This retrieves some data.
@@ -700,6 +731,63 @@
}
% \end{macrocode}
% \end{macro}
+%
+% \subsection{Checks related to the state of MC on a page or in a split stream}
+% The following checks are currently only usable in generic mode as they
+% rely on the marks defined in the mc-generic module. They are used to detect
+% if a mc-chunk has been split by a page break or similar and additional
+% end/begin commands are needed.
+%
+% \begin{macro}[pTF]{\@@_check_mc_in_galley:}
+% At first we need a test to decide if |\tag_mc_begin:n| (tmb) and |\tag_mc_end:|
+% (tme) has been used at all on the current galley. As each command issues
+% two slightly different marks we can do it by comparing firstmarks and botmarks.
+% The test assumes that the marks have been already mapped into the sequence with
+% |\@@_mc_get_marks:|. As |\seq_if_eq:NNTF| doesn't exist we use the tl-test.
+% \begin{macrocode}
+\prg_new_conditional:Npnn \@@_check_if_mc_in_galley: { T,F,TF }
+ {
+ \tl_if_eq:NNTF \l_@@_mc_firstmarks_seq \l_@@_mc_botmarks_seq
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}[pTF]{\@@_check_if_mc_tmb_missing:}
+% This checks if a extra top mark (\enquote{extra-tmb}) is needed.
+% According to the analysis this the case if the firstmarks start with
+% |e-| or |b+|.
+% Like above we assume that the marks content is already in the seq's.
+% \begin{macrocode}
+\prg_new_conditional:Npnn \@@_check_if_mc_tmb_missing: { T,F,TF }
+ {
+ \bool_if:nTF
+ {
+ \str_if_eq_p:ee {\seq_item:Nn \l_@@_mc_firstmarks_seq {1}}{e-}
+ ||
+ \str_if_eq_p:ee {\seq_item:Nn \l_@@_mc_firstmarks_seq {1}}{b+}
+ }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}[pTF]{\@@_check_if_mc_tme_missing:}
+% This checks if a extra bottom mark (\enquote{extra-tme}) is needed.
+% According to the analysis this the case if the botmarks starts with
+% |b+|.
+% Like above we assume that the marks content is already in the seq's.
+% \begin{macrocode}
+\prg_new_conditional:Npnn \@@_check_if_mc_tme_missing: { T,F,TF }
+ {
+ \str_if_eq:eeTF {\seq_item:Nn \l_@@_mc_botmarks_seq {1}}{b+}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+% \end{macrocode}
+% \end{macro}
% \begin{macrocode}
%</package>
% \end{macrocode}