summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog12
-rw-r--r--Build/source/texk/web2c/pdftexdir/NEWS7
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftex.web39
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog13
-rw-r--r--Build/source/texk/web2c/xetexdir/NEWS4
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.web45
6 files changed, 99 insertions, 21 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index cd87cdb3a12..c8090f7af28 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,15 @@
+2025-01-25 Thanh Han The <hanthethanh@gmail.com>
+
+ * pdftex.web (print_ignored_err): new @d.
+ (ignore_primitive_error_code, ignore_primitive_error): new primitive
+ \ignoreprimitiveerror.
+ (is_bit_set): new fn.
+ (finite_shrink): if it's set, make "Infinite glue shrinkage"
+ error into warning.
+ (Generate all \eTeX): define it.
+ (Cases for |print_param|): print it.
+ Request from Frank Mittelbach, 22 Jul 2024 22:37:26 (private mail).
+
2025-01-23 Thanh Han The <hanthethanh@gmail.com>
* pdftex.web (Glob...): remove pdf_last_f; remove uses.
diff --git a/Build/source/texk/web2c/pdftexdir/NEWS b/Build/source/texk/web2c/pdftexdir/NEWS
index d5ca1127aff..db707b2b0be 100644
--- a/Build/source/texk/web2c/pdftexdir/NEWS
+++ b/Build/source/texk/web2c/pdftexdir/NEWS
@@ -1,7 +1,10 @@
- changes:
- new primitive \pdfptexuseunderscore: if positive or
- if \pdfmajorversion >= 2, the PTEX.Fullbanner and other dictionary
- entries use an _ instead of ., as in PTEX_Fullbanner.
+ if \pdfmajorversion >= 2, PTEX.Fullbanner and other dictionary
+ entry names use _ instead of ., as in "PTEX_Fullbanner".
+ - new primitive \ignoreprimitiveerror, enabled with -etex: if set
+ to 1, the error "Infinite glue shrinkage" becomes a warning
+ (exit status remains 0). Other values reserved for future use.
- bugfixes:
- don't omit real spaces just because the font changes.
- increase tolerance for detecting interword spaces in overfull lines.
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web
index 583111093e2..c31a4ee1a4d 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftex.web
+++ b/Build/source/texk/web2c/pdftexdir/pdftex.web
@@ -1887,6 +1887,9 @@ amounts of user interaction:
@d print_err(#)==begin if interaction=error_stop_mode then wake_up_terminal;
print_nl("! "); print(#);
end
+@d print_ignored_err(#)==begin if interaction=error_stop_mode then wake_up_terminal;
+ print_nl("ignored error: "); print(#);
+ end
@<Glob...@>=
@!interaction:batch_mode..error_stop_mode; {current level of interaction}
@@ -5720,8 +5723,9 @@ that will be defined later.
@d last_line_fit_code=etex_int_base+6 {adjustment for last line of paragraph}
@d saving_vdiscards_code=etex_int_base+7 {save items discarded from vlists}
@d saving_hyph_codes_code=etex_int_base+8 {save hyphenation codes for languages}
-@d eTeX_state_code=etex_int_base+9 {\eTeX\ state variables}
-@d etex_int_pars=eTeX_state_code+eTeX_states {total number of \eTeX's integer parameters}
+@d ignore_primitive_error_code=etex_int_base+9 {ignore some primitive/engine errors}
+@d eTeX_state_code=etex_int_base+10 {\eTeX\ state variables}
+@d etex_int_pars=eTeX_state_code+eTeX_state_code {total number of \eTeX's integer parameters}
@#
@d int_pars=etex_int_pars {total number of integer parameters}
@d count_base=int_base+int_pars {256 user \.{\\count} registers}
@@ -5834,6 +5838,7 @@ that will be defined later.
@d last_line_fit==int_par(last_line_fit_code)
@d saving_vdiscards==int_par(saving_vdiscards_code)
@d saving_hyph_codes==int_par(saving_hyph_codes_code)
+@d ignore_primitive_error==int_par(ignore_primitive_error_code)
@<Assign the values |depth_threshold:=show_box_depth|...@>=
depth_threshold:=show_box_depth;
@@ -15857,6 +15862,16 @@ else
round_xn_over_d := -u;
end;
+function is_bit_set(n: integer; s: small_number): boolean;
+{check if $s$-th bit (one-based) of $n$ is set}
+var m, i: integer;
+begin
+ m := 1;
+ for i := 1 to s - 1 do
+ m := m * 2;
+ is_bit_set := (n div m) mod 2;
+end;
+
@ Next subroutines are needed for controlling spacing in PDF page description.
For a given character |c| from a font |f|,
the procedure |adv_char_width| advances |pdf_h|
@@ -27639,13 +27654,18 @@ else begin q:=glue_ptr(p);
active_height[6]:=active_height[6]+shrink(q);
if (shrink_order(q)<>normal)and(shrink(q)<>0) then
begin@t@>@;@/
- print_err("Infinite glue shrinkage found in box being split");@/
+ if is_bit_set(ignore_primitive_error, 1) then
+ print_ignored_err("Infinite glue shrinkage found in box being split")
+ else begin
+ print_err("Infinite glue shrinkage found in box being split");@/
@.Infinite glue shrinkage...@>
- help4("The box you are \vsplitting contains some infinitely")@/
- ("shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.")@/
- ("Such glue doesn't belong there; but you can safely proceed,")@/
- ("since the offensive shrinkability has been made finite.");
- error; r:=new_spec(q); shrink_order(r):=normal; delete_glue_ref(q);
+ help4("The box you are \vsplitting contains some infinitely")@/
+ ("shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.")@/
+ ("Such glue doesn't belong there; but you can safely proceed,")@/
+ ("since the offensive shrinkability has been made finite.");
+ error;
+ end;
+ r:=new_spec(q); shrink_order(r):=normal; delete_glue_ref(q);
glue_ptr(p):=r; q:=r;
end;
end;
@@ -37209,6 +37229,8 @@ primitive("savingvdiscards",assign_int,int_base+saving_vdiscards_code);@/
@!@:saving_vdiscards_}{\.{\\savingvdiscards} primitive@>
primitive("savinghyphcodes",assign_int,int_base+saving_hyph_codes_code);@/
@!@:saving_hyph_codes_}{\.{\\savinghyphcodes} primitive@>
+primitive("ignoreprimitiveerror",assign_int,int_base+ignore_primitive_error_code);@/
+@!@:ignore_primitive_error_}{\.{\\ignoreprimitiveerror} primitive@>
@ @d every_eof==equiv(every_eof_loc)
@@ -37225,6 +37247,7 @@ pre_display_direction_code:print_esc("predisplaydirection");
last_line_fit_code:print_esc("lastlinefit");
saving_vdiscards_code:print_esc("savingvdiscards");
saving_hyph_codes_code:print_esc("savinghyphcodes");
+ignore_primitive_error_code:print_esc("ignoreprimitiveerror");
@ In order to handle \.{\\everyeof} we need an array |eof_seen| of
boolean variables.
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index ed2fbea50df..da7e04a34bb 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,16 @@
+2025-01-25 Thanh Han The <hanthethanh@gmail.com>
+
+ * pdftex.web (print_ignored_err): new @d.
+ (ignore_primitive_error_code, ignore_primitive_error): new primitive
+ \ignoreprimitiveerror.
+ (is_bit_set): new fn.
+ (finite_shrink): if it's set, make "Infinite glue shrinkage"
+ error into warning.
+ (Generate all \eTeX): define it.
+ (Cases for |print_param|): print it.
+ Same code as for pdfTeX; merged into XeTeX by karl.
+ Request from Frank Mittelbach, 22 Jul 2024 22:37:26 (private mail).
+
2024-05-18 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
TANAKA Takuji <ttk@t-lab.opal.ne.jp>
diff --git a/Build/source/texk/web2c/xetexdir/NEWS b/Build/source/texk/web2c/xetexdir/NEWS
index eb239e1bae6..f746de91b51 100644
--- a/Build/source/texk/web2c/xetexdir/NEWS
+++ b/Build/source/texk/web2c/xetexdir/NEWS
@@ -1,3 +1,7 @@
+* new primitive \ignoreprimitiveerror, enabled with -etex: if set
+ to 1, the error "Infinite glue shrinkage" becomes a warning
+ (exit status remains 0). Other values reserved for future use.
+
==============================================================
XeTeX 0.999996 (February 2024)
diff --git a/Build/source/texk/web2c/xetexdir/xetex.web b/Build/source/texk/web2c/xetexdir/xetex.web
index 9affc9bbaf8..0abb6216e17 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.web
+++ b/Build/source/texk/web2c/xetexdir/xetex.web
@@ -1985,6 +1985,9 @@ amounts of user interaction:
@d print_err(#)==begin if interaction=error_stop_mode then wake_up_terminal;
print_nl("! "); print(#);
end
+@d print_ignored_err(#)==begin if interaction=error_stop_mode then wake_up_terminal;
+ print_nl("ignored error: "); print(#);
+ end
@<Glob...@>=
@!interaction:batch_mode..error_stop_mode; {current level of interaction}
@@ -4240,7 +4243,7 @@ for q:=hi_mem_min to mem_end do
end;
gubed
-@ Some stuff for character protrusion.
+@ Some stuff for character protrusion, etc.
@p
procedure pdf_error(t, p: str_number);
@@ -4293,6 +4296,16 @@ else
round_xn_over_d:=-u;
end;
+function is_bit_set(n: integer; s: small_number): boolean;
+{check if $s$-th bit (one-based) of $n$ is set}
+var m, i: integer;
+begin
+ m := 1;
+ for i := 1 to s - 1 do
+ m := m * 2;
+ is_bit_set := (n div m) mod 2;
+end;
+
@<Declare procedures that need to be declared forward for \pdfTeX@>@;
@* \[12] Displaying boxes.
@@ -5882,10 +5895,11 @@ that will be defined later.
@d saving_vdiscards_code=etex_int_base+7 {save items discarded from vlists}
@d saving_hyph_codes_code=etex_int_base+8 {save hyphenation codes for languages}
@d suppress_fontnotfound_error_code=etex_int_base+9 {suppress errors for missing fonts}
-@d XeTeX_linebreak_locale_code=etex_int_base+10 {string number of locale to use for linebreak locations}
-@d XeTeX_linebreak_penalty_code=etex_int_base+11 {penalty to use at locale-dependent linebreak locations}
-@d XeTeX_protrude_chars_code=etex_int_base+12 {protrude chars at left/right edge of paragraphs}
-@d eTeX_state_code=etex_int_base+13 {\eTeX\ state variables}
+@d ignore_primitive_error_code=etex_int_base+10 {ignore some primitive/engine errors}
+@d XeTeX_linebreak_locale_code=etex_int_base+11 {string number of locale to use for linebreak locations}
+@d XeTeX_linebreak_penalty_code=etex_int_base+12 {penalty to use at locale-dependent linebreak locations}
+@d XeTeX_protrude_chars_code=etex_int_base+13 {protrude chars at left/right edge of paragraphs}
+@d eTeX_state_code=etex_int_base+14 {\eTeX\ state variables}
@d etex_int_pars=eTeX_state_code+eTeX_states {total number of \eTeX's integer parameters}
@#
@d int_pars=etex_int_pars {total number of integer parameters}
@@ -5962,6 +5976,7 @@ that will be defined later.
@d saving_vdiscards==int_par(saving_vdiscards_code)
@d saving_hyph_codes==int_par(saving_hyph_codes_code)
@d suppress_fontnotfound_error==int_par(suppress_fontnotfound_error_code)
+@d ignore_primitive_error==int_par(ignore_primitive_error_code)
@d XeTeX_linebreak_locale==int_par(XeTeX_linebreak_locale_code)
@d XeTeX_linebreak_penalty==int_par(XeTeX_linebreak_penalty_code)
@d XeTeX_protrude_chars==int_par(XeTeX_protrude_chars_code)
@@ -23149,13 +23164,18 @@ else begin q:=glue_ptr(p);
active_height[6]:=active_height[6]+shrink(q);
if (shrink_order(q)<>normal)and(shrink(q)<>0) then
begin@t@>@;@/
- print_err("Infinite glue shrinkage found in box being split");@/
+ if is_bit_set(ignore_primitive_error, 1) then
+ print_ignored_err("Infinite glue shrinkage found in box being split")
+ else begin
+ print_err("Infinite glue shrinkage found in box being split");@/
@.Infinite glue shrinkage...@>
- help4("The box you are \vsplitting contains some infinitely")@/
- ("shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.")@/
- ("Such glue doesn't belong there; but you can safely proceed,")@/
- ("since the offensive shrinkability has been made finite.");
- error; r:=new_spec(q); shrink_order(r):=normal; delete_glue_ref(q);
+ help4("The box you are \vsplitting contains some infinitely")@/
+ ("shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'.")@/
+ ("Such glue doesn't belong there; but you can safely proceed,")@/
+ ("since the offensive shrinkability has been made finite.");
+ error;
+ end;
+ r:=new_spec(q); shrink_order(r):=normal; delete_glue_ref(q);
glue_ptr(p):=r; q:=r;
end;
end;
@@ -31277,6 +31297,8 @@ primitive("savingvdiscards",assign_int,int_base+saving_vdiscards_code);@/
@!@:saving_vdiscards_}{\.{\\savingvdiscards} primitive@>
primitive("savinghyphcodes",assign_int,int_base+saving_hyph_codes_code);@/
@!@:saving_hyph_codes_}{\.{\\savinghyphcodes} primitive@>
+primitive("ignoreprimitiveerror",assign_int,int_base+ignore_primitive_error_code);@/
+@!@:ignore_primitive_error_}{\.{\\ignoreprimitiveerror} primitive@>
@ @d every_eof==equiv(every_eof_loc)
@@ -31294,6 +31316,7 @@ pre_display_direction_code:print_esc("predisplaydirection");
last_line_fit_code:print_esc("lastlinefit");
saving_vdiscards_code:print_esc("savingvdiscards");
saving_hyph_codes_code:print_esc("savinghyphcodes");
+ignore_primitive_error_code:print_esc("ignoreprimitiveerror");
@ In order to handle \.{\\everyeof} we need an array |eof_seen| of
boolean variables.