diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/texmath.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/texmath.w | 66 |
1 files changed, 59 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index b378c662619..16911bc4a6c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -1778,6 +1778,7 @@ void math_fraction(void) halfword c; /* the type of generalized fraction we are scanning */ pointer q; halfword options = 0; + halfword temp_value; c = cur_chr; if (incompleat_noad_par != null) { const char *hlp[] = { @@ -1795,7 +1796,8 @@ void math_fraction(void) tex_error("Ambiguous; you need another { and }", hlp); } else { incompleat_noad_par = new_node(fraction_noad, 0); - numerator(incompleat_noad_par) = new_node(sub_mlist_node, 0); + temp_value = new_node(sub_mlist_node, 0); + numerator(incompleat_noad_par) = temp_value; math_list(numerator(incompleat_noad_par)) = vlink(head); vlink(head) = null; tail = head; @@ -2430,9 +2432,34 @@ void after_math(void) } tail_append(new_math(math_surround_par, before)); /* begin mathskip code */ - if (! glue_is_zero(math_skip_par)) { - copy_glue_values(tail,math_skip_par); - surround(tail) = 0; + switch (math_skip_mode) { + case 0 : + /* obey mathsurround when zero glue */ + if (! glue_is_zero(math_skip_par)) { + copy_glue_values(tail,math_skip_par); + surround(tail) = 0; + } + break ; + case 1 : + /* always left */ + case 3 : + /* always both */ + case 6 : + /* only when skip */ + copy_glue_values(tail,math_skip_par); + surround(tail) = 0; + break ; + case 2 : + /* only right */ + surround(tail) = 0; + break ; + case 4 : + /* ignore, obey marthsurround */ + break ; + case 5: + /* all spacing disabled */ + surround(tail) = 0; + break ; } /* end mathskip code */ if (dir_math_save) { @@ -2449,9 +2476,34 @@ void after_math(void) dir_math_save = false; tail_append(new_math(math_surround_par, after)); /* begin mathskip code */ - if (! glue_is_zero(math_skip_par)) { - copy_glue_values(tail,math_skip_par); - surround(tail) = 0; + switch (math_skip_mode) { + case 0 : + /* obey mathsurround when zero glue */ + if (! glue_is_zero(math_skip_par)) { + copy_glue_values(tail,math_skip_par); + surround(tail) = 0; + } + break ; + case 2 : + /* always right */ + case 3 : + /* always both */ + case 6 : + /* only when skip */ + copy_glue_values(tail,math_skip_par); + surround(tail) = 0; + break ; + case 1 : + /* only left */ + surround(tail) = 0; + break ; + case 4 : + /* ignore, obey marthsurround */ + break ; + case 5: + /* all spacing disabled */ + surround(tail) = 0; + break ; } /* end mathskip code */ space_factor_par = 1000; |