diff --git a/manual/luatex-math.tex b/manual/luatex-math.tex index da4ce383b7176a6fe87a8302f82766cdf17b0bcc..9fb0c02abc0804bfc9bb588b73b04331c506753f 100644 --- a/manual/luatex-math.tex +++ b/manual/luatex-math.tex @@ -617,26 +617,61 @@ experimenting. The \type {\mathitalicsmode} parameter can be set to~1 to force italic correction before noads that represent some more complex structure (read: everything -that is not an ord, bin, rel, open, close, punct or inner). +that is not an ord, bin, rel, open, close, punct or inner). We show a Cambria +example. \starttexdefinition Whatever #1 - \NC \type{\mathitalicsmode=#1} + \NC \type{\mathitalicsmode = #1} \NC \mathitalicsmode#1\ruledhbox{$\left|T^1\right|$} \NC \mathitalicsmode#1\ruledhbox{$\left|T\right|$} \NC \mathitalicsmode#1\ruledhbox{$T+1$} \NC \mathitalicsmode#1\ruledhbox{$T{1\over2}$} \NC \mathitalicsmode#1\ruledhbox{$T\sqrt{1}$} - \NR \NR + \NC \NR \stoptexdefinition -\starttabulate[|c|c|c|c|c|c|] - \Whatever0 - \Whatever1 -\stoptabulate +\start + \setupbodyfont[cambria] + \starttabulate[|c|c|c|c|c|c|] + \Whatever{0}% + \Whatever{1}% + \stoptabulate +\stop This kind of parameters relate to the fact that italic correction in \OPENTYPE\ math is bound to fuzzy rules. So, control is the solution. +\section{Unscaled fences} + +The \type {\mathdelimitersmode} primitive is experimental and deals with the +following (potential) problems. Three bits can be set. The first bit prevents +an unwanted shift when the fence symbol is not scaled (a cambria side effect). The +second bit forces italic correction between a preceding character ordinal and +the fenced subformula, while the third bit turns that subformula into a ordinary +so that the same spacing applies as with unfenced variants. Here we show Cambria +(with \type {\mathitalicsmode} enabled). + +\starttexdefinition Whatever #1 + \NC \type{\mathdelimitersmode = #1} + \NC \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics$f(x)$} + \NC \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics$f\left(x\right)$} + \NC \NR +\stoptexdefinition + +\start + \setupbodyfont[cambria] + \starttabulate[|l|l|l|] + \Whatever{0}\Whatever{1}\Whatever{2}\Whatever{3}% + \Whatever{4}\Whatever{5}\Whatever{6}\Whatever{7}% + \stoptabulate +\stop + +So, when set to 7 fenced subformulas with unscaled delimiters come out the same +as unfenced ones. This can be handy for cases where one is forced to use \type +{\left} and \type {\right} always because of unpredictable content. As said, it's +an experimental features (which somehow fits in the exceptional way fences are +dealt with in the engine). + \section{Math spacing setting} Besides the parameters mentioned in the previous sections, there are also 64 new diff --git a/manual/luatex.pdf b/manual/luatex.pdf index b08a2433e001796fd7659c3a85e0eec0e523c347..9c939b46b04353ca55e0f28d520d5e4d08297283 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index bf4d59e051aee4dbb51cffb29db1e7368c54eb8c..b15855158e3745895cc179c5563ae254fa2a764a 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 6392 +#define luatex_svn_revision 6393 diff --git a/source/texk/web2c/luatexdir/tex/mlist.w b/source/texk/web2c/luatexdir/tex/mlist.w index d7971fe427c30e2774ac520f6737a27ea2fdca92..9f75e49e5d16a0ab09130c4d7fa25c5fd10a60bf 100644 --- a/source/texk/web2c/luatexdir/tex/mlist.w +++ b/source/texk/web2c/luatexdir/tex/mlist.w @@ -1479,13 +1479,13 @@ static pointer do_delimiter(pointer q, pointer d, int s, scaled v, boolean flat, *stack = false ; } if (!flat) { -if (math_delimiters_mode_par == 0 || same == NULL || ! same) { - /* vertical variant */ - shift_amount(b) = half(height(b) - depth(b)); - if (shift) { - shift_amount(b) -= math_axis_size(s); + if (emas == 0 || ! delimitermodenoshift) { + /* vertical variant */ + shift_amount(b) = half(height(b) - depth(b)); + if (shift) { + shift_amount(b) -= math_axis_size(s); + } } -} } delete_attribute_ref(att); return b; @@ -4114,7 +4114,7 @@ if (same) { delta = 0; break; case inner_noad_type: - if (math_delimiters_mode_par == 0) { + if (! delimitermodeitalics) { delta = 0; } break; @@ -4259,7 +4259,7 @@ if (same) { if (r_type > 0) { /* not the first noad */ pp = p; -if (t_subtype == inner_noad_type && noadextra4(q) == 1 && math_delimiters_mode_par == 1) { +if (delimitermodeordinal && t_subtype == inner_noad_type && noadextra4(q) == 1) { z = math_spacing_glue(r_subtype, ord_noad_type, cur_style, cur_mu); } else { z = math_spacing_glue(r_subtype, t_subtype, cur_style, cur_mu); diff --git a/source/texk/web2c/luatexdir/tex/texnodes.h b/source/texk/web2c/luatexdir/tex/texnodes.h index 02e7827ebab61fdd3dd1d5fc176829e7364f8f1a..bae0d76976c7dcbfced2a6c50b1759cb16016a4c 100644 --- a/source/texk/web2c/luatexdir/tex/texnodes.h +++ b/source/texk/web2c/luatexdir/tex/texnodes.h @@ -536,6 +536,16 @@ typedef enum { ((delimiteroptions(a) & noad_option_no_super_script) == noad_option_no_super_script) || \ ((delimiteroptions(a) & noad_option_no_script ) == noad_option_no_script ) )) +typedef enum { + noad_delimiter_mode_noshift = 0x01, + noad_delimiter_mode_italics = 0x02, + noad_delimiter_mode_ordinal = 0x04, +} delimiter_modes ; + +# define delimitermodenoshift ((math_delimiters_mode_par & noad_delimiter_mode_noshift) == noad_delimiter_mode_noshift) +# define delimitermodeitalics ((math_delimiters_mode_par & noad_delimiter_mode_italics) == noad_delimiter_mode_italics) +# define delimitermodeordinal ((math_delimiters_mode_par & noad_delimiter_mode_ordinal) == noad_delimiter_mode_ordinal) + /* subtype of fence noads */ # define left_noad_side 1