diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-22 22:26:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-22 22:26:34 +0000 |
commit | 834fbf692e502b3f10cee9adcbb9d7833874b8c5 (patch) | |
tree | 6f0cfc2a8476bd9696f71083cefa988bf52930dc /Master/texmf-dist/tex/lualatex | |
parent | aa040bf06e9ffb30895fc92178a8f1aa44fda1de (diff) |
lualatex-math (22sep15)
git-svn-id: svn://tug.org/texlive/trunk@38436 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua | 7 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty | 81 |
2 files changed, 25 insertions, 63 deletions
diff --git a/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua b/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua index b31a4e7ca1f..2513e7b1452 100644 --- a/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua +++ b/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua @@ -20,11 +20,9 @@ -- and version 1.3c or later is part of all distributions of -- LaTeX version 2009/09/24 or later. -- -require("luatexbase.modutils") -require("luatexbase.cctb") lualatex = lualatex or {} lualatex.math = lualatex.math or {} -local err, warn, info, log = luatexbase.provides_module({ +luatexbase.provides_module({ name = "lualatex-math", date = "2013/08/03", version = 1.3, @@ -33,7 +31,8 @@ local err, warn, info, log = luatexbase.provides_module({ licence = "LPPL v1.3+" }) local unpack = unpack or table.unpack -local cctb = luatexbase.catcodetables +local cctb = luatexbase.catcodetables or + {string = luatexbase.registernumber("catcodetable@string")} function lualatex.math.print_fam_slot(char) local code = tex.getmathcode(char) local class, family, slot = unpack(code) diff --git a/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty b/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty index d3851714038..1d65880ae36 100644 --- a/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty +++ b/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty @@ -21,13 +21,14 @@ %% LaTeX version 2009/09/24 or later. %% \NeedsTeXFormat{LaTeX2e}[2009/09/24] -\RequirePackage{expl3}[2012/08/14] -\ProvidesExplPackage{lualatex-math}{2014/08/18}{1.4}% +\RequirePackage{expl3}[2015/09/07] +\ProvidesExplPackage{lualatex-math}{2015/09/22}{1.4a}% {Patches for mathematics typesetting with LuaLaTeX} \RequirePackage { etoolbox } [ 2007/10/08 ] -\RequirePackage { luatexbase } [ 2010/05/27 ] +\cs_if_exist:NF \newluabytecode + { \RequirePackage { luatexbase } [ 2010/05/27 ] } \RequirePackage { filehook } [ 2011/03/09 ] -\RequireLuaModule { lualatex-math } [ 2013/08/03 ] +\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 } } @@ -40,16 +41,6 @@ The~ lualatex-math~ package~ requires~ LuaTeX. \\ I~ will~ stop~ loading~ now. } -\msg_new:nnnn { lualatex-math } { different-meanings } { - I've~ expected~ the~ control~ sequences \\ - #1~ and~ #3 \\ - to~ have~ the~ same~ meaning,~ but~ their~ meanings~ are~ different. -} { - The~ meaning~ of~ #1~ is: \\ - #2 \\ - The~ meaning~ of~ #3~ is: \\ - #4 -} \msg_new:nnn { lualatex-math } { macro-expected } { I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't. } @@ -62,21 +53,11 @@ \msg_new:nnn { lualatex-math } { patch-macro } { I'm~ going~ to~ patch~ macro~ #1. } -\luatex_if_engine:F { +\sys_if_engine_luatex:F { \msg_error:nn { lualatex-math } { luatex-required } \endinput } \cs_new_eq:NN \__lltxmath_temp:w \prg_do_nothing: -\luatexbase@ensure@primitive { Umathcode } -\luatexbase@ensure@primitive { Umathcodenum } -\luatexbase@ensure@primitive { Umathchardef } -\cs_new_protected_nopar:Npn \__lltxmath_assert_eq:NN #1 #2 { - \cs_if_eq:NNF #1 #2 { - \msg_error:nnxxxx { lualatex-math } { different-meanings } - { \token_to_str:N #1 } { \token_to_meaning:N #1 } - { \token_to_str:N #2 } { \token_to_meaning:N #2 } - } -} \cs_new_protected_nopar:Npn \__lltxmath_patch:NNnnn #1 #2 #3 #4 #5 { \cs_if_exist:NT #1 { \token_if_macro:NTF #1 { @@ -101,20 +82,12 @@ } \cs_generate_variant:Nn \__lltxmath_patch:NNnnn { c } \cs_new_protected_nopar:Npn \__lltxmath_set_mathchar:NN #1 #2 { - \luatexUmathchardef #1 - \luatex_directlua:D { + \utex_mathchardef:D #1 + \lua_now_x:n { lualatex.math.print_class_fam_slot( \int_eval:n { `#2 } ) } \scan_stop: } -\__lltxmath_assert_eq:NN \newfam \new@mathgroup -\__lltxmath_patch:NNnnn \new@mathgroup \cs_set_nopar:Npn { } { - \alloc@ 8 \mathgroup \chardef \sixt@@n -} { - \alloc@ 8 \mathgroup \chardef \c_two_hundred_fifty_six -} -\cs_set_eq:NN \newfam \new@mathgroup -\luatexbase@ensure@primitive { Ustack } \AtEndPreamble { \@ifpackageloaded { amsmath } { } { \__lltxmath_patch:NNnnn \frac \cs_set_nopar:Npn { #1 #2 } { @@ -123,22 +96,16 @@ } } { { - \luatexUstack { \group_begin: #1 \group_end: \over #2 } + \utex_stack:D { \group_begin: #1 \group_end: \over #2 } } } } } -\luatexbase@ensure@primitive { alignmark } -\luatexbase@ensure@primitive { Ustartmath } -\luatexbase@ensure@primitive { Ustopmath } -\luatexbase@ensure@primitive { Umathstacknumup } -\luatexbase@ensure@primitive { Umathstackdenomdown } -\luatexbase@ensure@primitive { Umathstackvgap } \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 - \luatex_directlua:D { + \lua_now_x:n { lualatex.math.print_fam_slot( \int_eval:n { `#2 } ) } } @@ -152,8 +119,8 @@ \AtEndOfPackageFile { amsmath } { \cs_set_eq:NN \std@minus \l__lltxmath_minus_mathchar \cs_set_eq:NN \std@equal \l__lltxmath_equal_mathchar - \luatexUmathcodenum `\- \l__lltxmath_minus_mathchar - \luatexUmathcodenum `\= \l__lltxmath_equal_mathchar + \utex_mathcodenum:D `\- \l__lltxmath_minus_mathchar + \utex_mathcodenum:D `\= \l__lltxmath_equal_mathchar } } \AtEndOfPackageFile * { amsmath } { @@ -203,19 +170,19 @@ \restore@math@cr \default@tag \skip_set:Nn \baselineskip { - \luatexUmathstacknumup \scriptstyle - + \luatexUmathstackdenomdown \scriptstyle + \utex_stacknumup:D \scriptstyle + + \utex_stackdenomdown:D \scriptstyle } - \lineskip \luatexUmathstackvgap \scriptstyle + \lineskip \utex_stackvgap:D \scriptstyle \lineskiplimit \lineskip \ialign \c_group_begin_token \token_if_eq_meaning:NNT c #1 { \hfil } - \luatexUstartmath + \utex_startmath:D \m@th \scriptstyle - \luatexalignmark \luatexalignmark - \luatexUstopmath + \luatex_alignmark:D \luatex_alignmark:D + \utex_stopmath:D \hfil \crcr } @@ -225,7 +192,7 @@ } } { { - \luatexUstack { \group_begin: #1 \group_end: \@@over #2 } + \utex_stack:D { \group_begin: #1 \group_end: \@@over #2 } } } \__lltxmath_patch:NNnnn \@genfrac \cs_set_nopar:Npn { @@ -237,7 +204,7 @@ } { { #1 { - \luatexUstack { + \utex_stack:D { \group_begin: #4 \group_end: #2 #3 \scan_stop: #5 } } @@ -261,7 +228,7 @@ \char_set_mathcode:nn { `\' } { 39 } \char_set_mathcode:nn { `\* } { 42 } \char_set_mathcode:nn { `\. } { "613A } - \int_compare:nNnF { \luatexUmathcodenum `\- } = { 45 } { + \int_compare:nNnF { \utex_mathcodenum:D `\- } = { 45 } { \__lltxmath_set_mathchar:NN \std@minus \- } \char_set_mathcode:nn { `\- } { 45 } @@ -270,10 +237,6 @@ } } \group_end: -\luatexbase@ensure@primitive { crampeddisplaystyle } -\luatexbase@ensure@primitive { crampedtextstyle } -\luatexbase@ensure@primitive { crampedscriptstyle } -\luatexbase@ensure@primitive { crampedscriptscriptstyle } \AtEndOfPackageFile * { mathtools } { \__lltxmath_patch:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } { @@ -307,7 +270,7 @@ } { { \ensuremath { - \use:c { luatexcramped \cs_to_str:N #1 } #2 + \use:c { luatex_cramped \cs_to_str:N #1 :D } #2 } } } |