summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-14 22:20:59 +0000
committerKarl Berry <karl@freefriends.org>2011-09-14 22:20:59 +0000
commit212490225178a301cd0756b00c5f85d64952e409 (patch)
tree7754d0177d5c780b19e8eee8a3b03a02b2c50f6f /Master/texmf-dist/tex/lualatex
parent5555ff2ea4569008e29412e2e5eac0b264483855 (diff)
lualatex-math post-0.1 (14sep11)
git-svn-id: svn://tug.org/texlive/trunk@23953 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.sty58
1 files changed, 45 insertions, 13 deletions
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 be8cbb84f34..3476474eaf3 100644
--- a/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty
+++ b/Master/texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty
@@ -21,8 +21,8 @@
%% LaTeX version 2009/09/24 or later.
%%
\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\RequirePackage{expl3}[2011/02/17]
-\ProvidesExplPackage{lualatex-math}{2011/05/05}{0.1}%
+\RequirePackage{expl3}[2011/09/05]
+\ProvidesExplPackage{lualatex-math}{2011/09/13}{0.3a}%
{Patches for mathematics typesetting with LuaLaTeX}
\RequirePackage { etoolbox } [ 2007/10/08 ]
\RequirePackage { luatexbase } [ 2010/05/27 ]
@@ -35,11 +35,21 @@
\exp_args:Nx \AtEndOfPackage {
\lltxmath_restore_catcode:N \$
}
-\char_make_math_shift: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: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.
}
@@ -56,7 +66,17 @@
\msg_error:nn { lualatex-math } { luatex-required }
\endinput
}
-\chk_if_free_cs:N \lltxmath_temp:w
+\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 {
@@ -80,6 +100,20 @@
}
}
\cs_generate_variant:Nn \lltxmath_patch:NNnnn { c }
+\cs_new_protected_nopar:Npn \lltxmath_set_mathchar:NN #1 #2 {
+ \luatexUmathchardef #1
+ \lua_now:x {
+ 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 } { } {
@@ -94,8 +128,6 @@
}
}
}
-\luatexbase@ensure@primitive { Umathcodenum }
-\luatexbase@ensure@primitive { Umathchardef }
\luatexbase@ensure@primitive { alignmark }
\luatexbase@ensure@primitive { Ustartmath }
\luatexbase@ensure@primitive { Ustopmath }
@@ -104,13 +136,6 @@
\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_protected_nopar:Npn \lltxmath_set_mathchar:NN #1 #2 {
- \luatexUmathchardef #1
- \lua_now:x {
- lualatex.math.print_class_fam_slot( \int_eval:n { `#2 } )
- }
- \scan_stop:
-}
\cs_new_nopar:Npn \lltxmath_char_dim:NN #1 #2 {
#1 \textfont
\lua_now:x {
@@ -259,6 +284,13 @@
}
}
}
+\AtEndOfPackageFile * { icomma } {
+ \tl_replace_once:Nnn \@begindocumenthook {
+ \mathchardef \mathcomma \mathcode `\,
+ } {
+ \lltxmath_set_mathchar:NN \mathcomma \,
+ }
+}
\endinput
%%
%% End of file `lualatex-math.sty'.