From f9f81ee0810cfc82e1cbc78ee1807089affe2138 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 4 Mar 2016 23:21:52 +0000 Subject: pTeX: Improve typesetting with non-vanishing \ybaselineshift (H. Kitagawa). git-svn-id: svn://tug.org/texlive/trunk@39938 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/eptexdir/ChangeLog | 4 + Build/source/texk/web2c/eptexdir/etex.ch1 | 4 +- Build/source/texk/web2c/ptexdir/ChangeLog | 7 ++ Build/source/texk/web2c/ptexdir/ptex-base.ch | 92 ++++++++++++++++++++-- Build/source/texk/web2c/synctexdir/ChangeLog | 5 ++ .../texk/web2c/synctexdir/synctex-ep-mem.ch1 | 4 +- .../source/texk/web2c/synctexdir/synctex-p-mem.ch1 | 4 +- 7 files changed, 107 insertions(+), 13 deletions(-) diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index 739e0239b7b..20c37df1198 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -1,3 +1,7 @@ +2016-03-04 Hironori Kitagawa + + * etex.ch1: Adapt to changes in ptexdir/ptex-base.ch. + 2016-02-01 Akira Kakuto * eptex.ech: Add a new primitive \epTeXinputencoding. (from N. Abe). diff --git a/Build/source/texk/web2c/eptexdir/etex.ch1 b/Build/source/texk/web2c/eptexdir/etex.ch1 index 1f5fac7bb73..25db708dd28 100644 --- a/Build/source/texk/web2c/eptexdir/etex.ch1 +++ b/Build/source/texk/web2c/eptexdir/etex.ch1 @@ -8,10 +8,10 @@ @z @x [17.236] -@d int_pars=60 {total number of integer parameters} +@d int_pars=63 {total number of integer parameters} @d count_base=int_base+int_pars {256 user \.{\\count} registers} @y -@d tex_int_pars=60 {total number of \TeX's integer parameters} +@d tex_int_pars=63 {total number of \TeX's integer parameters} @# @d etex_int_base=tex_int_pars {base for \eTeX's integer parameters} @z diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index fa5ea317ffe..7651f29549d 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,10 @@ +2016-03-04 Hironori Kitagawa + + * ptex-base.ch: Add new primitives \textbaselineshiftfactor (=1000), + \scriptbaselineshiftfactor (=700), \scriptscriptbaselineshiftfactor (=500) + to improve typesetting with non-vanishing \ybaselineshift. + If all three are zero, the old features are recovered. + 2015-09-22 Peter Breitenlohner * ptriptest.test: Also check tripos.tex. diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch index ea98f2d55a4..42bc118e454 100644 --- a/Build/source/texk/web2c/ptexdir/ptex-base.ch +++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch @@ -52,6 +52,8 @@ % (2014-04-17) KB pTeX p3.5 (TL 2014) % (2014-03-15) KB pTeX p3.6 (TL 2015) % (2015-09-10) AK pTeX p3.7 Bug fix by Hironori Kitagawa in flushing choice node. +% (2016-03-04) AK Hironori Kitagawa added new primitives to improve typesetting +% with non-vanishing \ybaselineshift. % @x [1.2] l.200 - pTeX: @d banner==TeX_banner @@ -1260,10 +1262,13 @@ if n primitive("jcharwidowpenalty",assign_int,int_base+jchr_widow_penalty_code);@/ @!@:jchr_widow_penalty}{\.{\\jcharwidowpenalty} primitive@> +primitive("textbaselineshiftfactor",assign_int,int_base+text_baseline_shift_factor_code);@/ +@!@:text_baseline_shift_factor}{\.{\\textbaselineshiftfactor} primitive@> +primitive("scriptbaselineshiftfactor",assign_int,int_base+script_baseline_shift_factor_code);@/ +@!@:script_baseline_shift_factor}{\.{\\scriptbaselineshiftfactor} primitive@> +primitive("scriptscriptbaselineshiftfactor",assign_int,int_base+scriptscript_baseline_shift_factor_code);@/ +@!@:scriptscript_baseline_shift_factor}{\.{\\scriptscriptbaselineshiftfactor} primitive@> @z @x [17.247] l.5490 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift @@ -3358,10 +3375,30 @@ internal kanji code number. @d math_kcode_nucleus(#)==info(#+3) {the |kanji character| field offset from nucleus} @# -@d math_jchar=5 -@d math_text_jchar=6 +@d math_jchar=6 +@d math_text_jchar=7 @z +@x [35.681] pTeX: explicit box in math mode +@d math_char=1 {|math_type| when the attribute is simple} +@d sub_box=2 {|math_type| when the attribute is a box} +@d sub_mlist=3 {|math_type| when the attribute is a formula} +@d math_text_char=4 {|math_type| when italic correction is dubious} +@y +@d math_char=1 {|math_type| when the attribute is simple} +@d sub_box=2 {|math_type| when the attribute is a box} +@d sub_exp_box=3 {|math_type| when the attribute is an explicit created box} +@d sub_mlist=4 {|math_type| when the attribute is a formula} +@d math_text_char=5 {|math_type| when italic correction is dubious} + +@= +text_baseline_shift_factor:=1000; +script_baseline_shift_factor:=700; +scriptscript_baseline_shift_factor:=500; + +@z + + @x [34.683] radical with japanese char @d left_delimiter(#)==#+4 {first delimiter field of a noad} @d right_delimiter(#)==#+5 {second delimiter field of a fraction noad} @@ -3407,9 +3444,13 @@ else begin KANJI(cx):=math_kcode_nucleus(p); print_kanji(cx); @x [34.692] l.14266 - pTeX: print_subsidiary_data math_char: begin print_ln; print_current_string; print_fam_and_char(p); + end; + sub_box: show_info; {recursive call} @y math_char, math_jchar: begin print_ln; print_current_string; print_fam_and_char(p,math_type(p)); + end; + sub_box, sub_exp_box: show_info; {recursive call} @z @x [34.696] l.14327 - pTeX: print_fam_and_char @@ -3419,7 +3460,7 @@ accent_noad: begin print_esc("accent"); print_fam_and_char(accent_chr(p),math_char); @z -@x pTeX: flush choice_node +@x [35.698] pTeX: flush choice_node begin if math_type(nucleus(p))>=sub_box then flush_node_list(info(nucleus(p))); if math_type(supscr(p))>=sub_box then @@ -3468,18 +3509,40 @@ accent_noad: begin print_esc("accent"); @x [36.720] l.14783 - pTeX: clean_box function clean_box(@!p:pointer;@!s:small_number):pointer; @y +function shift_sub_exp_box(@!q:pointer):pointer; + { We assume that |math_type(q)=sub_exp_box| } + var d: halfword; {displacement} + begin + if direction=dir_tate then d:=t_baseline_shift + else d:=y_baseline_shift; + if cur_style0) then @@ -4738,6 +4808,14 @@ q:pointer; shift_amount(cur_box):=box_context; @z +@x [47.1076] pTeX: sub_exp_box + else begin p:=new_noad; + math_type(nucleus(p)):=sub_box; +@y + else begin p:=new_noad; + math_type(nucleus(p)):=sub_exp_box; +@z + @x [47.1078] l.21585 - pTeX: box_dir adjust begin append_glue; subtype(tail):=box_context-(leader_flag-a_leaders); leader_ptr(tail):=cur_box; diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog index b54c32eb0c1..d581a7e439f 100644 --- a/Build/source/texk/web2c/synctexdir/ChangeLog +++ b/Build/source/texk/web2c/synctexdir/ChangeLog @@ -1,3 +1,8 @@ +2016-03-04 Hironori Kitagawa + + * synctex-ep-mem.ch1, synctex-p-mem.ch1: Adapt to changes in + ptexdir/ptex-base.ch. + 2015-12-21 Akira Kakuto * synctex-luatex.h: update for the new texnode.h in LuaTeX beta-0.87.0. diff --git a/Build/source/texk/web2c/synctexdir/synctex-ep-mem.ch1 b/Build/source/texk/web2c/synctexdir/synctex-ep-mem.ch1 index 8747294c42e..a70208e77f2 100644 --- a/Build/source/texk/web2c/synctexdir/synctex-ep-mem.ch1 +++ b/Build/source/texk/web2c/synctexdir/synctex-ep-mem.ch1 @@ -10,9 +10,9 @@ @z @x tex.web l.4960 + tex.ch -@d tex_int_pars=60 {total number of \TeX's integer parameters} +@d tex_int_pars=63 {total number of \TeX's integer parameters} @y -@d synctex_code=60 +@d synctex_code=63 @d tex_int_pars=synctex_code+1 {total number of \TeX's integer parameters} @z diff --git a/Build/source/texk/web2c/synctexdir/synctex-p-mem.ch1 b/Build/source/texk/web2c/synctexdir/synctex-p-mem.ch1 index 3d47ed82b3b..c13a7279cc4 100644 --- a/Build/source/texk/web2c/synctexdir/synctex-p-mem.ch1 +++ b/Build/source/texk/web2c/synctexdir/synctex-p-mem.ch1 @@ -10,9 +10,9 @@ @z @x tex.web l.4960 + tex.ch -@d int_pars=60 {total number of integer parameters} +@d int_pars=63 {total number of integer parameters} @y -@d synctex_code=60 +@d synctex_code=63 @d int_pars=synctex_code+1 {total number of integer parameters} @z -- cgit v1.2.3