Skip to content

Commit

Permalink
add math/setup keys, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Jan 16, 2025
1 parent 69b5e5e commit 27d5180
Showing 1 changed file with 57 additions and 4 deletions.
61 changes: 57 additions & 4 deletions required/latex-lab/latex-lab-math.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@
\cs_new:Npn \@@_luamml_output_hook:n ##1
{
\tl_if_empty:NF \l_@@_mathml_write_before_tl
{
{
% \end{macrocode}
% We check here if the current group level is equal to the one stored for the
% outer math. If not we add currently only add text to change the hash.
Expand Down Expand Up @@ -1438,6 +1438,59 @@
}
% \end{macrocode}
%
% \subsubsection{Meta keys}
% The |math/setup| key accepts a list with the values |structelem|, |mathml-AF| and |tex-AF|.
% It is a fast way to set the main option. It at first disables them all, to get a clean state.
% \begin{macrocode}
\keys_define:nn {__tag / setup}
{
math/setup .code:n =
{
%deactivate loading of luamml
\tl_gset:Nn \g_@@_luamml_load_tl{-1}
\keys_set:nn {__tag / setup}
{
%deactivate tex source AF
math/tex/AF = false,
%deactivate reading of mathml-AF
math/mathml/sources=,
math/mathml/AF=false,
%deactivate structelem
math/mathml/structelem=false,
%handle value
}
\clist_map_inline:nn { #1}
{
\keys_set:nn {__tag/ setup}{math/__setup/##1}
}
},
math/__setup / structelem .code:n =
{
\tl_gset:Nn \g_@@_luamml_load_tl{1}
\keys_set:nn {__tag / setup}
{
math/mathml/structelem=true
}
},
math/__setup / mathml-AF .code:n =
{
\tl_gset:Nn \g_@@_luamml_load_tl{1}
\clist_put_right:Ne\l__tag_math_mathml_files_clist
{\c_sys_jobname_str-mathml,\c_sys_jobname_str-luamml-mathml}
\keys_set:nn {__tag / setup}
{
math/mathml/AF=true
}
},
math/__setup / tex-AF .code:n =
{
\keys_set:nn {__tag / setup}
{
math/tex/AF =true
}
},
}
% \end{macrocode}
% \subsection{Sockets}
% \subsubsection{Main inline math sockets}
%
Expand Down Expand Up @@ -2013,7 +2066,7 @@
% The \cs{postdisplaypenalty} was temporarily set
% to 10000 inside the display and the \cs{belowdisplayskip} and the
% \cs{belowdisplayshortskip} was negated, so whatever was inserted
% it should have been a negative skip. Whatever
% it should have been a negative skip. Whatever
% was added, we pick up the value up, so that we can correct
% the spacing after the tagging code was inserted.
% \begin{macrocode}
Expand Down Expand Up @@ -2053,8 +2106,8 @@
% one~ that~ TeX~ will~ add)}
\skip_vertical:n { -\tex_parskip:D }
% \end{macrocode}
%
% We also set the \texttt{@domathendpetrue} flag to signal that the
%
% We also set the \texttt{@domathendpetrue} flag to signal that the
% \begin{macrocode}
\@domathendpetrue
\@doendpe % this has no \end{...} to take care of it
Expand Down

0 comments on commit 27d5180

Please sign in to comment.