texlive[74603] Build/source/texk/web2c: LuaTeX: extra italicsmode

commits+lscarso at tug.org commits+lscarso at tug.org
Thu Mar 13 13:53:29 CET 2025


Revision: 74603
          https://tug.org/svn/texlive?view=revision&revision=74603
Author:   lscarso
Date:     2025-03-13 13:53:28 +0100 (Thu, 13 Mar 2025)
Log Message:
-----------
LuaTeX:  extra italicsmode (large operator italic spacing) (H.Hagen)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/doc/luatex/luatex-math.tex
    trunk/Build/source/texk/web2c/doc/luatex/luatex.pdf
    trunk/Build/source/texk/web2c/luatexdir/ChangeLog
    trunk/Build/source/texk/web2c/luatexdir/luatex.c
    trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
    trunk/Build/source/texk/web2c/luatexdir/tex/commands.c
    trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
    trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h
    trunk/Build/source/texk/web2c/luatexdir/tex/maincontrol.c
    trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c

Modified: trunk/Build/source/texk/web2c/doc/luatex/luatex-math.tex
===================================================================
--- trunk/Build/source/texk/web2c/doc/luatex/luatex-math.tex	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/doc/luatex/luatex-math.tex	2025-03-13 12:53:28 UTC (rev 74603)
@@ -1,4 +1,4 @@
-% language=uk engine=luatex runpath=texruns:manuals/luatex
+% language=us engine=luatex runpath=texruns:manuals/luatex
 
 \environment luatex-style
 
@@ -835,32 +835,59 @@
 
 \topicindex {math+italics}
 
-The \lpr {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). A value of~2 will enforce the
-old school font code path for all italics. We show a Cambria example.
+The \lpr {mathitalicsmode} parameter was introduced to deal with the difference
+in applying italic correction in traditional and \OPENTYPE\ math fonts. There are
+\OPENTYPE\ fonts out there that have italic correction and assume them to be
+applied like traditional \TEX\ fonts. This parameter takes several values:
 
-\starttexdefinition Whatever #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}$}
-    \NC \NR
-\stoptexdefinition
+When set to zero, you get what was decided when the two code paths (traditional
+and \OPENTYPE) were introduced.
 
-\start
-    \switchtobodyfont[cambria]
-    \starttabulate[|c|c|c|c|c|c|]
-        \Whatever{0}%
-        \Whatever{1}%
-    \stoptabulate
-\stop
+Values larger than zero will add the italic correction between simple noads (it
+checks some classes so you might pay attention to for instance punctuation
+classes assigned).
 
-This kind of parameters relate to the fact that italic correction in \OPENTYPE\
-math is bound to fuzzy rules. So, control is the solution.
+When set to zero or one, italics are independent, so we separate width from
+italic, while values larger than one combine both in the width but later
+selectively has to get rid of it (depending on code path).
 
+A value larger than two will backtrack italics for large operators, because there
+italic correction is used for anchoring scripts (limits and no limits). In fact,
+\OPENTYPE\ uses italics either between characters or for this purpose but as
+mentioned fonts are sort of messy here.
+
+We tested our version of plain \TEX\ and recommend to use the value of three to
+get the best average results. More about this italic correction dilemma in
+rendering math can be found in articles (in for instance \TUGBOAT) and various
+documents in the \CONTEXT\ distribution, especially those that discuss the
+upgraded math engine in \LUAMETATEX.
+
+% The \lpr {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). A value of~2 will enforce the
+% old school font code path for all italics. We show a Cambria example.
+%
+% \starttexdefinition Whatever #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}$}
+%     \NC \NR
+% \stoptexdefinition
+%
+% \start
+%     \switchtobodyfont[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.
+
 \subsection {Script and kerning}
 
 \topicindex {math+kerning}
@@ -1630,27 +1657,32 @@
 
 \subsection {Math options with \lpr {mathoption}}
 
-The logic in the math engine is rather complex and there are often no universal
-solutions (read: what works out well for one font, fails for another). Therefore
-some variations in the implementation are driven by parameters (modes). In
-addition there is a new primitive \lpr {mathoption} which will be used for
-testing. Don't rely on any option to be there in a production version as they are
-meant for development.
+This command is now obsolete and triggers an error message. It was only meant
+for experiments.
 
-This option was introduced for testing purposes when the math engine got split
-code paths and it forces the engine to treat new fonts as old ones with respect
-to italic correction etc. There are no guarantees given with respect to the final
-result and unexpected side effects are not seen as bugs as they relate to font
-properties. There is currently only one option:
+% % even more obsolete:
 
-\startbuffer
-\mathoption old 1
-\stopbuffer
+% The logic in the math engine is rather complex and there are often no universal
+% solutions (read: what works out well for one font, fails for another). Therefore
+% some variations in the implementation are driven by parameters (modes). In
+% addition there is a new primitive \lpr {mathoption} which will be used for
+% testing. Don't rely on any option to be there in a production version as they are
+% meant for development.
+%
+% This option was introduced for testing purposes when the math engine got split
+% code paths and it forces the engine to treat new fonts as old ones with respect
+% to italic correction etc. There are no guarantees given with respect to the final
+% result and unexpected side effects are not seen as bugs as they relate to font
+% properties. There is currently only one option:
+%
+% \startbuffer
+% \mathoption old 1
+% \stopbuffer
+%
+% The \type {oldmath} boolean flag in the \LUA\ font table is the official way to
+% force old treatment as it's bound to fonts. Like with all options we may
+% temporarily introduce with this command this feature is not meant for production.
 
-The \type {oldmath} boolean flag in the \LUA\ font table is the official way to
-force old treatment as it's bound to fonts. Like with all options we may
-temporarily introduce with this command this feature is not meant for production.
-
 % % obsolete:
 %
 % \subsubsection {\type {\mathoption noitaliccompensation}}

Modified: trunk/Build/source/texk/web2c/doc/luatex/luatex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Build/source/texk/web2c/luatexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/ChangeLog	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/ChangeLog	2025-03-13 12:53:28 UTC (rev 74603)
@@ -1,3 +1,7 @@
+2025-03-13 Luigi Scarso  <luigi.scarso at gmail.com>
+	* extra italicsmode (large operator italic spacing) (H.Hagen)
+
+
 2025-02-28  Akira Kakuto  <kakuto at jcom.zaq.ne.jp>
 	* luatex.c: Remove problematic lines for windows
 

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex.c	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex.c	2025-03-13 12:53:28 UTC (rev 74603)
@@ -32,9 +32,9 @@
     stick to "0" upto "9" so users can expect a number represented as string.
 */
 
-int luatex_version = 121;
+int luatex_version = 122;
 int luatex_revision = '0';
-const char *luatex_version_string = "1.21.0";
+const char *luatex_version_string = "1.22.0";
 const char *engine_name = my_name;
 
 #include <kpathsea/c-ctype.h>

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2025-03-13 12:53:28 UTC (rev 74603)
@@ -1,4 +1,4 @@
 #ifndef luatex_svn_revision_h
 #define luatex_svn_revision_h
-#define luatex_svn_revision 7667
+#define luatex_svn_revision 7671
 #endif

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/commands.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/commands.c	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/commands.c	2025-03-13 12:53:28 UTC (rev 74603)
@@ -746,7 +746,7 @@
     primitive_luatex("pdfextension", extension_cmd, pdf_extension_code, 0);
     primitive_luatex("pdffeedback", feedback_cmd, pdf_feedback_code, 0);
     primitive_luatex("pdfvariable", variable_cmd, pdf_variable_code, 0);
-    primitive_luatex("mathoption", option_cmd, math_option_code, 0);
+    primitive_luatex("mathoption", option_cmd, 0, 0);
 
     primitive_luatex("luacopyinputnodes", assign_int_cmd, int_base + copy_lua_input_nodes_code, int_base);
 

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.c	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.c	2025-03-13 12:53:28 UTC (rev 74603)
@@ -32,7 +32,7 @@
 
 */
 
-#define FORMAT_ID (907+59)
+#define FORMAT_ID (907+60)
 #if ((FORMAT_ID>=0) && (FORMAT_ID<=256))
 #error Wrong value for FORMAT_ID.
 #endif

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h	2025-03-13 12:53:28 UTC (rev 74603)
@@ -315,25 +315,14 @@
 #  define show_stream_code 122
 #  define math_eq_dir_mode_code 123
 #  define var_fam_code 124
-
 #  define ignore_primitive_error_code 125 				/*ignore some primitive/engine errors*/
-
 #  define math_empty_display_mode_code 126
 
-#  define math_option_code 127
-
-
-#  define mathoption_int_base_code (math_option_code+1)                 /* one reserve */
-#  define mathoption_int_last_code (mathoption_int_base_code+8)
-
-#  define backend_int_base_code (mathoption_int_last_code+1)
+#  define backend_int_base_code (math_empty_display_mode_code+1)
 #  define backend_int_last_code (backend_int_base_code+32)              /* we need some 25 but take some slack */
 
 #  define tex_int_pars (backend_int_last_code+1)                        /* total number of integer parameters */
 
-#  define mathoption_int_base (int_base+mathoption_int_base_code)
-#  define mathoption_int_last (int_base+mathoption_int_last_code)
-
 #  define backend_int_base (int_base+backend_int_base_code)
 #  define backend_int_last (int_base+backend_int_last_code)
 
@@ -471,15 +460,6 @@
 #  define loc_par(A)   equiv(local_base+(A))
 #  define glue_par(A)  equiv(glue_base+(A))
 
-typedef enum {
-    c_mathoption_old_code = 0,                  /* this one is stable */
-    /*
-    c_mathoption_umathcode_meaning_code,
-    */
-} math_option_codes ;
-
-#  define mathoption_int_par(A) eqtb[mathoption_int_base+(A)].cint
-
 /* if nonzero, this magnification should be used henceforth */
 
 extern int mag_set;
@@ -783,12 +763,6 @@
 #define error_context_lines_par            int_par(error_context_lines_code)
 #define copy_lua_input_nodes_par           int_par(copy_lua_input_nodes_code)
 
-#define math_old_par                       mathoption_int_par(c_mathoption_old_code)
-
-/*
-#define math_umathcode_meaning_par         mathoption_int_par(c_mathoption_umathcode_meaning_code)
-*/
-
 #define math_pre_display_gap_factor_par    int_par(math_pre_display_gap_factor_code)
 
 #define time_par                           int_par(time_code)

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/maincontrol.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/maincontrol.c	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/maincontrol.c	2025-03-13 12:53:28 UTC (rev 74603)
@@ -706,32 +706,13 @@
 /*tex
 
 This is experimental and not used for production, only for testing and writing
-macros (some options stay).
+macros (some options stay). It's now obsolete. We keep the cmd_code because it 
+looks like hard coded numbers are used in macro packages. 
 
 */
 
-#define mathoption_set_int(A) \
-    scan_int(); \
-    word_define(mathoption_int_base+A, cur_val);
-
 static void run_option(void) {
-    int a = 0 ;
-    switch (cur_chr) {
-        case math_option_code:
-            if (scan_keyword("old")) {
-                mathoption_set_int(c_mathoption_old_code);
-            /*
-            } else if (scan_keyword("umathcodemeaning")) {
-                mathoption_set_int(c_mathoption_umathcode_meaning_code);
-            */
-            } else {
-                normal_warning("mathoption","unknown key");
-            }
-            break;
-        default:
-            /* harmless */
-            break;
-    }
+    normal_error("mathoption", "obsolete command");
 }
 
 static void lua_function_call(void) {

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c	2025-03-13 09:48:10 UTC (rev 74602)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c	2025-03-13 12:53:28 UTC (rev 74603)
@@ -60,12 +60,35 @@
 
 */
 
-#define is_new_mathfont(A)     ((font_math_params(A) >0) && (math_old_par == 0))
-#define is_old_mathfont(A,B)   ((font_math_params(A)==0) && (font_params(A)>=(B)))
-#define do_new_math(A)         ((font_math_params(A) >0) && (font_oldmath(A) == 0) && (math_old_par == 0))
-#define do_new_math_but_not(A) (math_italics_mode_par > 1 ? 0 : do_new_math(A))
-#define protect_glyph(A)       subtype(A)=256
+/*tex
+    These two are used to determine if we need to pick up parameters from the
+    opentype table or the traditional parameter array. We noticed that some macro
+    packages set both tables so we cannot use that for determining if we have a new
+    or old font.
+*/
 
+#define is_new_mathfont(A)   ((font_math_params(A)  > 0))
+#define is_old_mathfont(A,B) ((font_math_params(A) == 0) && (font_params(A) >= (B)))
+
+/*tex
+    This is a bit of a guess.
+*/
+
+#define assume_new_math(A) ((font_math_params(A) > 0) && (font_oldmath(A) == 0))
+
+/*tex
+    So we no longer use that test here.
+*/
+
+//      do_new_math_but_not(A) (math_italics_mode_par > 1 ? 0 : do_new_math(A))
+//      do_new_math_but_not(A) (math_italics_mode_par <= 1)
+
+#define math_italics_between_simple     (math_italics_mode_par >  0) // 1 and higher
+#define math_italics_independent_italic (math_italics_mode_par <= 1)
+#define math_italics_backtrack_operator (math_italics_mode_par >  2) // 3 or more
+
+#define protect_glyph(A) subtype(A) = 256
+
 #include "ptexlib.h"
 #include "lua/luatex-api.h"
 
@@ -272,7 +295,7 @@
 static scaled accent_base_height(int f)
 {
     scaled a;
-    if (do_new_math(f)) {
+    if (assume_new_math(f)) {
         a = font_MATH_par(f, AccentBaseHeight);
         if (a == undefined_math_parameter)
             a = x_height(f);
@@ -1142,7 +1165,7 @@
     /*tex The new box and its character node. */
     pointer b, p;
     b = new_null_box();
-    if (do_new_math_but_not(f))
+    if (math_italics_independent_italic)
         width(b) = char_width(f, c);
     else
         width(b) = char_width(f, c) + char_italic(f, c);
@@ -1590,19 +1613,19 @@
                         c = y;
                         w = u;
                         if (u >= v) {
-                            /* 
-                                This solves a leftbrace middle being abused as starting point 
-                                for an extensible bar in cmex. It's the only known case where 
-                                a middle piece is so large that it makes us consider it a valid 
-                                sized character. It is large because it braces have variants. The 
-                                reason why actually these starting points can be somewhat weird 
-                                (like: the extesible is a bottom parent piece (small) that has a 
-                                recipe using shared middle pieces and and self references bottom 
-                                piece usage.) In opentype the extensibles always sit on a complete 
-                                shape i.e. they are end points in a variant list or a base 
-                                character. It took two decades to run into an example (HH & MS). 
+                            /*
+                                This solves a leftbrace middle being abused as starting point
+                                for an extensible bar in cmex. It's the only known case where
+                                a middle piece is so large that it makes us consider it a valid
+                                sized character. It is large because it braces have variants. The
+                                reason why actually these starting points can be somewhat weird
+                                (like: the extesible is a bottom parent piece (small) that has a
+                                recipe using shared middle pieces and and self references bottom
+                                piece usage.) In opentype the extensibles always sit on a complete
+                                shape i.e. they are end points in a variant list or a base
+                                character. It took two decades to run into an example (HH & MS).
                             */
-                            if (is_new_mathfont(z)) {
+                            if (is_new_mathfont(g)) {
                                 goto FOUND;
                             } else if (char_tag(g, y) != ext_tag) {
                                 goto FOUND;
@@ -1657,7 +1680,7 @@
                 b = get_delim_box(f, c, v, connector_overlap_min(cur_style), 0, att);
             }
             if (delta != NULL) {
-                if (do_new_math(f)) {
+                if (assume_new_math(f)) {
                     *delta = char_vert_italic(f,x);
                 } else {
                     *delta = char_italic(f,x);
@@ -2098,7 +2121,7 @@
         f = noad_fam(q);
         if (f >= 0) {
             t = fam_fnt(f,cur_size);
-            if (do_new_math(t)) {
+            if (assume_new_math(t)) {
                 t = font_MATH_par(t, OverbarRuleThickness);
                 if (t != undefined_math_parameter) {
                     used_thickness = t;
@@ -2138,7 +2161,7 @@
         f = noad_fam(q);
         if (f >= 0) {
             t = fam_fnt(f,cur_size);
-            if (do_new_math(t)) {
+            if (assume_new_math(t)) {
                 t = font_MATH_par(t, UnderbarRuleThickness);
                 if (t != undefined_math_parameter) {
                     used_thickness = t;
@@ -2232,7 +2255,7 @@
         f = small_fam(left_delimiter(q));
         if (f >= 0) {
             t = fam_fnt(f,cur_size);
-            if (do_new_math(t)) {
+            if (assume_new_math(t)) {
                 t = font_MATH_par(t, RadicalRuleThickness);
                 if (t != undefined_math_parameter) {
                     theta = t;
@@ -2547,7 +2570,7 @@
     boolean s_is_absolute = false;
     if (type(nucleus(q)) == math_char_node) {
         fetch(nucleus(q));
-        if (do_new_math(cur_f)) {
+        if (assume_new_math(cur_f)) {
             /*tex
                 There is no bot_accent so let's assume similarity
 
@@ -2647,7 +2670,7 @@
     x = clean_box(nucleus(q), cramped_style(cur_style), cur_style, math_nucleus_list);
     w = width(x);
     h = height(x);
-    if (do_new_math(cur_f) && !s_is_absolute) {
+    if (assume_new_math(cur_f) && !s_is_absolute) {
         s = half(w);
         s_is_absolute = true;
     }
@@ -2727,7 +2750,7 @@
     } else if ((vlink(q) != null) && (type(nucleus(q)) == math_char_node)) {
         /*tex only pure math char nodes */
         internal_font_number f = fam_fnt(math_fam(nucleus(q)),cur_size);
-        if (do_new_math_but_not(f)) {
+        if (math_italics_independent_italic) {
             ic = char_italic(f,math_character(nucleus(q)));
         }
     }
@@ -2857,7 +2880,7 @@
         f = fraction_fam(q);
         if (f >= 0) {
             t = fam_fnt(f,cur_size);
-            if (do_new_math(t)) {
+            if (assume_new_math(t)) {
                 t = font_MATH_par(t, FractionRuleThickness);
                 if (t != undefined_math_parameter) {
                     thickness(q) = t;
@@ -3045,7 +3068,7 @@
         point to it.
 
     */
-    if (do_new_math(cur_f)) {
+    if (assume_new_math(cur_f)) {
         delta = fraction_del_size_new(cur_style);
         if (delta == undefined_math_parameter) {
             delta = get_delimiter_height(depth(v), height(v), true);
@@ -3106,7 +3129,7 @@
     if (type(nucleus(q)) == math_char_node) {
         fetch(nucleus(q));
         if (cur_style < text_style) {
-            /*tex try to make it larger */
+            /*tex try to make it larger: $\displaystyle \int \limits _a^b f(x)$ */ /* 1 */
             ok_size = minimum_operator_size(cur_style);
             if (ok_size != undefined_math_parameter) {
                 /*tex creating a temporary delimiter is the cleanest way */
@@ -3116,7 +3139,9 @@
                 small_char(y) = math_character(nucleus(q));
                 x = do_delimiter(q, y, text_size, ok_size, false, cur_style, true, NULL, &delta, NULL);
                 if (delta != 0) {
-                    if (do_new_math_but_not(cur_f)) {
+                    if (math_italics_backtrack_operator) {
+                        width(x) -= delta;
+                    } else if (math_italics_independent_italic) {
                         /*tex
                             As we never added italic correction we don't need to compensate. The ic
                             is stored in a special field of the node and applied in some occasions.
@@ -3144,7 +3169,9 @@
                 delta = char_italic(cur_f, cur_c);
                 x = clean_box(nucleus(q), cur_style, cur_style, math_nucleus_list);
                 if (delta != 0) {
-                    if (do_new_math_but_not(cur_f)) {
+                    if (math_italics_backtrack_operator) {
+                        width(x) -= delta;
+                    } else if (math_italics_independent_italic) {
                         /*tex we never added italic correction */
                     } else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) {
                         /*tex remove italic correction */
@@ -3154,11 +3181,15 @@
                 axis_shift = true;
             }
         } else {
-            /*tex normal size */
+            /*tex normal size: $ \int\limits _a^b f(x)$ */
             delta = char_italic(cur_f, cur_c);
             x = clean_box(nucleus(q), cur_style, cur_style, math_nucleus_list);
             if (delta != 0) {
-                if (do_new_math_but_not(cur_f)) {
+                /* if (math_italics_backtrack_operator) {
+                } else */
+                if (math_italics_backtrack_operator) {
+                    width(x) -= delta;
+                } else if (math_italics_independent_italic) {
                     /*tex we never added italic correction */
                 } else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) {
                     /*tex remove italic correction */
@@ -3176,7 +3207,7 @@
     }
     /*tex we now handle op_nod_type_no_limits here too */
     if (subtype(q) == op_noad_type_no_limits) {
-        if (do_new_math_but_not(cur_f)) {
+if (math_italics_backtrack_operator) {
             /*tex
                 Not:
 
@@ -3263,7 +3294,7 @@
         reset_attributes(v, node_attr(q));
         type(v) = vlist_node;
         subtype(v) = math_limits_list;
-        if (do_new_math_but_not(cur_f)) {
+        if (math_italics_independent_italic) {
             n = nucleus(q);
             if (n != null) {
                 if ((type(n) == sub_mlist_node) || (type(n) == sub_box_node)) {
@@ -3370,7 +3401,7 @@
             supscr(q) = null;
         }
         assign_new_hlist(q, v);
-        if (do_new_math_but_not(cur_f)) {
+        if (math_italics_independent_italic) {
             delta = 0;
         }
     }
@@ -3419,7 +3450,7 @@
             fetch(nucleus(q));
             a = cur_c;
             /*tex add italic correction */
-            if (do_new_math_but_not(cur_f) && (char_italic(cur_f,math_character(nucleus(q))) != 0)) {
+            if (math_italics_independent_italic && (char_italic(cur_f,math_character(nucleus(q))) != 0)) {
                 p = new_kern(char_italic(cur_f,math_character(nucleus(q))));
                 subtype(p) = italic_kern;
                 reset_attributes(p, node_attr(q));
@@ -3578,7 +3609,7 @@
 {
     scaled corr_height_top = 0, corr_height_bot = 0;
     scaled krn_l = 0, krn_r = 0, krn = 0;
-    if ((!do_new_math(l_f)) || (!do_new_math(r_f)) || (!char_exists(l_f,l_c)) || (!char_exists(r_f,r_c)))
+    if ((! assume_new_math(l_f)) || (! assume_new_math(r_f)) || (!char_exists(l_f,l_c)) || (!char_exists(r_f,r_c)))
         return MATH_KERN_NOT_FOUND;
     if (cmd == sup_mark_cmd) {
         corr_height_top = char_height(l_f, l_c);
@@ -4298,7 +4329,7 @@
             fetch(nucleus(q));
             if (char_exists(cur_f, cur_c)) {
                 /*tex we could look at neighbours */
-                if (do_new_math_but_not(cur_f)) {
+                if (math_italics_independent_italic) {
                     /*tex cf spec only the last one */
                     *delta = 0 ;
                 } else {
@@ -4307,7 +4338,9 @@
                 p = new_glyph(cur_f, cur_c);
                 protect_glyph(p);
                 reset_attributes(p, node_attr(nucleus(q)));
-                if (do_new_math_but_not(cur_f)) {
+                if (math_italics_backtrack_operator) {
+                    /* do nothing */
+                } else if (math_italics_independent_italic) {
                     if (get_char_cat_code(cur_c) == 11) {
                         /*tex no italic correction in mid-word of text font */
                         *delta = 0;
@@ -4325,7 +4358,7 @@
                     reset_attributes(x, node_attr(nucleus(q)));
                     couple_nodes(p,x);
                     *delta = 0;
-                } else if (do_new_math_but_not(cur_f)) {
+                } else if (math_italics_independent_italic) {
                     /*tex Needs checking but looks ok. It must be more selective. */
                     *delta = char_italic(cur_f, cur_c);
                 }
@@ -4625,7 +4658,7 @@
                 the scripts so if it's optional here it also should be there.
 
             */
-            if (nxt && (math_italics_mode_par > 0) && (delta != 0)) {
+            if (nxt && math_italics_between_simple && (delta != 0)) {
                 if (type(nxt) == simple_noad) {
                     switch (subtype(nxt)) {
                         case ord_noad_type:



More information about the tex-live-commits mailing list.