%% %% This is file `lualatex-math.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% lualatex-math.dtx (with options: `package') %% %% This is a generated file. %% %% Copyright 2011, 2012, 2013 Philipp Stephani %% %% 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.3c or later is part of all distributions of %% LaTeX version 2009/09/24 or later. %% \NeedsTeXFormat{LaTeX2e}[2009/09/24] \RequirePackage{expl3}[2015/09/07] \ProvidesExplPackage{lualatex-math}{2015/09/22}{1.4a}% {Patches for mathematics typesetting with LuaLaTeX} \RequirePackage { etoolbox } [ 2007/10/08 ] \cs_if_exist:NF \newluabytecode { \RequirePackage { luatexbase } [ 2010/05/27 ] } \RequirePackage { filehook } [ 2011/03/09 ] \directlua{require("lualatex-math")} \cs_new_nopar:Npn \__lltxmath_restore_catcode:N #1 { \char_set_catcode:nn { \int_eval:n { `#1 } } { \char_value_catcode:n { `#1 } } } \exp_args:Nx \AtEndOfPackage { \__lltxmath_restore_catcode:N \$ } \char_set_catcode_math_toggle:N \$ \msg_new:nnn { lualatex-math } { luatex-required } { The~ lualatex-math~ package~ requires~ LuaTeX. \\ I~ will~ stop~ loading~ now. } \msg_new:nnn { lualatex-math } { macro-expected } { I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. } \msg_new:nnn { lualatex-math } { wrong-meaning } { I've~ expected~ #1~ to~ have~ the~ meaning \\ #3, \\ but~ it~ has~ the~ meaning \\ #2. } \msg_new:nnn { lualatex-math } { patch-macro } { I'm~ going~ to~ patch~ macro~ #1. } \sys_if_engine_luatex:F { \msg_error:nn { lualatex-math } { luatex-required } \endinput } \cs_new_eq:NN \__lltxmath_temp:w \prg_do_nothing: \cs_new_protected_nopar:Npn \__lltxmath_patch:NNnnn #1 #2 #3 #4 #5 { \cs_if_exist:NT #1 { \token_if_macro:NTF #1 { \group_begin: #2 \__lltxmath_temp:w #3 { #4 } \cs_if_eq:NNTF #1 \__lltxmath_temp:w { \msg_info:nnx { lualatex-math } { patch-macro } { \token_to_str:N #1 } \group_end: #2 #1 #3 { #5 } } { \msg_warning:nnxxx { lualatex-math } { wrong-meaning } { \token_to_str:N #1 } { \token_to_meaning:N #1 } { \token_to_meaning:N \__lltxmath_temp:w } \group_end: } } { \msg_warning:nnx { lualatex-math } { macro-expected } { \token_to_str:N #1 } } } } \cs_generate_variant:Nn \__lltxmath_patch:NNnnn { c } \cs_new_protected_nopar:Npn \__lltxmath_set_mathchar:NN #1 #2 { \utex_mathchardef:D #1 \lua_now_x:n { lualatex.math.print_class_fam_slot( \int_eval:n { `#2 } ) } \scan_stop: } \AtEndPreamble { \@ifpackageloaded { amsmath } { } { \__lltxmath_patch:NNnnn \frac \cs_set_nopar:Npn { #1 #2 } { { \begingroup #1 \endgroup \over #2 } } { { \utex_stack:D { \group_begin: #1 \group_end: \over #2 } } } } } \int_const:Nn \c__lltxmath_std_minus_mathcode_int { "2200 } \int_const:Nn \c__lltxmath_std_equal_mathcode_int { "303D } \cs_new_nopar:Npn \__lltxmath_char_dim:NN #1 #2 { #1 \textfont \lua_now_x:n { lualatex.math.print_fam_slot( \int_eval:n { `#2 } ) } } \tl_new:N \l__lltxmath_minus_mathchar \tl_new:N \l__lltxmath_equal_mathchar \AtBeginOfPackageFile { amsmath } { \__lltxmath_set_mathchar:NN \l__lltxmath_minus_mathchar \- \__lltxmath_set_mathchar:NN \l__lltxmath_equal_mathchar \= \char_set_mathcode:nn { `\- } { \c__lltxmath_std_minus_mathcode_int } \char_set_mathcode:nn { `\= } { \c__lltxmath_std_equal_mathcode_int } \AtEndOfPackageFile { amsmath } { \cs_set_eq:NN \std@minus \l__lltxmath_minus_mathchar \cs_set_eq:NN \std@equal \l__lltxmath_equal_mathchar \utex_mathcodenum:D `\- \l__lltxmath_minus_mathchar \utex_mathcodenum:D `\= \l__lltxmath_equal_mathchar } } \AtEndOfPackageFile * { amsmath } { \tl_replace_once:Nnn \@begindocumenthook { \mathchardef \std@minus \mathcode `\- \relax \mathchardef \std@equal \mathcode `\= \relax } { \__lltxmath_set_mathchar:NN \std@minus \- \__lltxmath_set_mathchar:NN \std@equal \= } \__lltxmath_patch:NNnnn \resetMathstrut@ \cs_set_nopar:Npn { } { \setbox \z@ \hbox { \mathchardef \@tempa \mathcode `\( \relax % \) \def \@tempb ##1 "##2 ##3 { \the \textfont "##3 \char" } \expandafter \@tempb \meaning \@tempa \relax } \ht \Mathstrutbox@ \ht \z@ \dp \Mathstrutbox@ \dp \z@ } { \box_set_ht:Nn \Mathstrutbox@ { \__lltxmath_char_dim:NN \fontcharht \( % \) } \box_set_dp:Nn \Mathstrutbox@ { \__lltxmath_char_dim:NN \fontchardp \) } } \__lltxmath_patch:NNnnn \subarray \cs_set:Npn { #1 } { \vcenter \bgroup \Let@ \restore@math@cr \default@tag \baselineskip \fontdimen 10~ \scriptfont \tw@ \advance \baselineskip \fontdimen 12~ \scriptfont \tw@ \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@ \lineskiplimit \lineskip \ialign \bgroup \ifx c #1 \hfil \fi $ \m@th \scriptstyle ## $ \hfil \crcr } { \vcenter \c_group_begin_token \Let@ \restore@math@cr \default@tag \skip_set:Nn \baselineskip { \utex_stacknumup:D \scriptstyle + \utex_stackdenomdown:D \scriptstyle } \lineskip \utex_stackvgap:D \scriptstyle \lineskiplimit \lineskip \ialign \c_group_begin_token \token_if_eq_meaning:NNT c #1 { \hfil } \utex_startmath:D \m@th \scriptstyle \luatex_alignmark:D \luatex_alignmark:D \utex_stopmath:D \hfil \crcr } \__lltxmath_patch:cNnnn { frac~ } \cs_set:Npn { #1 #2 } { { \begingroup #1 \endgroup \@@over #2 } } { { \utex_stack:D { \group_begin: #1 \group_end: \@@over #2 } } } \__lltxmath_patch:NNnnn \@genfrac \cs_set_nopar:Npn { #1 #2 #3 #4 #5 } { { #1 { \begingroup #4 \endgroup #2 #3 \relax #5 } } } { { #1 { \utex_stack:D { \group_begin: #4 \group_end: #2 #3 \scan_stop: #5 } } } } } \group_begin: \char_set_catcode_other:N \" \AtEndOfPackageFile * { amsopn } { \__lltxmath_patch:NNnnn \newmcodes@ \cs_gset_nopar:Npn { } { \mathcode `\' 39 \mathcode `\* 42 \mathcode `\. "613A \ifnum \mathcode `\- = 45 ~ \else \mathchardef \std@minus \mathcode `\- \relax \fi \mathcode `\- 45 \mathcode `\/ 47 \mathcode `\: "603A \relax } { \char_set_mathcode:nn { `\' } { 39 } \char_set_mathcode:nn { `\* } { 42 } \char_set_mathcode:nn { `\. } { "613A } \int_compare:nNnF { \utex_mathcodenum:D `\- } = { 45 } { \__lltxmath_set_mathchar:NN \std@minus \- } \char_set_mathcode:nn { `\- } { 45 } \char_set_mathcode:nn { `\/ } { 47 } \char_set_mathcode:nn { `\: } { "603A } } } \group_end: \AtEndOfPackageFile * { mathtools } { \__lltxmath_patch:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } { \sbox \z@ { $ \m@th #1 \nulldelimiterspace = \z@ \radical \z@ { #2 } $ } \ifx #1 \displaystyle \dimen@ = \fontdimen 8 \textfont 3 \advance \dimen@ .25 \fontdimen 5 \textfont 2 \else \dimen@ = 1.25 \fontdimen 8 \ifx #1 \textstyle \textfont \else \ifx #1 \scriptstyle \scriptfont \else \scriptscriptfont \fi \fi 3 \fi \advance \dimen@ -\ht\z@ \ht\z@ = -\dimen@ \box\z@ } { { \ensuremath { \use:c { luatex_cramped \cs_to_str:N #1 :D } #2 } } } } \AtEndOfPackageFile * { icomma } { \tl_replace_once:Nnn \@begindocumenthook { \mathchardef \mathcomma \mathcode `\, } { \__lltxmath_set_mathchar:NN \mathcomma \, } } \endinput %% %% End of file `lualatex-math.sty'.