summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2021-05-09 07:02:07 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2021-05-09 07:02:07 +0000
commit009b416d487632356e4065b3313118eb7dab4af0 (patch)
treef8aed0ab5ec96817a6911a18f8fe864842815592 /Build/source/texk/web2c/luatexdir/tex
parentd408beb505856c02bbae6121e29e4cb285077719 (diff)
sync with upstream luatex; sync with upstream metapost.
git-svn-id: svn://tug.org/texlive/trunk@59144 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/dumpdata.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/equivalents.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.c15
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.c38
5 files changed, 47 insertions, 16 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.c b/Build/source/texk/web2c/luatexdir/tex/commands.c
index 261f23f4a83..576306b35eb 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.c
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.c
@@ -176,6 +176,8 @@ void initialize_commands(void)
primitive_luatex("exceptionpenalty", assign_int_cmd, int_base + exception_penalty_code, int_base);
primitive_luatex("fixupboxesmode", assign_int_cmd, int_base + fixup_boxes_code, int_base);
primitive_luatex("glyphdimensionsmode", assign_int_cmd, int_base + glyph_dimensions_code, int_base);
+ primitive_luatex("mathdefaultsmode", assign_int_cmd, int_base + math_defaults_mode_code, int_base);
+ primitive_luatex("discretionaryligaturemode", assign_int_cmd, int_base + discretionary_ligature_mode_code, int_base);
/*tex
diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.c b/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
index e7d53050b29..8270277c38d 100644
--- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
+++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
@@ -32,7 +32,7 @@ with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
*/
-#define FORMAT_ID (907+54)
+#define FORMAT_ID (907+56)
#if ((FORMAT_ID>=0) && (FORMAT_ID<=256))
#error Wrong value for FORMAT_ID.
#endif
diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
index 83117c64fa1..459c2cb0143 100644
--- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h
+++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
@@ -309,8 +309,10 @@ the |number_regs| \.{\\dimen} registers.
# define suppress_primitive_error_code 116
# define fixup_boxes_code 117
# define glyph_dimensions_code 118
+# define math_defaults_mode_code 119 /* > 0 : latex preferences */
+# define discretionary_ligature_mode_code 120
-# define math_option_code 119
+# define math_option_code 121
# define mathoption_int_base_code (math_option_code+1) /* one reserve */
# define mathoption_int_last_code (mathoption_int_base_code+8)
@@ -811,6 +813,8 @@ extern halfword last_cs_name;
#define fixup_boxes_par int_par(fixup_boxes_code)
#define glyph_dimensions_par int_par(glyph_dimensions_code)
+#define math_defaults_mode_par int_par(math_defaults_mode_code)
+#define discretionary_ligature_mode_par int_par(discretionary_ligature_mode_code)
/* */
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.c b/Build/source/texk/web2c/luatexdir/tex/mlist.c
index 2ac631ea339..c33e08f1315 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.c
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.c
@@ -2385,7 +2385,10 @@ static void make_over_delimiter(pointer q, int cur_style)
pointer x, y, v;
scaled shift_up, shift_down, clr, delta, wd;
boolean stack;
- x = clean_box(nucleus(q), sub_style(cur_style), cur_style, math_nucleus_list);
+ if (math_defaults_mode_par > 0)
+ x = clean_box(nucleus(q), sup_style(cur_style), cur_style, math_nucleus_list);
+ else
+ x = clean_box(nucleus(q), sub_style(cur_style), cur_style, math_nucleus_list);
check_widths(q,x);
y = do_delimiter(q, left_delimiter(q), cur_size, wd, true, cur_style, true, &stack, NULL, NULL);
left_delimiter(q) = null;
@@ -2416,7 +2419,10 @@ static void make_under_delimiter(pointer q, int cur_style)
pointer x, y, v;
scaled shift_up, shift_down, clr, delta, wd;
boolean stack;
- y = clean_box(nucleus(q), sup_style(cur_style), cur_style, math_nucleus_list);
+ if (math_defaults_mode_par > 0)
+ y = clean_box(nucleus(q), sub_style(cur_style), cur_style, math_nucleus_list);
+ else
+ y = clean_box(nucleus(q), sup_style(cur_style), cur_style, math_nucleus_list);
check_widths(q,y);
x = do_delimiter(q, left_delimiter(q), cur_size, wd, true, cur_style, true, &stack, NULL, NULL);
left_delimiter(q) = null;
@@ -2447,7 +2453,10 @@ static void make_delimiter_over(pointer q, int cur_style)
pointer x, y, v;
scaled shift_up, shift_down, clr, actual, wd;
boolean stack;
- y = clean_box(nucleus(q), cur_style, cur_style, math_nucleus_list);
+ if (math_defaults_mode_par > 0)
+ y = clean_box(nucleus(q), cramped_style(cur_style), cur_style, math_nucleus_list);
+ else
+ y = clean_box(nucleus(q), cur_style, cur_style, math_nucleus_list);
check_widths(q,y);
x = do_delimiter(q, left_delimiter(q), cur_size + (cur_size == script_script_size ? 0 : 1), wd, true, cur_style, true, &stack, NULL, NULL);
left_delimiter(q) = null;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.c b/Build/source/texk/web2c/luatexdir/tex/texmath.c
index 461a51578fb..ebfb50a804a 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.c
@@ -1577,11 +1577,17 @@ static void scan_delimiter(pointer p, int r)
return;
}
+/*tex
+ Because \LATEX\ expect some different defaults, we now have |math_defaults_mode_par| controlling
+ the style. By using a variable we can remain downward compatible.
+*/
+
void math_radical(void)
{
halfword q;
int chr_code = cur_chr;
halfword options = 0;
+ halfword used_style = cramped_style(m_style);
tail_append(new_node(radical_noad, chr_code));
q = new_node(delim_node, 0);
left_delimiter(tail) = q;
@@ -1600,32 +1606,42 @@ void math_radical(void)
}
}
radicaloptions(tail) = options;
- if (chr_code == 0)
+ if (chr_code == 0) {
/*tex \.{\\radical} */
scan_delimiter(left_delimiter(tail), tex_mathcode);
- else if (chr_code == 1)
+ } else if (chr_code == 1) {
/*tex \.{\\Uradical} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else if (chr_code == 2)
+ } else if (chr_code == 2) {
/*tex \.{\\Uroot} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else if (chr_code == 3)
+ } else if (chr_code == 3) {
/*tex \.{\\Uunderdelimiter} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else if (chr_code == 4)
+ if (math_defaults_mode_par > 0) {
+ used_style = sub_style(m_style);
+ }
+ } else if (chr_code == 4) {
/*tex \.{\\Uoverdelimiter} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else if (chr_code == 5)
+ if (math_defaults_mode_par > 0) {
+ used_style = sup_style(m_style);
+ }
+ } else if (chr_code == 5) {
/*tex \.{\\Udelimiterunder} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else if (chr_code == 6)
+ if (math_defaults_mode_par > 0) {
+ used_style = m_style;
+ }
+ } else if (chr_code == 6) {
/*tex \.{\\Udelimiterover} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else if (chr_code == 7)
+ } else if (chr_code == 7) {
/*tex \.{\\Uhextensible} */
scan_delimiter(left_delimiter(tail), umath_mathcode);
- else
+ } else {
confusion("math_radical");
+ }
if (chr_code == 7) {
/*tex type will change */
q = new_node(sub_box_node, 0);
@@ -1645,12 +1661,12 @@ void math_radical(void)
vlink(degree(tail)) = null;
q = new_node(math_char_node, 0);
nucleus(tail) = q;
- (void) scan_math(nucleus(tail), cramped_style(m_style));
+ (void) scan_math(nucleus(tail), used_style);
}
} else {
q = new_node(math_char_node, 0);
nucleus(tail) = q;
- (void) scan_math(nucleus(tail), cramped_style(m_style));
+ (void) scan_math(nucleus(tail), used_style);
}
}