diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/luamml/luamml.sty')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/luamml/luamml.sty | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luamml/luamml.sty b/Master/texmf-dist/tex/lualatex/luamml/luamml.sty new file mode 100644 index 00000000000..7f2cbd952bc --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/luamml/luamml.sty @@ -0,0 +1,134 @@ +%% +%% This is file `luamml.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% luamml.dtx (with options: `package,luatex') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from luamml.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file luamml.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% Copyright (C) 2020-2024 by Marcel Krueger +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +\ProvidesExplPackage {luamml} {2024-10-30} {0.2.0} + {Automatically generate presentational MathML from LuaTeX math expressions} +\int_new:N \l__luamml_flag_int +\int_new:N \l__luamml_pretty_int +\tl_new:N \l__luamml_filename_tl +\tl_new:N \l__luamml_root_tl +\tl_set:Nn \l__luamml_root_tl { mrow } +\tl_new:N \l__luamml_label_tl +\int_new:N \tracingmathml + +\int_set:Nn \l__luamml_pretty_int { 1 } +\lua_now:n { require'luamml-tex' } +\hook_new_with_args:nn { luamml / converted } { 1 } + +\cs_new_protected:Npn \__luamml_output_hook:n { + \hook_use:nnw { luamml / converted } { 1 } +} +\__luamml_register_output_hook:N \__luamml_output_hook:n + +\cs_new_protected:Npn \luamml_process: { + \tl_set:Nn \l__luamml_label_tl {} + \int_set:Nn \l__luamml_flag_int { 3 } +} +\cs_set_eq:NN \luamml_flag_process: \luamml_process: +\cs_new:Npn \__luamml_maybe_structelem: { + ( + 8 * \int_mod:nn { + \int_div_truncate:nn { \l__luamml_flag_int } {8} + } {2} + ) + +} +\cs_new:Npn \__luamml_style_to_num:N #1 { + 32 * #1 +} +\cs_new_protected:Npn \luamml_save:n #1 { + \tl_set:Nn \l__luamml_label_tl {#1} + \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 1 } +} +\cs_new_protected:Npn \luamml_save:nN #1#2 { + \tl_set:Nn \l__luamml_label_tl {#1} + \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 17 + \__luamml_style_to_num:N #2 } +} +\cs_new_protected:Npn \luamml_save:nn #1 { + \tl_set:Nn \l__luamml_label_tl {#1} + \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 5 } + \tl_set:Nn \l__luamml_root_tl +} +\cs_new_protected:Npn \luamml_save:nNn #1#2 { + \tl_set:Nn \l__luamml_label_tl {#1} + \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 21 + \__luamml_style_to_num:N #2 } + \tl_set:Nn \l__luamml_root_tl +} +\cs_set_eq:NN \luamml_flag_save:n \luamml_save:n +\cs_set_eq:NN \luamml_flag_save:nN \luamml_save:nN +\cs_set_eq:NN \luamml_flag_save:nn \luamml_save:nn +\cs_set_eq:NN \luamml_flag_save:nNn \luamml_save:nNn +\cs_new_protected:Npn \luamml_ignore: { + \int_set:Nn \l__luamml_flag_int { 0 } +} +\cs_set_eq:NN \luamml_flag_ignore: \luamml_ignore: +\cs_new_protected:Npn \luamml_structelem: { + \tl_set:Nn \l__luamml_label_tl {} + \int_set:Nn \l__luamml_flag_int { 11 } +} +\cs_set_eq:NN \luamml_flag_structelem: \luamml_structelem: +\cs_new_protected:Npn \luamml_set_filename:n { + \tl_set:Nn \l__luamml_filename_tl +} +\luamml_process: +\cs_new_protected:Npn \luamml_annotate:nen #1#2#3 { + \__luamml_annotate_begin: + #3 + \__luamml_annotate_end:we \tex_numexpr:D #1 \scan_stop: {#2} +} + +\cs_new_protected:Npn \luamml_annotate:en #1#2 { + \__luamml_annotate_begin: + #2 + \__luamml_annotate_end:e {#1} +} + +\cs_new_eq:NN \luamml_pdf_write: \scan_stop: +\cs_new_protected:Npn \__luamml_patch_package:nn #1 #2 { + \@ifpackageloaded {#1} {#2} { + \hook_gput_code:nnn {package/#1/after} {luamml} {#2} + } +} +\cs_new_protected:Npn \__luamml_patch_package:n #1 { + \__luamml_patch_package:nn {#1} { + \RequirePackage { luamml-patches-#1 } + } +} +\RequirePackage { luamml-patches-kernel } +\__luamml_patch_package:n {amstext} +\__luamml_patch_package:n {amsmath} +\__luamml_patch_package:n {mathtools} +\__luamml_patch_package:n {array} + +\endinput +%% +%% End of file `luamml.sty'. |