[latex3-commits] [latex3/latex2e] UF-latex-lab-math-options: move luamml loading, trim spacing (18e06b029)
github at latex-project.org
github at latex-project.org
Thu Oct 24 16:09:41 CEST 2024
Repository : https://github.com/latex3/latex2e
On branch : UF-latex-lab-math-options
Link : https://github.com/latex3/latex2e/commit/18e06b029183deb9e58ab4459c063c2ffd51439b
>---------------------------------------------------------------
commit 18e06b029183deb9e58ab4459c063c2ffd51439b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu Oct 24 16:09:41 2024 +0200
move luamml loading, trim spacing
>---------------------------------------------------------------
18e06b029183deb9e58ab4459c063c2ffd51439b
required/latex-lab/latex-lab-math.dtx | 92 +++++++++++++++++++++++------------
1 file changed, 61 insertions(+), 31 deletions(-)
diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index 362226a55..356ce604d 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -366,14 +366,15 @@
% \item[enabled by default?] False
% \item[how to enable/disable] No interface yet.
% \texttt{ActualText} can only be added on the Formula structure element by
-% changing the \texttt{tagsupport/math/content} socket. For a BDC marker
-% one can e.g. use
+% changing the \texttt{tagsupport/math/content} or some other socket.
+% For a BDC marker one can e.g. use
% \begin{verbatim}
% \pdf_string_from_unicode:nnN{utf16/hex}{€}\l_tmpa_tl
% \pdf_bdc:ee{Span}{/ActualText\l_tmpa_tl}content\pdf_emc:
% \end{verbatim}
-% There should be no pagebreak in the \meta{content}. If needed a box should be used.
-% \item[Consumer support] various, needs tests \ldots
+% There should be no pagebreak in the \meta{content} and the BDC should be correctly
+% nested into tagging, so e.g. a \cs{leavevmode} should be issued before the bdc command.
+% \item[Consumer support] in part and in part buggy, needs tests \ldots
% \end{description}
%
% \item[Alt] Like \texttt{ActualText} the \texttt{Alt} key can be used on
@@ -383,27 +384,44 @@
% also for \texttt{Formula} structure elements.
% \begin{description}
% \item[enabled by default?] false (this will reconsidered when it is clear, that
-% the use of \texttt{Alt} does not shadow mathml).
-% \item[enable/disable] \verb+\tagpdfsetup{math/alt/use}+ (local boolean)
-% \item[default value]
-% \item[engines] all engines
+% the use of \texttt{Alt} does not shadow mathml). It can be enabled for
+% all engines and PDF versions.
+% \item[enable/disable] \verb+\tagpdfsetup{math/alt/use}+ (local boolean,
+% so can be used on individual equations)
+% \item[default value] A template text (stored in \cs{l_@@_content_template_tl})
+% starting with \texttt{LaTeX formula starts}.
+% \item[user value] No interface currently provided. This needs optional arguments
+% or an external setup command.
+% See \url{https://github.com/latex3/tagging-project/discussions/717}.
+%
% \end{description}
%
% \item[source-AF] The \LaTeX{}-source of the equation can
% be attached as an associated file with mime-type
% application/Fx-tex. The \texttt{AFRelationship} is \texttt{Source}.
+% The source is embedded without expansion. This means that targets of
+% references and current values of macros are not resolved.
%
% \begin{description}
% \item[enabled by default?] true for all engines and PDF versions
-% \item[enable/disable] \verb+\tagpdfsetup{math/tex/AF}+ (local boolean)
+% \item[enable/disable] \verb+\tagpdfsetup{math/tex/AF}+ (local boolean, so can
+% be used on individual equations)
% \item[default value] source code including dollars or environment name.
% \item[consumer support] Currently only ngpdf makes
% use of it: if there is no mathml it passes the source to mathjax.
% \end{description}
%
+% \item[luamml]
+%
% \item[mathml-AF]
%
% \item[mathml structure elements]
+% Mathml structure elements can be used in PDF 2.0 directly. In PDF 1.7. one could
+% use them if one declares a role mapping first,
+% this can be done with \verb+\tagpdfsetup{role/mathml-tags}+
+% which maps all to \texttt{Span}. But such a role mapping currently breaks reading
+% e.g. in Adobe and so it is not recommended.
+%
% \end{description}
%
%
@@ -849,12 +867,11 @@
% \begin{macrocode}
\sys_if_engine_luatex:T
{
- \file_if_exist:nT { luamml.sty }
- {
- \RequirePackage { luamml }
% \end{macrocode}
% Temporary (!) fixes for endarray
% \begin{macrocode}
+ \cs_new_protected:Npn \@@_correct_luamml_array_patches:
+ {
\AddToHook{package/array/after}
{
\cs_set:Npn \endarray
@@ -942,33 +959,46 @@
\prepnext at tok
}
}
+ }
% \end{macrocode}
%
% \begin{macrocode}
- \AddToHook{begindocument/end}
+ \AddToHook{begindocument/before}
+ {
+ \str_case:on \g__tag_math_luamml_tl
{
- \str_case:on \g__tag_math_luamml_tl
- {
- { 1 } {
- \@@_luamml_activate_write:
- \msg_note:nnnn { tag }
- { luamml-status }{ enabled }{ create }
- }
- {-1 } {
- \msg_note:nnnn { tag }
- { luamml-status }{ disabled }{ not~create }
- }
- { 0 }
- {
- \@ifpackageloaded { unicode-math }
+ { 1 } {
+ \RequirePackage { luamml }
+ \@@_correct_luamml_array_patches:
+ \AddToHook{begindocument/end}
+ {
+ \@@_luamml_activate_write:
+ \msg_note:nnnn { tag }
+ { luamml-status }{ enabled }{ create }
+ }
+ }
+ {-1 } {
+ \AddToHook{begindocument/end}
+ {
+ \msg_note:nnnn { tag }
+ { luamml-status }{ disabled }{ not~create }
+ }
+ }
+ { 0 }
+ {
+ \@ifpackageloaded { unicode-math }
+ {
+ \RequirePackage { luamml }
+ \@@_correct_luamml_array_patches:
+ \AddToHook{begindocument/end}
{
\@@_luamml_activate_write:
\msg_note:nnnn { tag }
- { luamml-status }{ enabled }{ create }
+ { luamml-status }{ enabled }{ create }
}
- { \msg_warning:nn { tag }{ unicode-math-missing } }
- }
- }
+ }
+ { \msg_warning:nn { tag }{ unicode-math-missing } }
+ }
}
}
}
More information about the latex3-commits
mailing list.