From e50928cec6ab5ebd6b6a240787811784e3a96b43 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sat, 10 Feb 2024 09:42:44 +0000 Subject: {,e}uptex: Copy {,e}ptex source files to clean up building environment git-svn-id: svn://tug.org/texlive/trunk@69767 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/Makefile.in | 26 +- Build/source/texk/web2c/euptexdir/ChangeLog | 10 + Build/source/texk/web2c/euptexdir/am/euptex.am | 26 +- .../texk/web2c/euptexdir/char-warning-eptex.ch | 101 + Build/source/texk/web2c/euptexdir/eptex.ech | 804 ++ Build/source/texk/web2c/euptexdir/eptex_version.h | 1 + .../texk/web2c/euptexdir/eptrip/eptrip.diffs | 1386 ++++ .../source/texk/web2c/euptexdir/eptrip/eptrip.log | 4429 +++++++++++ .../source/texk/web2c/euptexdir/eptrip/eptrip.tex | 1265 +++ Build/source/texk/web2c/euptexdir/eptrip/texmf.cnf | 41 + Build/source/texk/web2c/euptexdir/etex.ch0 | 261 + Build/source/texk/web2c/euptexdir/etex.ch1 | 214 + Build/source/texk/web2c/euptexdir/fam256.ch | 1537 ++++ Build/source/texk/web2c/euptexdir/pdfutils.ch | 2150 +++++ .../source/texk/web2c/euptexdir/suppresserrors.ch | 138 + .../web2c/euptexdir/tests/pdfprimitive-test.tex | 47 + Build/source/texk/web2c/uptexdir/ChangeLog | 7 + Build/source/texk/web2c/uptexdir/am/uptex.am | 6 +- Build/source/texk/web2c/uptexdir/ptex-base.ch | 8175 ++++++++++++++++++++ Build/source/texk/web2c/uptexdir/ptex_version.h | 1 + Build/source/texk/web2c/uptexdir/zfmtcompress.test | 102 + 21 files changed, 20698 insertions(+), 29 deletions(-) create mode 100644 Build/source/texk/web2c/euptexdir/char-warning-eptex.ch create mode 100644 Build/source/texk/web2c/euptexdir/eptex.ech create mode 100644 Build/source/texk/web2c/euptexdir/eptex_version.h create mode 100644 Build/source/texk/web2c/euptexdir/eptrip/eptrip.diffs create mode 100644 Build/source/texk/web2c/euptexdir/eptrip/eptrip.log create mode 100644 Build/source/texk/web2c/euptexdir/eptrip/eptrip.tex create mode 100644 Build/source/texk/web2c/euptexdir/eptrip/texmf.cnf create mode 100644 Build/source/texk/web2c/euptexdir/etex.ch0 create mode 100644 Build/source/texk/web2c/euptexdir/etex.ch1 create mode 100644 Build/source/texk/web2c/euptexdir/fam256.ch create mode 100644 Build/source/texk/web2c/euptexdir/pdfutils.ch create mode 100644 Build/source/texk/web2c/euptexdir/suppresserrors.ch create mode 100644 Build/source/texk/web2c/euptexdir/tests/pdfprimitive-test.tex create mode 100644 Build/source/texk/web2c/uptexdir/ptex-base.ch create mode 100644 Build/source/texk/web2c/uptexdir/ptex_version.h create mode 100755 Build/source/texk/web2c/uptexdir/zfmtcompress.test (limited to 'Build/source') diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index 326822d6c16..d5c3ff16709 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -3280,10 +3280,10 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \ $(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines \ euptexdir/COPYRIGHT euptexdir/COPYRIGHT.jis \ euptexdir/ChangeLog euptexdir/EUPTEX.txt $(euptex_tests) \ - eptexdir/eptrip/eptrip.log eptexdir/eptrip/eptrip.tex \ + euptexdir/eptrip/eptrip.log euptexdir/eptrip/eptrip.tex \ euptexdir/euptrip/euptrip.diffs euptexdir/euptrip/texmf.cnf \ euptexdir/pdfprimitive.test \ - eptexdir/tests/pdfprimitive-test.tex \ + euptexdir/tests/pdfprimitive-test.tex \ euptexdir/tests/pdfprimitive-euptex.log hitexdir/ChangeLog \ $(hitex_web) $(hitex_tests) hitexdir/tests/hello.tex \ hitexdir/tests/rule.tex pdftexdir/regex/COPYING.LIB \ @@ -4503,7 +4503,7 @@ nodist_uptex_SOURCES = $(uptex_c_h) uptex-pool.c dist_uptex_SOURCES = uptexdir/uptexextra.c uptexdir/uptexextra.h uptexdir/uptex_version.h # We must create uptexd.h and uptexdir/uptex_version.h before building the uptex_OBJECTS. -uptex_prereq = uptexd.h ptexdir/ptex_version.h uptexdir/uptex_version.h +uptex_prereq = uptexd.h uptexdir/ptex_version.h uptexdir/uptex_version.h uptex_web_srcs = \ tex.web \ tex.ch \ @@ -4512,7 +4512,7 @@ uptex_web_srcs = \ zlib-fmt.ch uptex_ch_srcs = \ - ptexdir/ptex-base.ch \ + uptexdir/ptex-base.ch \ uptexdir/uptex-m.ch \ $(uptex_ch_synctex) \ tex-binpool.ch @@ -4570,7 +4570,7 @@ dist_euptex_SOURCES = euptexdir/euptexextra.c euptexdir/euptexextra.h \ # We must create euptexd.h and [eu]ptexdir/[eu]ptex_version.h before building the euptex_OBJECTS. euptex_prereq = euptexd.h etexdir/etex_version.h \ - ptexdir/ptex_version.h eptexdir/eptex_version.h \ + uptexdir/ptex_version.h euptexdir/eptex_version.h \ uptexdir/uptex_version.h $(am__append_146) euptex_web_srcs = \ tex.web \ @@ -4584,20 +4584,20 @@ euptex_web_srcs = \ etexdir/tex.ech euptex_ch_srcs = \ - eptexdir/etex.ch0 \ - ptexdir/ptex-base.ch \ + euptexdir/etex.ch0 \ + uptexdir/ptex-base.ch \ uptexdir/uptex-m.ch \ euptexdir/euptex.ch0 \ - eptexdir/eptex.ech \ - eptexdir/etex.ch1 \ + euptexdir/eptex.ech \ + euptexdir/etex.ch1 \ euptexdir/euptex.ch1 \ $(euptex_ch_synctex) \ - eptexdir/fam256.ch \ + euptexdir/fam256.ch \ euptexdir/pdfstrcmp-eup-pre.ch \ - eptexdir/pdfutils.ch \ + euptexdir/pdfutils.ch \ euptexdir/pdfstrcmp-eup-post.ch \ - eptexdir/suppresserrors.ch \ - eptexdir/char-warning-eptex.ch \ + euptexdir/suppresserrors.ch \ + euptexdir/char-warning-eptex.ch \ tex-binpool.ch diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog index 6dc6e9a078b..3e25e6c6299 100644 --- a/Build/source/texk/web2c/euptexdir/ChangeLog +++ b/Build/source/texk/web2c/euptexdir/ChangeLog @@ -1,3 +1,13 @@ +2024-02-10 TANAKA Takuji + + * eptex_version.h, eptex.ech, etex.ch{0,1}, + {char-warning-eptex,fam256,pdfutils,suppresserrors}.ch, + eptrip/eptrip.{diffs,log,tex}, eptrip/texmf.cnf, + tests/pdfprimitive-test.tex, am/euptex.am: + Copy eptex source files from ../eptexdir + to cleaning up building environment. + https://github.com/texjporg/tex-jp-build/issues/32 + 2023-12-24 TANAKA Takuji * wcfname{,0}.test: diff --git a/Build/source/texk/web2c/euptexdir/am/euptex.am b/Build/source/texk/web2c/euptexdir/am/euptex.am index 4faf59c3271..3ad8ab71525 100644 --- a/Build/source/texk/web2c/euptexdir/am/euptex.am +++ b/Build/source/texk/web2c/euptexdir/am/euptex.am @@ -33,8 +33,8 @@ nodist_euptex_SOURCES = $(euptex_c_h) euptex-pool.c dist_euptex_SOURCES = euptexdir/euptexextra.c euptexdir/euptexextra.h # We must create euptexd.h and [eu]ptexdir/[eu]ptex_version.h before building the euptex_OBJECTS. -euptex_prereq = euptexd.h etexdir/etex_version.h ptexdir/ptex_version.h \ - eptexdir/eptex_version.h uptexdir/uptex_version.h +euptex_prereq = euptexd.h etexdir/etex_version.h uptexdir/ptex_version.h \ + euptexdir/eptex_version.h uptexdir/uptex_version.h $(euptex_OBJECTS): $(euptex_prereq) $(euptex_c_h): euptex-web2c @@ -69,20 +69,20 @@ euptex_web_srcs = \ euptex.ch: tie$(EXEEXT) euptex.web $(euptex_ch_srcs) $(tie_c) euptex.web $(euptex_ch_srcs) euptex_ch_srcs = \ - eptexdir/etex.ch0 \ - ptexdir/ptex-base.ch \ + euptexdir/etex.ch0 \ + uptexdir/ptex-base.ch \ uptexdir/uptex-m.ch \ euptexdir/euptex.ch0 \ - eptexdir/eptex.ech \ - eptexdir/etex.ch1 \ + euptexdir/eptex.ech \ + euptexdir/etex.ch1 \ euptexdir/euptex.ch1 \ $(euptex_ch_synctex) \ - eptexdir/fam256.ch \ + euptexdir/fam256.ch \ euptexdir/pdfstrcmp-eup-pre.ch \ - eptexdir/pdfutils.ch \ + euptexdir/pdfutils.ch \ euptexdir/pdfstrcmp-eup-post.ch \ - eptexdir/suppresserrors.ch \ - eptexdir/char-warning-eptex.ch \ + euptexdir/suppresserrors.ch \ + euptexdir/char-warning-eptex.ch \ tex-binpool.ch EXTRA_DIST += $(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines @@ -123,8 +123,8 @@ endif EUPTEX ## ## euptexdir/euptriptest.test EXTRA_DIST += \ - eptexdir/eptrip/eptrip.log \ - eptexdir/eptrip/eptrip.tex \ + euptexdir/eptrip/eptrip.log \ + euptexdir/eptrip/eptrip.tex \ euptexdir/euptrip/euptrip.diffs \ euptexdir/euptrip/texmf.cnf euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) @@ -136,7 +136,7 @@ DISTCLEANFILES += euptrip.diffs ## euptexdir/pdfprimitive.test EXTRA_DIST += \ euptexdir/pdfprimitive.test \ - eptexdir/tests/pdfprimitive-test.tex \ + euptexdir/tests/pdfprimitive-test.tex \ euptexdir/tests/pdfprimitive-euptex.log DISTCLEANFILES += pdfprimitive-euptex.* diff --git a/Build/source/texk/web2c/euptexdir/char-warning-eptex.ch b/Build/source/texk/web2c/euptexdir/char-warning-eptex.ch new file mode 100644 index 00000000000..fcd528d45be --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/char-warning-eptex.ch @@ -0,0 +1,101 @@ +% $Id$ +% Public domain. See ../pdftexdir/char-warning-pdftex.ch for info. + +@x [30] If \tracinglostchars > 2, then promote full errors. +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var @!l:0..255; {small indices or counters} +old_setting: integer; {saved value of |tracing_online|} +begin if tracing_lost_chars>0 then + begin old_setting:=tracing_online; + if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; + begin begin_diagnostic; + print_nl("Missing character: There is no "); +@.Missing character@> + if (c<" ")or(c>"~") then + begin print_char("^"); print_char("^"); + if c<64 then print_char(c+64) + else if c<128 then print_char(c-64) + else begin print_lc_hex(c div 16); print_lc_hex(c mod 16); end + end + else print_ASCII(c); + print(" in font "); + slow_print(font_name[f]); print_char("!"); end_diagnostic(false); + end; + tracing_online:=old_setting; + end; +end; +@y +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var @!l:0..255; {small indices or counters} +old_setting: integer; {saved value of |tracing_online|} +begin if tracing_lost_chars>0 then + begin old_setting:=tracing_online; + if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; + if tracing_lost_chars > 2 then + print_err("Missing character: There is no ") + else begin + begin_diagnostic; + print_nl("Missing character: There is no ") + end; +@.Missing character@> + if (c<" ")or(c>"~") then begin + print_char("^"); print_char("^"); + if c<64 then print_char(c+64) + else if c<128 then print_char(c-64) + else begin print_lc_hex(c div 16); print_lc_hex(c mod 16); end + end + else print_ASCII(c); + if tracing_lost_chars > 2 then begin + print(" ("); + print_hex(c); + print(")"); + end; + print(" in font "); + slow_print(font_name[f]); + if tracing_lost_chars < 3 then print_char("!"); + tracing_online:=old_setting; + if tracing_lost_chars > 2 then begin + help0; + error; + end else end_diagnostic(false); + end; {of |tracing_lost_chars>0|} +end; {of procedure} +@z + +@x [30] Another warning for (u)pTeX. +@p procedure char_warning_jis(@!f:internal_font_number;@!jc:KANJI_code); +begin if tracing_lost_chars>0 then + begin begin_diagnostic; + print_nl("Character "); print_kanji(jc); print(" ("); + print_hex(jc); print(") cannot be typeset in JIS-encoded JFM "); + slow_print(font_name[f]); + print_char(","); print_nl("so I use .notdef glyph instead."); + end_diagnostic(false); + end; +end; +@y +@p procedure char_warning_jis(@!f:internal_font_number;@!jc:KANJI_code); +var old_setting: integer; {saved value of |tracing_online|} +begin if tracing_lost_chars>0 then + begin old_setting:=tracing_online; + if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; + if tracing_lost_chars > 2 then + print_err("Character ") + else begin + begin_diagnostic; + print_nl("Character ") + end; + print_kanji(jc); print(" ("); + print_hex(jc); print(") cannot be typeset in JIS-encoded JFM "); + slow_print(font_name[f]); + print_char(","); + if tracing_lost_chars > 2 then + begin print_nl(" so I use .notdef glyph instead"); + help0; error; end + else + begin print_nl("so I use .notdef glyph instead."); + end_diagnostic(false); end; + tracing_online:=old_setting; + end; {of |tracing_lost_chars>0|} +end; {of procedure} +@z diff --git a/Build/source/texk/web2c/euptexdir/eptex.ech b/Build/source/texk/web2c/euptexdir/eptex.ech new file mode 100644 index 00000000000..bb4d31519f4 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/eptex.ech @@ -0,0 +1,804 @@ +% eptexdir/eptex.ech: changefile used to build e-pTeX, see eptexdir/eptex-base.ch for details. +% Public domain. Originally written by Peter Breitenlohner . + +%% new primitives by e-pTeX +%% +%% \epTeXversion +%% \epTeXinputencoding +%% +%% \currentspacingmode: 1 iff auto_spacing +%% \currentxspacingmode: 1 iff auto_xspacing +%% \lastnodechar: the (internal) character code of the last node +%% -1: non-character or null +%% \lastnodesubtype: the (internal) subtype of the last node +%% note: returns a value from the type if the node is s math noad. +%% -1: null +%% fallback to 0 if not explicitly set +%% \readpapersizespecial +%% 1: papersize special automatically sets \pdfpage{width,height} (quick hack). +%% 0: off +%% The default value is 1. +%% + +@x e-pTeX: logo +\def\eTeX{$\varepsilon$-\TeX} +@y +\def\eTeX{$\varepsilon$-\TeX} +\def\epTeX{$\varepsilon$-\pTeX} +@z + +@x [1.2] l.190 - epTeX: +@d eTeX_version_string=='-2.6' {current \eTeX\ version} +@y +@d eTeX_version_string=='-2.6' {current \eTeX\ version} +@# +@d epTeX_version_string=='-230214' +@d epTeX_version_number==230214 +@z + +@x e-pTeX: banner + {printed when \pTeX\ starts} +@y + {printed when \pTeX\ starts} +@# +@d epTeX_version==pTeX_version_string,epTeX_version_string,eTeX_version_string +@d epTeX_banner=='This is e-pTeX, Version 3.141592653',epTeX_version +@d epTeX_banner_k==epTeX_banner + {printed when \epTeX\ starts} +@z + +@x [1.2] +@d banner==pTeX_banner +@d banner_k==pTeX_banner_k +@y +@d banner==epTeX_banner +@d banner_k==epTeX_banner_k +@z + +@x [10.135] l.2895 - e-pTeX: box_lr and box_dir +In \eTeX\ the |subtype| field records the box direction mode |box_lr|. +@y +In \eTeX\ the |subtype| field records the box direction mode |box_lr|. +In \epTeX\ the |subtype| field is |qi(16*box_lr+box_dir)|. +@z + +@x +@d box_dir(#) == (qo(subtype(#))-dir_max) {direction of a box} +@d set_box_dir(#) == subtype(#):=set_box_dir_end +@y +@d box_dir(#) == ((qo(subtype(#)))mod 16 - dir_max) {direction of a box} +@d set_box_dir(#) == subtype(#):=box_lr(#)*16+set_box_dir_end +@z + +@x [17] +@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} +@y +@d saving_hyph_codes_code=etex_int_base+8 {save hyphenation codes for languages} +@d read_papersize_special_code=etex_int_base+9 +@d eTeX_state_code=etex_int_base+10 {\eTeX\ state variables} +@z + +@x [17] +@d saving_hyph_codes==int_par(saving_hyph_codes_code) +@y +@d saving_hyph_codes==int_par(saving_hyph_codes_code) +@d read_papersize_special==int_par(read_papersize_special_code) +@z + +@x [26.???] prepare for |scan_font_ident| to recognize \lastnodefont +@p procedure@?scan_int; forward; {scans an integer value} +@y +@p procedure@?scan_int; forward; {scans an integer value} +procedure@?scan_something_internal_ident; forward; +@z + +@x [26.413] l.8343 - e-pTeX: scan_something_internal +var m:halfword; {|chr_code| part of the operand token} +@y +label exit; +var m:halfword; {|chr_code| part of the operand token} +@z + +@x [26.???] add |scan_something_internal_ident| (used in |scan_font_ident|) +@; +end; +@y +@; +end; + +@ @p procedure scan_something_internal_ident; + begin scan_something_internal(ident_val,false); end; +@z + +@x +@d input_line_no_code=glue_val+2 {code for \.{\\inputlineno}} +@d badness_code=glue_val+2 {code for \.{\\badness}} +@y +@d last_node_subtype_code=glue_val+2 {code for \.{\\lastnodesubtype}} +@d last_node_char_code=glue_val+3 {code for \.{\\lastnodechar}} +@d last_node_font_code=glue_val+4 {code for \.{\\lastnodefont}} +@d input_line_no_code=glue_val+5 {code for \.{\\inputlineno}} +@d badness_code=glue_val+6 {code for \.{\\badness}} +@z + +@x +@d ptex_minor_version_code=ptex_version_code+1 {code for \.{\\ptexminorversion}} +@y +@d eptex_version_code=ptex_version_code+1 {code for \.{\\epTeXversion}} +@d ptex_minor_version_code=eptex_version_code+1 {code for \.{\\ptexminorversion}} +@z + +@x e-pTeX: \current(x)spacingmode +@d eTeX_dim=eTeX_int+8 {first of \eTeX\ codes for dimensions} +@y +@d eTeX_dim=eTeX_int+10 {first of \eTeX\ codes for dimensions} +@z + +@x +primitive("ptexminorversion",last_item,ptex_minor_version_code); +@!@:ptexminorversion_}{\.{\\ptexminorversion} primitive@> +@y +primitive("epTeXversion",last_item,eptex_version_code); +@!@:epTeXversion_}{\.{\\epTeXversion} primitive@> +primitive("ptexminorversion",last_item,ptex_minor_version_code); +@!@:ptexminorversion_}{\.{\\ptexminorversion} primitive@> +@z + +@x + ptex_minor_version_code: print_esc("ptexminorversion"); +@y + eptex_version_code: print_esc("epTeXversion"); + ptex_minor_version_code: print_esc("ptexminorversion"); +@z + +@x [26.420] l.8474 - pTeX: Fetch a box dimension: dir_node +begin scan_eight_bit_int; q:=box(cur_val); +@y +begin scan_register_num; fetch_box(q); +@z + +@x [26.424] l.8508 - e-pTeX: TeXXeT and disp_node +node of the current list. +@y +node of the current list. +The macro |find_effective_tail_epTeX| sets |tx| to the last non-\.{\\endM} +non-|disp_node| of the current list. +@z + +@x [26.424] l.8510 - e-pTeX: last node +@d find_effective_tail==find_effective_tail_pTeX +@y +@d find_effective_tail_epTeX== +tx:=tail; +if not is_char_node(tx) then if type(tx)=disp_node then tx:=prev_node; +if not is_char_node(tx) then + if (type(tx)=disp_node) {|disp_node| from a discretionary} + or((type(tx)=math_node)and(subtype(tx)=end_M_code)) then + begin r:=head; q:=link(head); + while q<>tx do + begin if is_char_node(q) then r:=q + else if (type(q)<>disp_node)and + ((type(q)<>math_node)or(subtype(q)<>end_M_code)) then r:=q; + q:=link(q); + end; + tx:=r; + end +@# +@d find_effective_tail==find_effective_tail_epTeX +@# +@d find_last_char== +if font_dir[font(tx)]<>dir_default then cur_val:=KANJI(info(link(tx))) +else cur_val:=qo(character(tx)) + +@d ignore_font_kerning== +begin if ((type(tx)=glue_node) and (subtype(tx)=jfm_skip+1)) + or ((type(tx)=penalty_node) and (subtype(tx)=kinsoku_pena)) then + tx:=last_jchr +else if (type(tx)=kern_node) and (subtype(tx)=normal) then + begin r:=head; q:=link(head); + while q<>tx do + begin r:=q; + if is_char_node(q) then if font_dir[font(q)]<>dir_default then q:=link(q); + q:=link(q); + end; + if ((type(r)=penalty_node) and (subtype(r)=kinsoku_pena)) then tx:=last_jchr else tx:=r; + end; +end +@z + +@x + ptex_minor_version_code: cur_val:=pTeX_minor_version; +@y + eptex_version_code: cur_val:=epTeX_version_number; + ptex_minor_version_code: cur_val:=pTeX_minor_version; +@z + +@x [26.424] e-pTeX: node char + if cur_chr=last_node_type_code then + begin cur_val_level:=int_val; + if (tx=head)or(mode=0) then cur_val:=-1; + end + else cur_val_level:=cur_chr; +@y + if (cur_chr=last_node_type_code)or(cur_chr=last_node_subtype_code) then + begin cur_val_level:=int_val; + if (tx=head)or(mode=0) then cur_val:=-1; + end + else if cur_chr=last_node_char_code then + begin cur_val_level:=int_val; cur_val:=-1; + end + else if cur_chr=last_node_font_code then + begin cur_val_level:=ident_val; cur_val:=null_font+font_id_base; + end + else cur_val_level:=cur_chr; + if (cur_chr=last_node_char_code)or(cur_chr=last_node_font_code) then + if is_char_node(tx)and(tx<>head) then begin + { |tx| might be ``second node'' of a KANJI character; so we need to look the node before |tx| } + r:=head; q:=head; + while q<>tx do begin r:=q; q:=link(q); end; { |r| is the node just before |tx| } + if (r<>head)and is_char_node(r) then if font_dir[font(r)]<>dir_default then tx:=r; + if cur_chr=last_node_char_code then find_last_char + else cur_val:=font(tx)+font_id_base; + end; +@z + +@x [26.424] e-pTeX: node types + last_node_type_code: if type(tx)<=unset_node then cur_val:=type(tx)+1 + else cur_val:=unset_node+2; +@y + last_node_type_code: if type(tx)<=unset_node then + begin if type(tx)=dir_node then tx:=list_ptr(tx); + cur_val:=type(tx); + if cur_valdisp_node then cur_val:=cur_val-1; + end + else cur_val:=unset_node; {\epTeX's |unset_node| is \eTeX's |unset_node+2|} + last_node_subtype_code: if type(tx)<=unset_node then cur_val:=subtype(tx) + { non-math nodes } + else begin + cur_val:=type(tx); + if cur_valnull do r:=link(r); + cur_val:=qo(character(r)); + end + {else: already -1} + end; + last_node_font_code: begin + ignore_font_kerning; + if is_char_node(tx) then + cur_val:=font(tx)+font_id_base + else if type(tx)=ligature_node then + cur_val:=font(lig_char(tx))+font_id_base + {else: already nullfont} + end; +@z + +@x + last_node_type_code: cur_val:=last_node_type; +@y + last_node_type_code: cur_val:=last_node_type; + last_node_subtype_code: cur_val:=last_node_subtype; +@z + +@x e-pTeX: if primitives - leave room for three e-TeX codes +@d if_tdir_code=if_case_code+1 { `\.{\\iftdir}' } +@y +@d if_tdir_code=if_case_code+4 { `\.{\\iftdir}' } +@z + +@x [30.???] |scan_font_ident|: recognize \lastnodefont +else begin print_err("Missing font identifier"); +@y +else if (cur_cmd=last_item)and(cur_chr=last_node_font_code) then + begin scan_something_internal_ident; f:=cur_val-font_id_base; + end +else begin print_err("Missing font identifier"); +@z + +@x +@d box_lr(#) == (qo(subtype(#))) {direction mode of a box} +@d set_box_lr(#) == subtype(#):=set_box_lr_end +@d set_box_lr_end(#) == qi(#) +@y +@d box_lr(#) == ((qo(subtype(#)))div 16) {direction mode of a box} +@d set_box_lr(#) == subtype(#):=box_dir(#)+dir_max+set_box_lr_end +@d set_box_lr_end(#) == qi(16*(#)) +@z + +@x [35] +@= +text_baseline_shift_factor:=1000; +@y +@= +text_baseline_shift_factor:=1000; +read_papersize_special:=1; +@z + +@x +@!last_node_type:integer; {used to implement \.{\\lastnodetype}} +@y +@!last_node_type:integer; {used to implement \.{\\lastnodetype}} +@!last_node_subtype:integer; {used to implement \.{\\lastnodesubtype}} +@z + +@x +last_node_type:=-1; +@y +last_node_type:=-1; last_node_subtype:=-1; +@z + +@x [45.996] l.19420 +last_node_type:=type(p)+1; +@y +if type(p) + end + else if type(q)=disp_node then + begin prev_node:=p; gd:=2; + if link(q)=null then gm:=0 + else if type(link(q))=math_node then gm:=1 + else confusion("tail4"); +@:this can't happen tail4}{\quad tail4@> + end + else confusion("tail5"); +@:this can't happen tail5}{\quad tail5@> + end; +if gm=0 then if fm=2 then confusion("tail1") +@:this can't happen tail1}{\quad tail1@> + else if fm=1 then confusion("tail2"); +@:this can't happen tail2}{\quad tail2@> +if (fm+fd)=1 then begin fm:=0; fd:=0;@+end; +if gm=0 then fm:=0; +if gd=0 then fd:=0; +@# +if fd>0 then {merge a |disp_node| pair} + begin if gm=0 then {|p|$\to$|q=disp_node|$to$|null|} + begin t:=q; q:=null; link(p):=q; tail:=p;@+end + else if gm=1 then {|p|$\to$|q=disp_node|$to$|end_M|$to$|null|} + begin t:=q; q:=link(q); link(p):=q; gm:=2;@+end + else {|p|$\to$|q=end_M|$\to$|disp_node|$to$|null|} + begin t:=link(q); link(q):=null; tail:=q;@+end; +@# + if fd=1 then {|s|$\to$|r=disp_node|} + begin prev_node:=s; disp_dimen(r):=disp_dimen(t);@+end + else {|r|$\to$|p=disp_node|} + begin prev_node:=r; disp_dimen(p):=disp_dimen(t);@+end; + prev_disp:=pdisp; free_node(t,small_node_size); gd:=0; + end; +@# +if fm>0 then {drop \.{\\beginM} \.{\\endM} pair} + begin if gd=0 then {|p|$\to$|q=end_M|$to$|null|} + begin t:=q; q:=null; link(p):=q; tail:=p;@+end + else if gd=1 then {|p|$\to$|q=end_M|$to$|disp_node|$to$|null|} + begin t:=q; q:=link(q); link(p):=q; prev_node:=p; link(t):=null + end + else {|p|$\to$|q=disp_node|$\to$|end_M|$to$|null|} + begin t:=link(q); link(q):=null; tail:=q;@+end; +@# + if fm=1 then {|s|$\to$|r=begin_M|$\to$|p=disp_node|} + begin link(s):=p; link(r):=t; t:=r; prev_node:=s;@+end + else {|r|$\to$|p=begin_M|$\to$|q|} + begin link(r):=q; link(p):=t; t:=p; + if q=null then tail:=r@+else prev_node:=r; + end; + flush_node_list(t); + end +@# +@d check_effective_tail(#)==find_effective_tail_epTeX +@d fetch_effective_tail==fetch_effective_tail_epTeX +@z + +@x [47.1105] l.21246 +@!fd:boolean; {a final |disp_node| pair?} +@y +@!s:pointer; {running behind |r|} +@!t:pointer; +@!fm:integer; {1: if |r|, 2: if |p| is a \.{\\beginM} node} +@!gm:integer; {1: if |link(q)|, 2: if |q| is an \.{\\endM} node} +@!fd,@!gd:integer; {same for |disp_node|} +@z + +@x +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@y +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@d epTeX_input_encoding_code=6 {command modifier for \.{\\epTeXinputencoding}} +@z + +@x +primitive("setlanguage",extension,set_language_code);@/ +@!@:set_language_}{\.{\\setlanguage} primitive@> +@y +primitive("setlanguage",extension,set_language_code);@/ +@!@:set_language_}{\.{\\setlanguage} primitive@> +primitive("epTeXinputencoding",extension,epTeX_input_encoding_code);@/ +@!@:epTeX_input_encoding_}{\.{\\epTeXinputencoding} primitive@> +@z + +@x + set_language_code:print_esc("setlanguage"); +@y + set_language_code:print_esc("setlanguage"); + epTeX_input_encoding_code:print_esc("epTeXinputencoding"); +@z + +@x +set_language_code:@; +@y +set_language_code:@; +epTeX_input_encoding_code:@; +@z + +@x +@ @= +@y +@ @= +procedure eptex_set_input_encoding; +var j,k:integer; +begin + scan_file_name; + pack_cur_name; + if state=token_list then + begin k:=input_ptr-1; j:=-1; + while k>=0 do + begin if input_stack[k].state_field=token_list then decr(k) + else if input_stack[k].name_field>19 then + begin j:=input_stack[k].index_field; k:=-1; end + else begin j:=-(input_stack[k].name_field+1); k:=-1; end + end + end + else if name>19 then j:=index else j:=-(name+1); + if (j>=0) or (j=-1) or (j=-18) then begin + k:=true; + if j>=0 then k:=setinfileenc(input_file[j],stringcast(name_of_file+1)) + else k:=setstdinenc(stringcast(name_of_file+1)); + if k = false then + begin begin_diagnostic; + print_nl("Unknown encoding `"); + slow_print(cur_area); slow_print(cur_name); slow_print(cur_ext); + print("'"); end_diagnostic(false); + end + end + else + begin begin_diagnostic; j:=-j-1; + print_ln; + print_nl("Warning: \epTeXinputencoding is ignored, since I am current reading"); + print_nl("from "); + if j>=18 then print("a pseudo file created by \scantokens.") + else begin print("input stream "); print_int(j); print("."); end; + end_diagnostic(false); + end +end; + +@ @= +eptex_set_input_encoding + +@ @= +@z + +@x +primitive("lastnodetype",last_item,last_node_type_code); +@!@:last_node_type_}{\.{\\lastnodetype} primitive@> +@y +primitive("lastnodetype",last_item,last_node_type_code); +@!@:last_node_type_}{\.{\\lastnodetype} primitive@> +primitive("lastnodesubtype",last_item,last_node_subtype_code); +@!@:last_node_subtype_}{\.{\\lastnodesubtype} primitive@> +primitive("lastnodechar",last_item,last_node_char_code); +@!@:last_node_char_}{\.{\\lastnodechar} primitive@> +primitive("lastnodefont",last_item,last_node_font_code); +@!@:last_node_font_}{\.{\\lastnodefont} primitive@> +@z + +@x +last_node_type_code: print_esc("lastnodetype"); +@y +last_node_type_code: print_esc("lastnodetype"); +last_node_subtype_code: print_esc("lastnodesubtype"); +last_node_char_code: print_esc("lastnodechar"); +last_node_font_code: print_esc("lastnodefont"); +@z + +@x +primitive("savinghyphcodes",assign_int,int_base+saving_hyph_codes_code);@/ +@!@:saving_hyph_codes_}{\.{\\savinghyphcodes} primitive@> +@y +primitive("savinghyphcodes",assign_int,int_base+saving_hyph_codes_code);@/ +@!@:saving_hyph_codes_}{\.{\\savinghyphcodes} primitive@> +primitive("readpapersizespecial",assign_int,int_base+read_papersize_special_code);@/ +@!@:read_papersize_special_}{\.{\\readpapersizespecial} primitive@> +@z + +@x +saving_hyph_codes_code:print_esc("savinghyphcodes"); +@y +saving_hyph_codes_code:print_esc("savinghyphcodes"); +read_papersize_special_code:print_esc("readpapersizespecial"); +@z + +@x e-pTeX: font_char_{wd,ht,dp,ic}_code l.27306 +font_char_ic_code: begin scan_font_ident; q:=cur_val; scan_char_num; + if (font_bc[q]<=cur_val)and(font_ec[q]>=cur_val) then + begin i:=char_info(q)(qi(cur_val)); + case m of + font_char_wd_code: cur_val:=char_width(q)(i); + font_char_ht_code: cur_val:=char_height(q)(height_depth(i)); + font_char_dp_code: cur_val:=char_depth(q)(height_depth(i)); + font_char_ic_code: cur_val:=char_italic(q)(i); + end; {there are no other cases} + end + else cur_val:=0; + end; +@y +font_char_ic_code: begin scan_font_ident; q:=cur_val; + if font_dir[q]<>dir_default then {Japanese font} + begin scan_int; + if cur_val>=0 then + begin if is_char_kanji(cur_val) then {Japanese Character} + cur_val:=get_jfm_pos(KANJI(cur_val),q) + else cur_val:=-1 + end + else begin + cur_val:=-(cur_val+1); + if (font_bc[q]>cur_val)or(font_ec[q]-1 then + begin + i:=orig_char_info(q)(qi(cur_val)); + case m of + font_char_wd_code: cur_val:=char_width(q)(i); + font_char_ht_code: cur_val:=char_height(q)(height_depth(i)); + font_char_dp_code: cur_val:=char_depth(q)(height_depth(i)); + font_char_ic_code: cur_val:=char_italic(q)(i); + end; {there are no other cases} + end + else cur_val:=0; + end + else begin scan_ascii_num; + if (font_bc[q]<=cur_val)and(font_ec[q]>=cur_val) then + begin i:=orig_char_info(q)(qi(cur_val)); + case m of + font_char_wd_code: cur_val:=char_width(q)(i); + font_char_ht_code: cur_val:=char_height(q)(height_depth(i)); + font_char_dp_code: cur_val:=char_depth(q)(height_depth(i)); + font_char_ic_code: cur_val:=char_italic(q)(i); + end; {there are no other cases} + end + else cur_val:=0; + end + end; +@z + +@x e-pTeX: displacement value when typesetting right-to-left l.27798 +@!LR_ptr:pointer; {stack of LR codes for |hpack|, |ship_out|, and |init_math|} +@y +@!revdisp:scaled; {temporary value of displacement} +@!LR_ptr:pointer; {stack of LR codes for |hpack|, |ship_out|, and |init_math|} +@z + +@x e-pTeX: reverse nodes of an hlist l.28010 +var l:pointer; {the new list} +@y +var l,la:pointer; {the new list} +disp,disp2: scaled; { displacement } disped: boolean; +@z +@x e-pTeX: reverse nodes of an hlist l.28010 +begin g_order:=glue_order(this_box); g_sign:=glue_sign(this_box); +@y +begin g_order:=glue_order(this_box); g_sign:=glue_sign(this_box); +disp:=revdisp; disped:=false; +@z +@x e-pTeX: reverse nodes of an hlist l.28010 +done:reverse:=l; +@y +done: {if the beginning node of the new list isn't |disp_node|, + we insert |disp_node| to fix.} +if (l<>null)and(type(l)<>disp_node) then begin + p:=get_node(small_node_size); type(p):=disp_node; + disp_dimen(p):=disp; link(p):=l; reverse:=p; + end +else reverse:=l; +@z +@x e-pTeX: reverse nodes of an hlist l.28010 + q:=link(p); link(p):=l; l:=p; p:=q; +@y + if font_dir[f]<>dir_default then begin + q:=link(p); la:=l; l:=p; p:=link(q); link(q):=la; + end + else begin q:=link(p); link(p):=l; l:=p; p:=q; end; +@z +@x e-pTeX: reverse nodes of an hlist l.28010 +othercases goto next_p +@y +disp_node: begin + disp2:=disp_dimen(p); disp_dimen(p):=disp; disp:=disp2; + if not disped then disped:=true; end; +othercases goto next_p +@z + +@x e-pTeX: just_copy + hlist_node,vlist_node: begin r:=get_node(box_node_size); +@y + dir_node, + hlist_node,vlist_node: begin r:=get_node(box_node_size); +@z +@x e-pTeX: just_copy + mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last two words} +@y + mem[r+7]:=mem[p+7]; + mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last three words} + add_glue_ref(space_ptr(r)); add_glue_ref(xspace_ptr(r)); +@z + +@x e-pTeX: pseudo file + buffer[last]:=w.b0; buffer[last+1]:=w.b1; + buffer[last+2]:=w.b2; buffer[last+3]:=w.b3; +@y + buffer[last]:=w.b0 mod @"100; buffer[last+1]:=w.b1 mod @"100; + buffer[last+2]:=w.b2 mod @"100; buffer[last+3]:=w.b3 mod @"100;@/ + buffer2[last]:=0; buffer2[last+1]:=0; + buffer2[last+2]:=0; buffer2[last+3]:=0; +@z + +@x e-pTeX: \readline +@ @= +if j=1 then + begin while loc<=limit do {current line not yet finished} + begin cur_chr:=buffer[loc]; incr(loc); + if cur_chr=" " then cur_tok:=space_token + @+else cur_tok:=cur_chr+other_token; +@y +@ @= +if j=1 then + begin while loc<=limit do {current line not yet finished} + begin cur_chr:=buffer[loc]; incr(loc); + if multistrlen(ustringcast(buffer), limit+1, loc-1)=2 then + begin cur_tok:=fromBUFF(ustringcast(buffer), limit+1, loc-1); incr(loc); + end + else if cur_chr=" " then cur_tok:=space_token + @+else cur_tok:=cur_chr+other_token; +@z + +@x e-pTeX: ifcsname l.28620 + buffer[m]:=info(p) mod @'400; incr(m); p:=link(p); +@y + if check_kanji(info(p)) then {|wchar_token|} + begin buffer[m]:=Hi(info(p)); buffer2[m]:=1; incr(m); buffer2[m]:=1; + end + else buffer2[m]:=0; + buffer[m]:=Lo(info(p)); incr(m); p:=link(p); +@z + +@x e-pTeX: if_font_char_code l.28633 +if_font_char_code:begin scan_font_ident; n:=cur_val; scan_char_num; + if (font_bc[n]<=cur_val)and(font_ec[n]>=cur_val) then + b:=char_exists(char_info(n)(qi(cur_val))) + else b:=false; + end; +@y +if_font_char_code:begin scan_font_ident; n:=cur_val; + if font_dir[n]<>dir_default then {Japanese font} + begin scan_int; + if cur_val>=0 then b:=is_char_kanji(cur_val) + { In u\pTeX, $\hbox{|is_char_kanji|} = \lambda x\mathpunct{.} x\ge 0$ } + else begin + cur_val:=-(cur_val+1); + b:=(font_bc[n]<=cur_val)and(font_ec[n]>=cur_val) + end + end + else begin scan_ascii_num; + if (font_bc[n]<=cur_val)and(font_ec[n]>=cur_val) then @/ + b:=char_exists(orig_char_info(n)(qi(cur_val))) + else b:=false; + end; + end; +@z + +@x e-pTeX: pTeX has \showmode, follow showstream.ch r61589 +@= +begin print_nl("> "); +@y +@= +begin + @ + print_nl("> "); +@z + +@x +procedure print_direction(@!d:integer); {print the direction represented by d} +@y +procedure print_direction_alt(@!d:integer); +var x: boolean; +begin x:=false; +case abs(d) of +dir_yoko: begin print(", yoko"); x:=true; end; +dir_tate: begin print(", tate"); x:=true; end; +dir_dtou: begin print(", dtou"); x:=true; end; +end; +if x then begin if d<0 then print("(math)"); +print(" direction"); end; +end; +@# +procedure print_direction(@!d:integer); {print the direction represented by d} +@z + +@x e-pTeX: fetch \(no)auto(x)spacing status +@* \[54] System-dependent changes. +@y +@ The \.{\\currentspacingmode} and \.{\\currentxspacingmode} commands +return the current \pTeX's status of \.{\\(no)autospacing} and +\.{\\(no)autoxspacing} respectively. + +@d current_spacing_mode_code=eTeX_int+8 {code for \.{\\currentspacingmode}} +@d current_xspacing_mode_code=eTeX_int+9 {code for \.{\\currentxspacingmode}} + +@= +primitive("currentspacingmode",last_item,current_spacing_mode_code); +@!@:current_spacing_mode_}{\.{\\currentspacingmode} primitive@> +primitive("currentxspacingmode",last_item,current_xspacing_mode_code); +@!@:current_xspacing_mode_}{\.{\\currentxspacingmode} primitive@> + +@ @= +current_spacing_mode_code: print_esc("currentspacingmode"); +current_xspacing_mode_code: print_esc("currentxspacingmode"); + +@ @= +current_spacing_mode_code: cur_val:=auto_spacing; +current_xspacing_mode_code: cur_val:=auto_xspacing; + +@* \[54] System-dependent changes. +@z diff --git a/Build/source/texk/web2c/euptexdir/eptex_version.h b/Build/source/texk/web2c/euptexdir/eptex_version.h new file mode 100644 index 00000000000..297bd81e7f3 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/eptex_version.h @@ -0,0 +1 @@ +#define EPTEX_VERSION "230214" diff --git a/Build/source/texk/web2c/euptexdir/eptrip/eptrip.diffs b/Build/source/texk/web2c/euptexdir/eptrip/eptrip.diffs new file mode 100644 index 00000000000..3891bb9d422 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/eptrip/eptrip.diffs @@ -0,0 +1,1386 @@ +#! /bin/sh -vx +# $Id: eptriptest.test 48633 2018-09-09 17:56:55Z karl $ +# Copyright 2017-2018 Karl Berry +# Copyright 2011-2014 Peter Breitenlohner +# Copyright 2010 Hironori Kitagawa +# You may freely use, modify and/or distribute this file. + +LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE ++ LC_ALL=C ++ export LC_ALL ++ LANGUAGE=C ++ export LANGUAGE + +testdir=$abs_srcdir/triptrap ++ testdir=SRCDIR/triptrap +etestdir=$abs_srcdir/etexdir/etrip ++ etestdir=SRCDIR/etexdir/etrip +eptestdir=$abs_srcdir/eptexdir/eptrip ++ eptestdir=SRCDIR/eptexdir/eptrip + +TEXMFCNF=$eptestdir; export TEXMFCNF ++ TEXMFCNF=SRCDIR/eptexdir/eptrip ++ export TEXMFCNF + +rm -rf eptripdir ++ rm -rf eptripdir +mkdir eptripdir ++ mkdir eptripdir +cd eptripdir ++ cd eptripdir + +dvitype_args="-output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'" ++ dvitype_args='-output-level=2 -dpi=72.27 -page-start='\''*.*.*.*.*.*.*.*.*.*'\''' + +echo ">>> Running e-TRIP test for e-pTeX." >&2 ++ echo '>>> Running e-TRIP test for e-pTeX.' +>>> Running e-TRIP test for e-pTeX. +echo ">>> See $eptestdir/eptrip.diffs for example of acceptable diffs." >&2 ++ echo '>>> See SRCDIR/eptexdir/eptrip/eptrip.diffs for example of acceptable diffs.' +>>> See SRCDIR/eptexdir/eptrip/eptrip.diffs for example of acceptable diffs. + +# pTeX outputs direction of boxes. +P_SED1='s/, yoko direction//;s/yoko direction, //' ++ P_SED1='s/, yoko direction//;s/yoko direction, //' +P_SED2='s/yoko(math) direction, //' ++ P_SED2='s/yoko(math) direction, //' + +is_OK=: ++ is_OK=: + +set -x ++ set -x + +echo "*** TRIP test for e-pTeX in compatibility mode ***." ++ echo '*** TRIP test for e-pTeX in compatibility mode ***.' +*** TRIP test for e-pTeX in compatibility mode ***. + +./pltotf $testdir/trip.pl trip.tfm || exit 1 ++ ./pltotf SRCDIR/triptrap/trip.pl trip.tfm + +./tftopl ./trip.tfm trip.pl || exit 1 ++ ./tftopl ./trip.tfm trip.pl + +diff $testdir/trip.pl trip.pl || is_OK=false ++ diff SRCDIR/triptrap/trip.pl trip.pl + +# get same filename in log +$LN_S $testdir/trip.tex . ++ ln -s SRCDIR/triptrap/trip.tex . + +rm -f trip.log ++ rm -f trip.log +./eptex --progname=epinitex --ini <$testdir/trip1.in >cptripin.fot ++ ./eptex --progname=epinitex --ini +if test ! -s trip.fmt; then + echo "*** trip.fmt not created by trip1.in, investigate!" >&2 + exit 1 +fi ++ test '!' -s trip.fmt +sed "$P_SED1" trip.log > cptripin.log || exit 1 ++ sed 's/, yoko direction//;s/yoko direction, //' trip.log +diff $testdir/tripin.log cptripin.log ++ diff SRCDIR/triptrap/tripin.log cptripin.log +1c1 +< This is TeX, Version 3.141592653 (INITEX) 4 JUL 1776 12:00 +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (INITEX) 27 JAN 2021 18:03 +3c3 +< (trip.tex +--- +> (./trip.tex +91c91,92 +< ### horizontal mode entered at line 77 (language255:hyphenmin1,63) +--- +> ### horizontal mode entered at line 77 (language255:hyph +> enmin1,63) +93a95 +> \displace 0.0 +95a98 +> \displace 0.0 +368a372 +> ....\displace 0.0 +370a375 +> ....\displace 0.0 +437,438d441 +< ....\rip 6 (ligature ) +< ....\rip 7 (ligature ) +450,453c453,456 +< (preloaded format=trip 1776.7.4) +< 1326 strings of total length 23633 +< 471 memory locations dumped; current usage is 96&278 +< 341 multiletter control sequences +--- +> (preloaded format=trip 2021.1.27) +> 1673 strings of total length 29297 +> 491 memory locations dumped; current usage is 112&278 +> 400 multiletter control sequences +461c464 +< Hyphenation trie of length 273 has 9 ops out of 500 +--- +> Hyphenation trie of length 273 has 9 ops out of 35111 + +# May as well test non-ini second time through. +rm -f trip.log ++ rm -f trip.log +./eptex --progname=eptex <$testdir/trip2.in >cptrip.fot ++ ./eptex --progname=eptex +sed "$P_SED1;$P_SED2" trip.log > cptrip.log ++ sed 's/, yoko direction//;s/yoko direction, //;s/yoko(math) direction, //' trip.log +diff $testdir/trip.fot cptrip.fot ++ diff SRCDIR/triptrap/trip.fot cptrip.fot +1,3c1,2 +< This is TeX, Version 3.141592653 (INITEX) +< ** &trip trip +< (trip.tex ## +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (preloaded format=eptex) +> **(./trip.tex ## +17c16 +< Memory usage before: 159&313; after: 102&278; still untouched: 1613 +--- +> Memory usage before: 196&313; after: 120&278; still untouched: 2109 +75c74 +< Memory usage before: 334&431; after: 292&418; still untouched: 175 +--- +> Memory usage before: 462&431; after: 400&418; still untouched: 240 + +# We use $DIFF instead of `diff' only for those files where there +# might actually be legitimate numerical differences. +$DIFF $DIFFFLAGS $testdir/trip.log cptrip.log ++ diff SRCDIR/triptrap/trip.log cptrip.log +1c1 +< This is TeX, Version 3.141592653 (preloaded format=trip 1776.7.4) 4 JUL 1776 12:00 +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (preloaded format=trip 2021.1.27) 27 JAN 2021 18:03 +3c3 +< (trip.tex ## +--- +> (./trip.tex ## +73c73 +< Memory usage before: 159&313; after: 102&278; still untouched: 1613 +--- +> Memory usage before: 196&313; after: 120&278; still untouched: 2109 +113a114 +> .\displace 0.0 +198a200 +> .\displace 0.0 +253a256 +> .\displace 0.0 +308a312 +> .\displace 0.0 +349a354 +> .\displace 0.0 +385,386c390,391 +< \insert100, natural size 803.09999; split(1.0 plus 43.0,-2.0); float cos +< t 100 +--- +> \insert100Y, natural size 803.09999; split(1.0 plus 43.0,-2.0); float co +> st 100 +406a412 +> ....\displace 0.0 +409a416 +> ....\displace 0.0 +412a420 +> ....\displace 0.0 +420a429 +> .\displace 0.0 +426c435 +< \insert200, natural size 400.0; split(0.0,-2.0); float cost 100 +--- +> \insert200Y, natural size 400.0; split(0.0,-2.0); float cost 100 +435a445 +> .\displace 0.0 +441c451 +< \insert200, natural size 400.0; split(1.0,-1.0); float cost 100 +--- +> \insert200Y, natural size 400.0; split(1.0,-1.0); float cost 100 +450a461 +> .\displace 0.0 +456c467 +< \insert200, natural size 400.0; split(2.0,-1.0); float cost 100 +--- +> \insert200Y, natural size 400.0; split(2.0,-1.0); float cost 100 +466a478 +> .\displace 0.0 +483,484c495,496 +< \insert200, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +< 3 +--- +> \insert200Y, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +> 3 +588a601 +> .....\displace 0.0 +591a605 +> .....\displace 0.0 +594a609 +> .....\displace 0.0 +630a646 +> ......\displace 0.0 +633a650 +> ......\displace 0.0 +636a654 +> ......\displace 0.0 +642c660 +< Memory usage before: 747&484; after: 581&481; still untouched: 1492 +--- +> Memory usage before: 1118&483; after: 864&480; still untouched: 1989 +647c665,666 +< ### internal vertical mode entered at line 150 (\output routine) +--- +> ### internal vertical mode entered at line 150 (\output +> routine) +650a670 +> .\displace 0.0 +660a681 +> .\displace 0.0 +670a692 +> .\displace 0.0 +681a704 +> .\displace 0.0 +693,694c716,717 +< \insert100, natural size 535.4; split(1.0 plus 43.0,-2.0); float cost 10 +< 0 +--- +> \insert100Y, natural size 535.4; split(1.0 plus 43.0,-2.0); float cost 1 +> 00 +701c724 +< \insert200, natural size 2.0; split(2.0,-1.0); float cost 100 +--- +> \insert200Y, natural size 2.0; split(2.0,-1.0); float cost 100 +714,715c737,738 +< \insert200, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +< 3 +--- +> \insert200Y, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +> 3 +815c838 +< Memory usage before: 475&470; after: 290&466; still untouched: 1473 +--- +> Memory usage before: 710&469; after: 418&465; still untouched: 1970 +820c843,844 +< ### internal vertical mode entered at line 150 (\output routine) +--- +> ### internal vertical mode entered at line 150 (\output +> routine) +915c939 +< Memory usage before: 218&459; after: 149&458; still untouched: 1473 +--- +> Memory usage before: 308&458; after: 198&457; still untouched: 1970 +920c944,945 +< ### internal vertical mode entered at line 150 (\output routine) +--- +> ### internal vertical mode entered at line 150 (\output +> routine) +1070c1095 +< Memory usage before: 118&328; after: 102&328; still untouched: 1473 +--- +> Memory usage before: 150&327; after: 126&327; still untouched: 1970 +1405c1430 +< \vbox(16383.99998+0.0)x1000.0, glue set 16342.0fil +--- +> \vbox(16383.99998+0.0)x1000.0, glue set 16341.99998fil +1493a1519 +> ..\displace 0.0 +1503a1530 +> ..\displace 0.0 +1504a1532 +> ..\displace 0.0 +1511c1539 +< Memory usage before: 990&376; after: 584&370; still untouched: 735 +--- +> Memory usage before: 1498&375; after: 846&369; still untouched: 1970 +1887c1915 +< .\rip A +--- +> .\displace 0.0 +1923c1951 +< .\hbox(0.0+0.0)x120.0 [] +--- +> .\hbox(0.0+0.0)x120.0, yoko(math) direction [] +1954c1982 +< (tripos.tex +--- +> (./tripos.tex +2018c2046 +< \vbox(16383.99998+1.0)x100.0, glue set 16239.0fil +--- +> \vbox(16383.99998+1.0)x100.0, glue set 16238.99998fil +2022a2051 +> ..\displace 0.0 +2058a2088 +> ..\displace 0.0 +2071a2102 +> ..\displace 0.0 +2092a2124 +> ..\displace 0.0 +2113a2146 +> ..\displace 0.0 +2123a2157 +> ..\displace 0.0 +2142a2177 +> ..\displace 0.0 +2150a2186 +> ..\displace 0.0 +2171c2207,2208 +< ..\hbox(0.0+0.0)x120.0 +--- +> ..\hbox(0.0+0.0)x120.0, yoko(math) direction +> ...\displace 0.0 +2189c2226 +< Memory usage before: 950&531; after: 546&448; still untouched: 706 +--- +> Memory usage before: 1494&530; after: 826&447; still untouched: 1941 +2397c2434 +< ! Improper alphabetic constant. +--- +> ! Improper alphabetic or KANJI constant. +2533c2570 +< \vbox(16383.99998+0.0)x20.0, glue set 16331.0fil +--- +> \vbox(16383.99998+0.0)x20.0, glue set 16330.99998fil +2544a2582 +> ..\displace 0.0 +2570c2608,2609 +< .\hbox(0.0+0.0)x15.0, glue set 0.1875, shifted 5.0 +--- +> .\hbox(0.0+0.0)x15.0, glue set 0.1875, shifted 5.0, yoko(math) direction +> +2572c2611 +< ..\hbox(0.0+0.0)x0.0 +--- +> ..\hbox(0.0+0.0)x0.0, yoko(math) direction +2575c2614 +< Memory usage before: 339&413; after: 236&405; still untouched: 706 +--- +> Memory usage before: 497&411; after: 329&403; still untouched: 1941 +2650,2651c2689,2690 +< Dimensions can be in units of em, ex, in, pt, pc, +< cm, mm, dd, cc, bp, or sp; but yours is a new one! +--- +> Dimensions can be in units of em, ex, zw, zh, in, pt, pc, +> cm, mm, dd, cc, bp, H, Q, or sp; but yours is a new one! +2830c2869 +< Since I expected to read a number between 0 and 15, +--- +> Since I expected to read a number between 0 and 255, +3038c3077,3078 +< ^\hbox(7.0+1.0)x2.0 +--- +> ^\hbox(7.0+1.0)x2.0, yoko(math) direction +> ^.\displace 0.0 +3051c3091 +< \insert0, natural size 0.0; split(1.0 plus 43.0,-2.0); float cost 100 +--- +> \insert0Y, natural size 0.0; split(1.0 plus 43.0,-2.0); float cost 100 +3054c3094 +< .\fam0 ^^c8 +--- +> .\fam0 È +3056c3096 +< .\vbox(-2.0+0.0)x0.0 +--- +> .\vbox(-2.0+0.0)x0.0, yoko(math) direction +3060c3100,3101 +< ^.\hbox(7.0+1.0)x2.0, shifted -2.0 +--- +> ^.\hbox(7.0+1.0)x2.0, shifted -2.0, yoko(math) direction +> ^..\displace 0.0 +3140a3182 +> .....\displace 0.0 +3142a3185 +> ....|\displace 0.0 +3143a3187 +> ....\displace 0.0 +3151a3196 +> .\displace 0.0 +3235c3280 +< ! \textfont 0 is undefined (character ^^c8). +--- +> ! \textfont 0 is undefined (character È). +3286c3331 +< .\vbox(6.0+-8.0)x0.0 +--- +> .\vbox(6.0+-8.0)x0.0, yoko(math) direction +3326c3371 +< \vbox(10000.0+2.0)x28.0, glue set 9737.58789fil +--- +> \vbox(10000.0+2.0)x28.0, glue set 9737.58742fil +3329a3375 +> ..\displace 0.0 +3374c3420 +< ..\vbox(6.0+-8.0)x0.0 +--- +> ..\vbox(6.0+-8.0)x0.0, yoko(math) direction +3385c3431,3432 +< ......\hbox(7.0+1.0)x2.0, shifted -2.0 +--- +> ......\hbox(7.0+1.0)x2.0, shifted -2.0, yoko(math) direction +> .......\displace 0.0 +3544a3592 +> ..........\displace 0.0 +3546a3595 +> .........|\displace 0.0 +3547a3597 +> .........\displace 0.0 +3564c3614,3615 +< ...\hbox(7.0+1.0)x1.99 +--- +> ...\hbox(7.0+1.0)x1.99, yoko(math) direction +> ....\displace 0.0 +3616c3667 +< Memory usage before: 2170&521; after: 1181&459; still untouched: 175 +--- +> Memory usage before: 3283&519; after: 1753&457; still untouched: 240 +3864c3915 +< \vbox(16383.99998+2.0)x100.0, glue set 16318.0fil +--- +> \vbox(16383.99998+2.0)x100.0, glue set 16317.99997fil +3919,3920c3970,3972 +< ...\vbox(-0.00002+13.00002)x52.5, glue set - 0.00247 +< ....\vbox(-0.00002+0.0)x0.0 +--- +> ...\vbox(-0.00002+13.00002)x52.5, glue set - 0.00247, yoko(math) directi +> on +> ....\vbox(-0.00002+0.0)x0.0, yoko(math) direction +3951c4003 +< Memory usage before: 640&415; after: 397&410; still untouched: 175 +--- +> Memory usage before: 959&413; after: 573&408; still untouched: 240 +4034c4086 +< \vbox(16383.99998+0.0)x8236.0, glue set 16344.0fil +--- +> \vbox(16383.99998+0.0)x8236.0, glue set 16343.99998fil +4053c4105 +< Memory usage before: 235&401; after: 178&399; still untouched: 175 +--- +> Memory usage before: 342&399; after: 248&397; still untouched: 240 +4420c4472 +< \vbox(16383.99998+0.0)x100.0, glue set 16332.0fil +--- +> \vbox(16383.99998+0.0)x100.0, glue set 16331.99998fil +4425a4478 +> ...\displace 0.0 +4447a4501 +> ...\displace 0.0 +4475a4530 +> ...\displace 0.0 +4492a4548 +> ...\displace 0.0 +4506c4562 +< Memory usage before: 651&432; after: 417&418; still untouched: 175 +--- +> Memory usage before: 1008&431; after: 606&417; still untouched: 240 +4742c4798,4799 +< \vbox(16383.99998+0.0)x205.12613, glue set 16344.0fil +--- +> \vbox(16383.99998+0.0)x205.12613, glue set 16343.99998fil, yoko directio +> n +4746a4804 +> ...\displace 0.0 +4762a4821 +> .....\displace 0.0 +4777a4837 +> ......\displace 0.0 +4828c4888 +< Memory usage before: 776&458; after: 464&452; still untouched: 175 +--- +> Memory usage before: 1186&457; after: 682&451; still untouched: 240 +4881,4888d4940 +< ! Bad number (16). +< +< = +< l.346 ...ewlinechar}\textfont16= +< \relax +< Since I expected to read a number between 0 and 15, +< I changed this one to zero. +< +5701c5753 +< ! \textfont 0 is undefined (character ^^c8). +--- +> ! \textfont 0 is undefined (character È). +6381c6433 +< (tripos.tex +--- +> (./tripos.tex +6502c6554 +< l.429 ...^^M=13 \def^^M{\relax}# +--- +> l.429 ...^^M=13 \defqqM{\relax}# +6596c6648 +< Memory usage before: 819&428; after: 720&426; still untouched: 175 +--- +> Memory usage before: 1232&428; after: 1078&426; still untouched: 240 +6853c6905 +< .|vbox(0.0+0.0)x0.0 +--- +> .|vbox(0.0+0.0)x0.0, yoko(math) direction +6876a6929 +> ..|displace 0.0 +6891a6945 +> ..|displace 0.0 +6926a6981 +> .|displace 0.0 +6959a7015 +> .|displace 0.0 +6961c7017,7018 +< .|hbox(0.0+0.0)x0.0 +--- +> .|hbox(0.0+0.0)x0.0, yoko(math) direction +> ..|displace 0.0 +6991a7049 +> .|displace 0.0 +7103a7162 +> ...|displace 0.0 +7108d7166 +< ...|ip A (ligature BB) +7116a7175 +> ...|displace 0.0 +7125d7183 +< ...|kern2.0 +7126a7185 +> .|displace 0.0 +7136c7195 +< ...|vbox(0.0+0.0)x0.0 +--- +> ...|vbox(0.0+0.0)x0.0, yoko(math) direction +7156c7215 +< Memory usage before: 895&439; after: 290&420; still untouched: 175 +--- +> Memory usage before: 1350&439; after: 398&420; still untouched: 240 +7289c7348 +< Memory usage before: 334&431; after: 292&418; still untouched: 175 +--- +> Memory usage before: 462&431; after: 400&418; still untouched: 240 +7297,7300c7356,7359 +< 47 strings out of 1674 +< 253 string characters out of 8367 +< 2825 words of memory out of 3000 +< 372 multiletter control sequences out of 2100 +--- +> 44 strings out of 1627 +> 261 string characters out of 10703 +> 4260 words of memory out of 4500 +> 431 multiletter control sequences out of 15000+0 +7302c7361 +< 2 hyphenation exceptions out of 307 +--- +> 1 hyphenation exception out of 659 + +mv tripos.tex cptripos.tex ++ mv tripos.tex cptripos.tex +diff $testdir/tripos.tex cptripos.tex ++ diff SRCDIR/triptrap/tripos.tex cptripos.tex + +eval ./dvitype $dvitype_args trip.dvi >cptrip.typ || exit 1 ++ eval ./dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' trip.dvi +./dvitype -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*' trip.dvi +++ ./dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' trip.dvi +$DIFF $DIFFFLAGS $testdir/trip.typ cptrip.typ ++ diff SRCDIR/triptrap/trip.typ cptrip.typ +1c1 +< This is DVItype, Version 3.6 +--- +> This is DVItype, Version 3.6 (TeX Live 2021/dev) +9c9 +< ' TeX output 1776.07.04:1200' +--- +> ' TeX output 2021.01.27:1803' +419c419 +< 1121: down4 639342208 +--- +> 1121: down4 639342177 +1087,1088c1087,1088 +< 2535: y4 203921760 +< 2540: y0 203921760 +--- +> 2535: y4 203921756 +> 2540: y0 203921756 + +mv trip.fmt ctrip.fmt ++ mv trip.fmt ctrip.fmt + +# ================================= + +echo "*** TRIP test for e-pTeX in extended mode ***." ++ echo '*** TRIP test for e-pTeX in extended mode ***.' +*** TRIP test for e-pTeX in extended mode ***. + +rm -f trip.log ++ rm -f trip.log +./eptex --progname=epinitex --ini <$etestdir/etrip1.in >xptripin.fot ++ ./eptex --progname=epinitex --ini +if test ! -s trip.fmt; then + echo "*** trip.fmt not created by etrip1.in, investigate!" >&2 + exit 1 +fi ++ test '!' -s trip.fmt +sed "$P_SED1" trip.log > xptripin.log || exit 1 ++ sed 's/, yoko direction//;s/yoko direction, //' trip.log +diff $testdir/tripin.log xptripin.log ++ diff SRCDIR/triptrap/tripin.log xptripin.log +1,3c1,4 +< This is TeX, Version 3.141592653 (INITEX) 4 JUL 1776 12:00 +< **\input trip +< (trip.tex +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (INITEX) 27 JAN 2021 18:03 +> entering extended mode +> ***\input trip +> (./trip.tex +36,41d36 +< ! Bad register code (256). +< l.29 ...{1} \toksdef\tokens=256 +< \show\errorstopmode +< A register number must be between 0 and 255. +< I changed this one to zero. +< +91c86,87 +< ### horizontal mode entered at line 77 (language255:hyphenmin1,63) +--- +> ### horizontal mode entered at line 77 (language255:hyph +> enmin1,63) +93a90 +> \displace 0.0 +95a93 +> \displace 0.0 +368a367 +> ....\displace 0.0 +370a370 +> ....\displace 0.0 +437,438d436 +< ....\rip 6 (ligature ) +< ....\rip 7 (ligature ) +450,453c448,451 +< (preloaded format=trip 1776.7.4) +< 1326 strings of total length 23633 +< 471 memory locations dumped; current usage is 96&278 +< 341 multiletter control sequences +--- +> (preloaded format=trip 2021.1.27) +> 1673 strings of total length 29297 +> 538 memory locations dumped; current usage is 159&278 +> 494 multiletter control sequences +461c459 +< Hyphenation trie of length 273 has 9 ops out of 500 +--- +> Hyphenation trie of length 273 has 9 ops out of 35111 + +# May as well test non-ini second time through. +rm -f trip.log ++ rm -f trip.log +./eptex --progname=eptex <$etestdir/trip2.in >xptrip.fot ++ ./eptex --progname=eptex +sed "$P_SED1;$P_SED2" trip.log > xptrip.log ++ sed 's/, yoko direction//;s/yoko direction, //;s/yoko(math) direction, //' trip.log +diff $testdir/trip.fot xptrip.fot ++ diff SRCDIR/triptrap/trip.fot xptrip.fot +1,3c1,3 +< This is TeX, Version 3.141592653 (INITEX) +< ** &trip trip +< (trip.tex ## +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (preloaded format=eptex) +> **entering extended mode +> ## (./trip.tex +17c17 +< Memory usage before: 159&313; after: 102&278; still untouched: 1613 +--- +> Memory usage before: 196&313; after: 120&278; still untouched: 2109 +75c75 +< Memory usage before: 334&431; after: 292&418; still untouched: 175 +--- +> Memory usage before: 462&431; after: 400&418; still untouched: 240 +77a78,80 +> +> ### semi simple group (level 1) entered at line 429 (begingroup) +> ### bottom level + +# We use $DIFF instead of `diff' only for those files where there +# might actually be legitimate numerical differences. +$DIFF $DIFFFLAGS $testdir/trip.log xptrip.log ++ diff SRCDIR/triptrap/trip.log xptrip.log +1,3c1,4 +< This is TeX, Version 3.141592653 (preloaded format=trip 1776.7.4) 4 JUL 1776 12:00 +< ** &trip trip +< (trip.tex ## +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (preloaded format=trip 2021.1.27) 27 JAN 2021 18:03 +> entering extended mode +> **&trip \toksdef\tokens=0 \input trip +> (./trip.tex +73c74 +< Memory usage before: 159&313; after: 102&278; still untouched: 1613 +--- +> Memory usage before: 196&313; after: 120&278; still untouched: 2109 +113a115 +> .\displace 0.0 +198a201 +> .\displace 0.0 +253a257 +> .\displace 0.0 +308a313 +> .\displace 0.0 +349a355 +> .\displace 0.0 +385,386c391,392 +< \insert100, natural size 803.09999; split(1.0 plus 43.0,-2.0); float cos +< t 100 +--- +> \insert100Y, natural size 803.09999; split(1.0 plus 43.0,-2.0); float co +> st 100 +406a413 +> ....\displace 0.0 +409a417 +> ....\displace 0.0 +412a421 +> ....\displace 0.0 +420a430 +> .\displace 0.0 +426c436 +< \insert200, natural size 400.0; split(0.0,-2.0); float cost 100 +--- +> \insert200Y, natural size 400.0; split(0.0,-2.0); float cost 100 +435a446 +> .\displace 0.0 +441c452 +< \insert200, natural size 400.0; split(1.0,-1.0); float cost 100 +--- +> \insert200Y, natural size 400.0; split(1.0,-1.0); float cost 100 +450a462 +> .\displace 0.0 +456c468 +< \insert200, natural size 400.0; split(2.0,-1.0); float cost 100 +--- +> \insert200Y, natural size 400.0; split(2.0,-1.0); float cost 100 +466a479 +> .\displace 0.0 +483,484c496,497 +< \insert200, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +< 3 +--- +> \insert200Y, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +> 3 +588a602 +> .....\displace 0.0 +591a606 +> .....\displace 0.0 +594a610 +> .....\displace 0.0 +630a647 +> ......\displace 0.0 +633a651 +> ......\displace 0.0 +636a655 +> ......\displace 0.0 +642c661 +< Memory usage before: 747&484; after: 581&481; still untouched: 1492 +--- +> Memory usage before: 1118&483; after: 864&480; still untouched: 1989 +647c666,667 +< ### internal vertical mode entered at line 150 (\output routine) +--- +> ### internal vertical mode entered at line 150 (\output +> routine) +650a671 +> .\displace 0.0 +660a682 +> .\displace 0.0 +670a693 +> .\displace 0.0 +681a705 +> .\displace 0.0 +693,694c717,718 +< \insert100, natural size 535.4; split(1.0 plus 43.0,-2.0); float cost 10 +< 0 +--- +> \insert100Y, natural size 535.4; split(1.0 plus 43.0,-2.0); float cost 1 +> 00 +701c725 +< \insert200, natural size 2.0; split(2.0,-1.0); float cost 100 +--- +> \insert200Y, natural size 2.0; split(2.0,-1.0); float cost 100 +714,715c738,739 +< \insert200, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +< 3 +--- +> \insert200Y, natural size 10000.0; split(1.0 plus 43.0,-1.0); float cost +> 3 +815c839 +< Memory usage before: 475&470; after: 290&466; still untouched: 1473 +--- +> Memory usage before: 710&469; after: 418&465; still untouched: 1970 +820c844,845 +< ### internal vertical mode entered at line 150 (\output routine) +--- +> ### internal vertical mode entered at line 150 (\output +> routine) +915c940 +< Memory usage before: 218&459; after: 149&458; still untouched: 1473 +--- +> Memory usage before: 308&458; after: 198&457; still untouched: 1970 +920c945,946 +< ### internal vertical mode entered at line 150 (\output routine) +--- +> ### internal vertical mode entered at line 150 (\output +> routine) +1070c1096 +< Memory usage before: 118&328; after: 102&328; still untouched: 1473 +--- +> Memory usage before: 150&327; after: 126&327; still untouched: 1970 +1405c1431 +< \vbox(16383.99998+0.0)x1000.0, glue set 16342.0fil +--- +> \vbox(16383.99998+0.0)x1000.0, glue set 16341.99998fil +1493a1520 +> ..\displace 0.0 +1503a1531 +> ..\displace 0.0 +1504a1533 +> ..\displace 0.0 +1511c1540 +< Memory usage before: 990&376; after: 584&370; still untouched: 735 +--- +> Memory usage before: 1498&375; after: 846&369; still untouched: 1970 +1769d1797 +< {restoring \fam=-1} +1779d1806 +< {restoring \displayindent=0.0pt} +1833d1859 +< {restoring \fam=-1} +1887c1913 +< .\rip A +--- +> .\displace 0.0 +1923c1949 +< .\hbox(0.0+0.0)x120.0 [] +--- +> .\hbox(0.0+0.0)x120.0, yoko(math) direction [] +1954c1980 +< (tripos.tex +--- +> (./tripos.tex +2018c2044 +< \vbox(16383.99998+1.0)x100.0, glue set 16239.0fil +--- +> \vbox(16383.99998+1.0)x100.0, glue set 16238.99998fil +2022a2049 +> ..\displace 0.0 +2058a2086 +> ..\displace 0.0 +2071a2100 +> ..\displace 0.0 +2092a2122 +> ..\displace 0.0 +2113a2144 +> ..\displace 0.0 +2123a2155 +> ..\displace 0.0 +2135c2167 +< .\hbox(0.0+0.0)x0.0, shifted 50.0 +--- +> .\hbox(0.0+0.0)x0.0, shifted 50.0, display +2138c2170 +< .\hbox(0.0+0.0)x0.0, shifted 100.0 +--- +> .\hbox(0.0+0.0)x0.0, shifted 100.0, display +2142a2175 +> ..\displace 0.0 +2150a2184 +> ..\displace 0.0 +2171c2205,2206 +< ..\hbox(0.0+0.0)x120.0 +--- +> ..\hbox(0.0+0.0)x120.0, yoko(math) direction +> ...\displace 0.0 +2189c2224 +< Memory usage before: 950&531; after: 546&448; still untouched: 706 +--- +> Memory usage before: 1494&530; after: 826&447; still untouched: 1941 +2397c2432 +< ! Improper alphabetic constant. +--- +> ! Improper alphabetic or KANJI constant. +2533c2568 +< \vbox(16383.99998+0.0)x20.0, glue set 16331.0fil +--- +> \vbox(16383.99998+0.0)x20.0, glue set 16330.99998fil +2544a2580 +> ..\displace 0.0 +2570c2606,2607 +< .\hbox(0.0+0.0)x15.0, glue set 0.1875, shifted 5.0 +--- +> .\hbox(0.0+0.0)x15.0, glue set 0.1875, shifted 5.0, display, yoko(math) +> direction +2572c2609 +< ..\hbox(0.0+0.0)x0.0 +--- +> ..\hbox(0.0+0.0)x0.0, yoko(math) direction +2575c2612 +< Memory usage before: 339&413; after: 236&405; still untouched: 706 +--- +> Memory usage before: 497&411; after: 329&403; still untouched: 1941 +2650,2651c2687,2688 +< Dimensions can be in units of em, ex, in, pt, pc, +< cm, mm, dd, cc, bp, or sp; but yours is a new one! +--- +> Dimensions can be in units of em, ex, zw, zh, in, pt, pc, +> cm, mm, dd, cc, bp, H, Q, or sp; but yours is a new one! +2830c2867 +< Since I expected to read a number between 0 and 15, +--- +> Since I expected to read a number between 0 and 255, +2835d2871 +< {restoring current font=\ip} +3038c3074,3075 +< ^\hbox(7.0+1.0)x2.0 +--- +> ^\hbox(7.0+1.0)x2.0, yoko(math) direction +> ^.\displace 0.0 +3051c3088 +< \insert0, natural size 0.0; split(1.0 plus 43.0,-2.0); float cost 100 +--- +> \insert0Y, natural size 0.0; split(1.0 plus 43.0,-2.0); float cost 100 +3054c3091 +< .\fam0 ^^c8 +--- +> .\fam0 È +3056c3093 +< .\vbox(-2.0+0.0)x0.0 +--- +> .\vbox(-2.0+0.0)x0.0, yoko(math) direction +3060c3097,3098 +< ^.\hbox(7.0+1.0)x2.0, shifted -2.0 +--- +> ^.\hbox(7.0+1.0)x2.0, shifted -2.0, yoko(math) direction +> ^..\displace 0.0 +3140a3179 +> .....\displace 0.0 +3142a3182 +> ....|\displace 0.0 +3143a3184 +> ....\displace 0.0 +3151a3193 +> .\displace 0.0 +3223d3264 +< {restoring \fam=-1} +3235c3276 +< ! \textfont 0 is undefined (character ^^c8). +--- +> ! \textfont 0 is undefined (character È). +3286c3327 +< .\vbox(6.0+-8.0)x0.0 +--- +> .\vbox(6.0+-8.0)x0.0, yoko(math) direction +3326c3367 +< \vbox(10000.0+2.0)x28.0, glue set 9737.58789fil +--- +> \vbox(10000.0+2.0)x28.0, glue set 9737.58742fil +3329a3371 +> ..\displace 0.0 +3372c3414 +< .\hbox(68.26251+98.15005)x19.0, glue set - 1.0, shifted 9.0 +--- +> .\hbox(68.26251+98.15005)x19.0, glue set - 1.0, shifted 9.0, display +3374c3416 +< ..\vbox(6.0+-8.0)x0.0 +--- +> ..\vbox(6.0+-8.0)x0.0, yoko(math) direction +3385c3427,3428 +< ......\hbox(7.0+1.0)x2.0, shifted -2.0 +--- +> ......\hbox(7.0+1.0)x2.0, shifted -2.0, yoko(math) direction +> .......\displace 0.0 +3544a3588 +> ..........\displace 0.0 +3546a3591 +> .........|\displace 0.0 +3547a3593 +> .........\displace 0.0 +3557c3603 +< .\hbox(20.5+50.80002)x8.27895, shifted 19.72105 +--- +> .\hbox(20.5+50.80002)x8.27895, shifted 19.72105, display +3564c3610,3611 +< ...\hbox(7.0+1.0)x1.99 +--- +> ...\hbox(7.0+1.0)x1.99, yoko(math) direction +> ....\displace 0.0 +3616c3663 +< Memory usage before: 2170&521; after: 1181&459; still untouched: 175 +--- +> Memory usage before: 3283&519; after: 1753&457; still untouched: 240 +3766d3812 +< {restoring \fam=-1} +3839d3884 +< {restoring \fam=-1} +3864c3909 +< \vbox(16383.99998+2.0)x100.0, glue set 16318.0fil +--- +> \vbox(16383.99998+2.0)x100.0, glue set 16317.99997fil +3895c3940 +< ..\hbox(12.0+4.0)x8.1778 +--- +> ..\hbox(12.0+4.0)x8.1778, display +3917c3962 +< ..\hbox(0.0+13.00002)x-0.1778, glue set - 57.67767fil +--- +> ..\hbox(0.0+13.00002)x-0.1778, glue set - 57.67767fil, display +3919,3920c3964,3966 +< ...\vbox(-0.00002+13.00002)x52.5, glue set - 0.00247 +< ....\vbox(-0.00002+0.0)x0.0 +--- +> ...\vbox(-0.00002+13.00002)x52.5, glue set - 0.00247, yoko(math) directi +> on +> ....\vbox(-0.00002+0.0)x0.0, yoko(math) direction +3925c3971 +< ....\hbox(7.0+1.0)x5.0, shifted 47.5 +--- +> ....\hbox(7.0+1.0)x5.0, shifted 47.5, display +3951c3997 +< Memory usage before: 640&415; after: 397&410; still untouched: 175 +--- +> Memory usage before: 959&413; after: 573&408; still untouched: 240 +4011d4056 +< {restoring \fam=-1} +4034c4079 +< \vbox(16383.99998+0.0)x8236.0, glue set 16344.0fil +--- +> \vbox(16383.99998+0.0)x8236.0, glue set 16343.99998fil +4047c4092 +< .\hbox(0.0+0.0)x1009.0, shifted 7227.0 +--- +> .\hbox(0.0+0.0)x1009.0, shifted 7227.0, display +4051c4096 +< .\hbox(0.0+0.0)x-7127.0, shifted 7227.0 +--- +> .\hbox(0.0+0.0)x-7127.0, shifted 7227.0, display +4053c4098 +< Memory usage before: 235&401; after: 178&399; still untouched: 175 +--- +> Memory usage before: 342&399; after: 248&397; still untouched: 240 +4420c4465 +< \vbox(16383.99998+0.0)x100.0, glue set 16332.0fil +--- +> \vbox(16383.99998+0.0)x100.0, glue set 16331.99998fil +4425a4471 +> ...\displace 0.0 +4447a4494 +> ...\displace 0.0 +4475a4523 +> ...\displace 0.0 +4492a4541 +> ...\displace 0.0 +4506c4555 +< Memory usage before: 651&432; after: 417&418; still untouched: 175 +--- +> Memory usage before: 1008&431; after: 606&417; still untouched: 240 +4742c4791,4792 +< \vbox(16383.99998+0.0)x205.12613, glue set 16344.0fil +--- +> \vbox(16383.99998+0.0)x205.12613, glue set 16343.99998fil, yoko directio +> n +4746a4797 +> ...\displace 0.0 +4762a4814 +> .....\displace 0.0 +4777a4830 +> ......\displace 0.0 +4828c4881 +< Memory usage before: 776&458; after: 464&452; still untouched: 175 +--- +> Memory usage before: 1186&457; after: 682&451; still untouched: 240 +4845c4898 +< I'll pretend you didn't say \long or \outer or \global. +--- +> I'll pretend you didn't say \long or \outer or \global or \protected. +4881,4888d4933 +< ! Bad number (16). +< +< = +< l.346 ...ewlinechar}\textfont16= +< \relax +< Since I expected to read a number between 0 and 15, +< I changed this one to zero. +< +5701c5746 +< ! \textfont 0 is undefined (character ^^c8). +--- +> ! \textfont 0 is undefined (character È). +6381c6426 +< (tripos.tex +--- +> (./tripos.tex +6502c6547 +< l.429 ...^^M=13 \def^^M{\relax}# +--- +> l.429 ...^^M=13 \defqqM{\relax}# +6596c6641 +< Memory usage before: 819&428; after: 720&426; still untouched: 175 +--- +> Memory usage before: 1232&428; after: 1078&426; still untouched: 240 +6853c6898 +< .|vbox(0.0+0.0)x0.0 +--- +> .|vbox(0.0+0.0)x0.0, yoko(math) direction +6876a6922 +> ..|displace 0.0 +6891a6938 +> ..|displace 0.0 +6926a6974 +> .|displace 0.0 +6959a7008 +> .|displace 0.0 +6961c7010,7011 +< .|hbox(0.0+0.0)x0.0 +--- +> .|hbox(0.0+0.0)x0.0, yoko(math) direction +> ..|displace 0.0 +6991a7042 +> .|displace 0.0 +7103a7155 +> ...|displace 0.0 +7108d7159 +< ...|ip A (ligature BB) +7116a7168 +> ...|displace 0.0 +7125d7176 +< ...|kern2.0 +7126a7178 +> .|displace 0.0 +7136c7188 +< ...|vbox(0.0+0.0)x0.0 +--- +> ...|vbox(0.0+0.0)x0.0, yoko(math) direction +7156c7208 +< Memory usage before: 895&439; after: 290&420; still untouched: 175 +--- +> Memory usage before: 1350&439; after: 398&420; still untouched: 240 +7289c7341 +< Memory usage before: 334&431; after: 292&418; still untouched: 175 +--- +> Memory usage before: 462&431; after: 400&418; still untouched: 240 +7292a7345,7347 +> +> ### semi simple group (level 1) entered at line 429 (begingroup) +> ### bottom level +7297,7300c7352,7355 +< 47 strings out of 1674 +< 253 string characters out of 8367 +< 2825 words of memory out of 3000 +< 372 multiletter control sequences out of 2100 +--- +> 44 strings out of 1627 +> 261 string characters out of 10703 +> 4260 words of memory out of 4500 +> 525 multiletter control sequences out of 15000+0 +7302,7303c7357,7358 +< 2 hyphenation exceptions out of 307 +< 7i,7n,9p,113b,38s stack positions out of 200i,40n,60p,500b,600s +--- +> 1 hyphenation exception out of 659 +> 7i,7n,9p,136b,40s stack positions out of 200i,40n,60p,500b,600s + +mv tripos.tex xptripos.tex ++ mv tripos.tex xptripos.tex +diff $testdir/tripos.tex xptripos.tex ++ diff SRCDIR/triptrap/tripos.tex xptripos.tex + +eval ./dvitype $dvitype_args trip.dvi >xptrip.typ || exit 1 ++ eval ./dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' trip.dvi +./dvitype -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*' trip.dvi +++ ./dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' trip.dvi +$DIFF $DIFFFLAGS $testdir/trip.typ xptrip.typ ++ diff SRCDIR/triptrap/trip.typ xptrip.typ +1c1 +< This is DVItype, Version 3.6 +--- +> This is DVItype, Version 3.6 (TeX Live 2021/dev) +9c9 +< ' TeX output 1776.07.04:1200' +--- +> ' TeX output 2021.01.27:1803' +419c419 +< 1121: down4 639342208 +--- +> 1121: down4 639342177 +1087,1088c1087,1088 +< 2535: y4 203921760 +< 2540: y0 203921760 +--- +> 2535: y4 203921756 +> 2540: y0 203921756 + +mv trip.fmt xtrip.fmt ++ mv trip.fmt xtrip.fmt + +# ================================= + +echo "*** e-TeX specific part of e-TRIP test for e-pTeX ***." ++ echo '*** e-TeX specific part of e-TRIP test for e-pTeX ***.' +*** e-TeX specific part of e-TRIP test for e-pTeX ***. + +./pltotf $etestdir/etrip.pl etrip.tfm || exit 1 ++ ./pltotf SRCDIR/etexdir/etrip/etrip.pl etrip.tfm + +./tftopl ./etrip.tfm etrip.pl || exit 1 ++ ./tftopl ./etrip.tfm etrip.pl + +diff $etestdir/etrip.pl etrip.pl || is_OK=false ++ diff SRCDIR/etexdir/etrip/etrip.pl etrip.pl + +# get same filename in log +$LN_S $eptestdir/eptrip.tex etrip.tex ++ ln -s SRCDIR/eptexdir/eptrip/eptrip.tex etrip.tex + +./eptex --progname=epinitex --ini <$etestdir/etrip2.in >eptripin.fot ++ ./eptex --progname=epinitex --ini +if test ! -s etrip.fmt; then + echo "*** etrip.fmt not created by etrip2.in, investigate!" >&2 + exit 1 +fi ++ test '!' -s etrip.fmt +sed "$P_SED1" etrip.log > eptripin.log || exit 1 ++ sed 's/, yoko direction//;s/yoko direction, //' etrip.log +diff $etestdir/etripin.log eptripin.log ++ diff SRCDIR/etexdir/etrip/etripin.log eptripin.log +1c1 +< This is e-TeX, Version 3.14159265-2.6 (TeX Live 2014) (INITEX) 22 JAN 2014 11:25 +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (INITEX) 27 JAN 2021 18:03 +26,29c26,29 +< (preloaded format=etrip 2014.1.22) +< 1491 strings of total length 26258 +< 281 memory locations dumped; current usage is 36&167 +< 408 multiletter control sequences +--- +> (preloaded format=etrip 2021.1.27) +> 1674 strings of total length 29328 +> 284 memory locations dumped; current usage is 40&167 +> 494 multiletter control sequences + +# May as well test non-ini second time through. +./eptex --progname=eptex <$etestdir/etrip3.in >eptrip.fot ++ ./eptex --progname=eptex +sed "$P_SED1;$P_SED2" etrip.log > eptrip.log ++ sed 's/, yoko direction//;s/yoko direction, //;s/yoko(math) direction, //' etrip.log +diff $etestdir/etrip.fot eptrip.fot ++ diff SRCDIR/etexdir/etrip/etrip.fot eptrip.fot +1c1 +< This is e-TeX, Version 3.14159265-2.6 (TeX Live 2014) (preloaded format=etex) +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (preloaded format=eptex) +45,46d44 +< +< \openout1 = `etrip.out'. + +# We use $DIFF instead of `diff' only for those files where there +# might actually be legitimate numerical differences. +$DIFF $DIFFFLAGS $eptestdir/eptrip.log eptrip.log ++ diff SRCDIR/eptexdir/eptrip/eptrip.log eptrip.log +1c1 +< This is e-pTeX, Version 3.14159265-p3.4-130605-2.6 (utf8.euc) (TeX Live 2014) (preloaded format=etrip 2014.1.22) 22 JAN 2014 11:25 +--- +> This is e-pTeX, Version 3.141592653-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2021/dev) (preloaded format=etrip 2021.1.27) 27 JAN 2021 18:03 +57a58 +> .\displace 0.0 +104a106 +> .\displace 0.0 +133a136 +> .\displace 0.0 +193a197 +> .\displace 0.0 +205a210 +> ..\displace 0.0 +253a259 +> ..\displace 0.0 +283a290 +> ..\displace 0.0 +303a311 +> ..\displace 0.0 +692,693d699 +< \openout1 = `etrip.out'. +< +1426c1432 +< this will be denominator of: +--- +> this will begin denominator of: +1450c1456 +< this will be denominator of: +--- +> this will begin denominator of: +1497c1503 +< this will be denominator of: +--- +> this will begin denominator of: +1545c1551 +< this will be denominator of: +--- +> this will begin denominator of: +1662a1669 +> \displace 0.0 +1873a1881 +> \displace 0.0 +1881c1889 +< .\hbox(0.0+0.0)x0.0, shifted -16.5 +--- +> .\hbox(0.0+0.0)x0.0, shifted -16.5, yoko(math) direction +1901a1910 +> \displace 0.0 +1906c1915 +< .\hbox(0.0+0.0)x0.0, shifted 3.0 +--- +> .\hbox(0.0+0.0)x0.0, shifted 3.0, yoko(math) direction +2207c2216 +< A character number must be between 0 and 255, or KANJI code. +--- +> A character number must be between 0 and 255. +2213c2222 +< A character number must be between 0 and 255, or KANJI code. +--- +> A character number must be between 0 and 255. +4025a4035 +> ..\displace 0.0 +4033a4044 +> ..\displace 0.0 +4300a4312 +> .\displace 0.0 +4421,4422c4433,4434 +< 19 strings out of 1692 +< 145 string characters out of 8157 +--- +> 19 strings out of 1626 +> 145 string characters out of 10672 +4424c4436 +< 463 multiletter control sequences out of 15000+0 +--- +> 495 multiletter control sequences out of 15000+0 + +mv etrip.out eptrip.out ++ mv etrip.out eptrip.out +diff $etestdir/etrip.out eptrip.out ++ diff SRCDIR/etexdir/etrip/etrip.out eptrip.out + +eval ./dvitype $dvitype_args etrip.dvi >eptrip.typ || exit 1 ++ eval ./dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' etrip.dvi +./dvitype -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*' etrip.dvi +++ ./dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' etrip.dvi +$DIFF $DIFFFLAGS $etestdir/etrip.typ eptrip.typ ++ diff SRCDIR/etexdir/etrip/etrip.typ eptrip.typ +1c1 +< This is DVItype, Version 3.6 (TeX Live 2014) +--- +> This is DVItype, Version 3.6 (TeX Live 2021/dev) +9c9 +< ' TeX output 2014.01.22:1125' +--- +> ' TeX output 2021.01.27:1803' + +$is_OK || { + echo ">>> There were some errors." >&2 + exit 1 +} ++ : + +PASS eptexdir/eptriptest.test (exit status: 0) +PASS: eptexdir/eptriptest.test diff --git a/Build/source/texk/web2c/euptexdir/eptrip/eptrip.log b/Build/source/texk/web2c/euptexdir/eptrip/eptrip.log new file mode 100644 index 00000000000..1d166fdd58a --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/eptrip/eptrip.log @@ -0,0 +1,4429 @@ +This is e-pTeX, Version 3.141592653-p4.1.1-230214-2.6 (utf8.euc) (TeX Live 2023) (preloaded format=etrip 2023.2.14) 14 FEB 2023 11:25 +entering extended mode +**&etrip etrip +(./etrip.tex e-IniTeX: e-Trip format loaded. +This is the e-Trip test [2021-01-28] for e-TeX v3.141592653-2.6. +(You are using e-TeX version/revision 2.6) +Missing character: There is no b in font nullfont! + +Missing character: There is no c in font nullfont! + +Checking input/output of new csnames: +e-TeX Version 2 has 66 new csnames: +> \3=macro: +-> \eTeXversion \eTeXrevision + \showgroups \showtokens + \tracingassigns \tracinggroups + \tracingifs \tracingscantokens + \currentgrouplevel \currentgrouptype + \middle \lastnodetype + \TeXXeTstate \beginL + \endL \beginR + \endR \predisplaydirection + \marks \topmarks + \firstmarks \botmarks + \splitfirstmarks \splittopmarks + \protected \unexpanded + \detokenize \scantokens + \readline \unless + \ifdefined \ifcsname + \everyeof \interactionmode + \currentiflevel \currentiftype + \currentifbranch \showifs + \fontcharwd \fontcharht + \fontchardp \fontcharic + \iffontchar \tracingnesting + \parshapelength \parshapeindent + \parshapedimen \numexpr + \dimexpr \glueexpr + \muexpr \mutoglue + \gluetomu \gluestretchorder + \glueshrinkorder \gluestretch + \glueshrink \savingvdiscards + \pagediscards \splitdiscards + \lastlinefit \savinghyphcodes + \interlinepenalties \clubpenalties + \widowpenalties \displaywidowpenalties +. +l.181 \show\3 + \endgroup + +Checking creation and printing for new node types: + +Overfull \hbox (38.99965pt too wide) in paragraph at lines 195--197 +[]\trip a[]b[]p$q [] t$u[][] + +\hbox(17.0+3.00002)x0.0 +.\hbox(0.0+0.0)x0.0 +.\trip a +.\beginL +.\trip b +.\beginR +.\trip p +.\mathon +.\trip q +.\glue(\thinmuskip) 4.99988 plus 0.99997 +.\hbox(17.0+3.00002)x23.9999 +..\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +...\bigtrip a +..\trip r +..\glue(\thinmuskip) 4.99988 plus 0.99997 +..\hbox(16.0+4.00002)x6.0, shifted -1.0 +...\bigtrip B +..\trip s +..\vbox(7.0+11.0)x7.0, shifted -9.0 +...\hbox(7.0+1.0)x3.0 +....\trip A +...\hbox(8.0+2.0)x3.0 +....\trip B +.\glue(\thinmuskip) 4.99988 plus 0.99997 +.\trip t +.\mathoff +.\trip r (ligature u|) +.\penalty 10000 +.\glue(\parfillskip) 0.0 +.\endR +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (11.0pt too wide) detected at line 197 +\trip aMb + +\hbox(8.0+2.0)x0.0 +.\trip a +.\trip M +.\trip b + + +Overfull \hbox (24.6pt too wide) in paragraph at lines 197--201 +[][]\trip p[]q$st$u[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\beginR +.\trip p +.\endR +.\trip q (ligature |) +.\trip q +.\mathon, surrounded 12.3 +.\trip s +.\trip t +.\mathoff, surrounded 12.3 +.\trip r (ligature u|) +.\penalty 10000 +.\glue(\parfillskip) 0.0 +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (6.0pt too wide) detected at line 201 +\trip rMs + +\hbox(0.0+0.0)x0.0 +.\trip r +.\trip M +.\trip s + + +Overfull \hbox (3.0pt too wide) in paragraph at lines 201--205 +[]\trip tp[]u + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip t +.\kern3.0 +.\trip q (ligature ) +.\trip p +.\endL +.\trip r (ligature u|) +.\penalty 10000 +.\glue(\parfillskip) 0.0 +.\glue(\rightskip) 0.0 + + +Overfull \hbox (6.0pt too wide) detected at line 205 +\trip rMs + +\hbox(0.0+0.0)x0.0 +.\trip r +.\trip M +.\trip s + +! Bad register code (-1). + + { +l.208 \marks-1{ + -1}\marks65536{65536}% Bad register (-1) .... +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + { +l.208 ...marks-1{-1}\marks65536{ + 65536}% Bad register (-1) ...... +A register number must be between 0 and 65535. +I changed this one to zero. + +! Improper \beginL. +l.210 \beginL + \beginR\endL\endR % Improper \(begin/end)(L/R) +Sorry, this optional e-TeX feature has been disabled. + +! Improper \beginR. +l.210 \beginL\beginR + \endL\endR % Improper \(begin/end)(L/R) +Sorry, this optional e-TeX feature has been disabled. + +! Improper \endL. +l.210 \beginL\beginR\endL + \endR % Improper \(begin/end)(L/R) +Sorry, this optional e-TeX feature has been disabled. + +! Improper \endR. +l.210 ...beginL\beginR\endL\endR + % Improper \(begin/end)(L/R) +Sorry, this optional e-TeX feature has been disabled. + + +Overfull \hbox (3.0pt too wide) in paragraph at lines 205--211 +\trip tp + +\hbox(0.0+0.0)x0.0 +.\trip t +.\kern3.0 +.\trip q (ligature ) +.\trip p +.\penalty 10000 +.\glue(\parfillskip) 0.0 +.\glue(\rightskip) 0.0 + +> \box0= +\vbox(30.00002+0.0)x0.0 +.\hbox(17.0+3.00002)x0.0 +..\hbox(0.0+0.0)x0.0 +..\trip a +..\beginL +..\trip b +..\beginR +..\trip p +..\mathon +..\trip q +..\glue(\thinmuskip) 4.99988 plus 0.99997 +..\hbox(17.0+3.00002)x23.9999 +...\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +....\bigtrip a +...\trip r +...\glue(\thinmuskip) 4.99988 plus 0.99997 +...\hbox(16.0+4.00002)x6.0, shifted -1.0 +....\bigtrip B +...\trip s +...\vbox(7.0+11.0)x7.0, shifted -9.0 +....\hbox(7.0+1.0)x3.0 +.....\trip A +....\hbox(8.0+2.0)x3.0 +.....\trip B +..\glue(\thinmuskip) 4.99988 plus 0.99997 +..\trip t +..\mathoff +..\trip r (ligature u|) +..\penalty 10000 +..\glue(\parfillskip) 0.0 +..\endR +..\endL +..\glue(\rightskip) 0.0 +.\penalty 0 +.\glue(\abovedisplayskip) 0.0 +.\glue(\lineskip) 0.0 +.\hbox(8.0+2.0)x0.0 +..\beginM +..\kern0.0 +..\hbox(8.0+2.0)x0.0, display +...\trip a +...\trip M +...\trip b +..\kern0.0 +..\endM +.\penalty 0 +.\glue(\belowdisplayskip) 0.0 +.\glue(\lineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +..\beginL +..\beginR +..\trip p +..\endR +..\trip q (ligature |) +..\trip q +..\mathon, surrounded 12.3 +..\trip s +..\trip t +..\mathoff, surrounded 12.3 +..\trip r (ligature u|) +..\penalty 10000 +..\glue(\parfillskip) 0.0 +..\endL +..\glue(\rightskip) 0.0 +.\penalty 0 +.\glue(\abovedisplayskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +..\beginM +..\kern0.0 +..\hbox(0.0+0.0)x0.0, display +...\trip r +...\trip M +...\trip s +..\kern0.0 +..\endM +.\penalty 0 +.\glue(\belowdisplayskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +..\beginL +..\trip t +..\kern3.0 +..\trip q (ligature ) +..\trip p +..\endL +..\trip r (ligature u|) +..\penalty 10000 +..\glue(\parfillskip) 0.0 +..\glue(\rightskip) 0.0 +.\penalty 0 +.\glue(\abovedisplayskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0, display +..\trip r +..\trip M +..\trip s +.\penalty 0 +.\glue(\belowdisplayskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +..\trip t +..\kern3.0 +..\trip q (ligature ) +..\trip p +..\penalty 10000 +..\glue(\parfillskip) 0.0 +..\glue(\rightskip) 0.0 +.\mark{0old} +.\mark{0} +.\marks1{1} +.\marks15{15} +.\marks65535{65535} +.\mark{-1} +.\mark{65536} + +! OK. +l.211 }\showbox0 + + +Checking \interactionmode: + + +current interactionmode (l.229): batch + +current interactionmode (l.230): nonstop + +current interactionmode (l.231): scroll + +current interactionmode (l.232): errorstop + +! Bad interaction mode (-1). +l.237 \interactionmode=-1 + \1 1 % nonstop +Modes are 0=batch, 1=nonstop, 2=scroll, and +3=errorstop. Proceed, and I'll ignore this case. + +current interactionmode (l.237): nonstop +! Bad interaction mode (4). +l.238 \interactionmode=4 + \1 1 % nonstop +Modes are 0=batch, 1=nonstop, 2=scroll, and +3=errorstop. Proceed, and I'll ignore this case. + +current interactionmode (l.238): nonstop + +current interactionmode (l.239): scroll + +current interactionmode (l.239): scroll + +current interactionmode (l.239): nonstop + +current interactionmode (l.239): nonstop + +current interactionmode (l.239): errorstop + +current interactionmode (l.239): errorstop + +current interactionmode (l.239): batch + +current interactionmode (l.239): batch +current interactionmode (l.240): batch + +current interactionmode (l.240): errorstop + +1 (l.243) +0 (l.244) +1 (l.245) +current interactionmode (l.247): batch + +current interactionmode (l.247): errorstop + +current interactionmode (l.247): scroll + +current interactionmode (l.247): nonstop + +current interactionmode (l.248): batch +Checking \tracingifs: +{vertical mode: \iftrue: (level 1) entered on line 257} +{\iffalse: (level 2) entered on line 257} +{\else: \iffalse (level 2) entered on line 257} +{\fi: \iffalse (level 2) entered on line 257} +{\else: \iftrue (level 1) entered on line 257} +{\fi: \iftrue (level 1) entered on line 257} +{\unless\iftrue: (level 1) entered on line 258} +{\else: \unless\iftrue (level 1) entered on line 258} +{\unless\iffalse: (level 2) entered on line 258} +{\else: \unless\iffalse (level 2) entered on line 258} +{\fi: \unless\iffalse (level 2) entered on line 258} +{\fi: \unless\iftrue (level 1) entered on line 258} +{\ifdefined: (level 1) entered on line 260} +{true} +{\unless} +{\unless\ifdefined: (level 2) entered on line 260} +{true} +{\ifcase: (level 3) entered on line 260} +{case 2} +{\or: \ifcase (level 3) entered on line 260} +{\or: \ifcase (level 3) entered on line 260} +{\ifcsname: (level 4) entered on line 261} +{true} +{\ifcsname: (level 5) entered on line 261} +{false} +{\else: \ifcsname (level 5) entered on line 261} +{\ifx: (level 6) entered on line 262} +{false} +{\else: \ifx (level 6) entered on line 262} +{\ifx: (level 7) entered on line 262} +{false} +{\fi: \ifx (level 7) entered on line 262} +{\fi: \ifx (level 6) entered on line 262} +{\fi: \ifcsname (level 5) entered on line 261} +{\fi: \ifcsname (level 4) entered on line 261} +{\or: \ifcase (level 3) entered on line 260} +{\fi: \ifcase (level 3) entered on line 260} +{\fi: \unless\ifdefined (level 2) entered on line 260} +{\fi: \ifdefined (level 1) entered on line 260} +{\endgroup} +Checking \tracingassigns: +{into \tracingassigns=1} +{globally changing \6=undefined} +{into \6=select font nullfont} +{globally changing \6=select font nullfont} +{into \6=select font etrip at 11.0pt} +{changing \6=select font etrip at 11.0pt} +{into \6=select font nullfont} +{changing \6=select font nullfont} +{into \6=select font etrip at 11.0pt} +{globally changing \count17=0} +{into \count17=7} +{reassigning \count17=7} +{globally changing \9=undefined} +{into \9=macro:->\relax } +{globally changing \8=undefined} +{into \8=macro:->\relax } +{reassigning \8=macro:->\relax } +{globally changing \5=undefined} +{into \5=select font nullfont} +{globally changing \5=select font nullfont} +{into \5=select font etrip at 12.0pt} +{changing \5=select font etrip at 12.0pt} +{into \5=select font nullfont} +{changing \5=select font nullfont} +{into \5=select font etrip at 12.0pt} +{changing \4=undefined} +{into \4=select font etrip at 12.0pt} +{globally changing \count17=7} +{into \count17=0} +{reassigning \count17=0} +{globally changing \9=macro:->\relax } +{into \9=undefined} +{globally changing \8=macro:->\relax } +{into \8=undefined} +{reassigning \8=undefined} +{restoring \4=undefined} +{restoring \5=select font etrip at 12.0pt} +{restoring \6=select font etrip at 11.0pt} +{restoring \tracingassigns=0} +Checking \currentgrouptype, \currentgrouplevel, and \lastnodetype: +current group level (l.284): outer level +current group type (l.286): bottom level +current group type (l.313): semi simple group +{entering vbox group (level 2) at line 315} +current group type (l.315): vbox group +{entering adjusted hbox group (level 3) at line 316} +current group type (l.316): adjusted hbox group +{entering simple group (level 4) at line 317} +current group type (l.317): simple group +{leaving simple group (level 4) entered at line 317} +last node type (l.318): empty +{entering hbox group (level 4) at line 319} +current group type (l.319): hbox group +{entering disc group (level 5) at line 320} +current group type (l.320): disc group +{leaving disc group (level 5) entered at line 320} +{entering disc group (level 5) at line 320} +current group type (l.320): disc group +{leaving disc group (level 5) entered at line 320} +{entering disc group (level 5) at line 320} +current group type (l.320): disc group +{leaving disc group (level 5) entered at line 320} +last node type (l.322): disc node +last node type (l.323): char node +last node type (l.324): ligature node +{entering insert group (level 5) at line 325} +current group type (l.325): insert group +{leaving insert group (level 5) entered at line 325} +last node type (l.326): ins node +{entering insert group (level 5) at line 327} +current group type (l.327): insert group +{leaving insert group (level 5) entered at line 327} +last node type (l.328): adjust node +last node type (l.329): mark node +last node type (l.330): rule node +last node type (l.331): glue node +last node type (l.332): kern node +last node type (l.333): penalty node +{entering vtop group (level 5) at line 334} +current group type (l.334): vtop group +{leaving vtop group (level 5) entered at line 334} +last node type (l.335): vlist node +last node type (l.336): whatsit node +{entering math shift group (level 5) at line 337} +current group type (l.337): math shift group +{entering math group (level 6) at line 338} +current group type (l.338): math group +{leaving math group (level 6) entered at line 338} +{leaving math shift group (level 5) entered at line 337} +last node type (l.340): math node +last node type (l.341): math node +last node type (l.342): math node +{entering align group (level 5) at line 343} +{entering align group (level 6) at line 343} +current group type (l.343): align group +{leaving align group (level 6) entered at line 343} +{entering align group (level 6) at line 344} +{entering no align group (level 7) at line 344} +current group type (l.344): no align group +last node type (l.345): unset node +{leaving no align group (level 7) entered at line 344} +{leaving align group (level 6) entered at line 344} +{leaving align group (level 5) entered at line 343} +{leaving hbox group (level 4) entered at line 319} +{leaving adjusted hbox group (level 3) entered at line 316} +last node type (l.349): hlist node +{entering math shift group (level 3) at line 350} +current group type (l.350): math shift group +last node type (l.351): empty +{entering math choice group (level 4) at line 352} +current group type (l.352): math choice group +{leaving math choice group (level 4) entered at line 352} +{entering math choice group (level 4) at line 352} +current group type (l.352): math choice group +{leaving math choice group (level 4) entered at line 352} +{entering math choice group (level 4) at line 352} +current group type (l.352): math choice group +{leaving math choice group (level 4) entered at line 352} +{entering math choice group (level 4) at line 352} +current group type (l.352): math choice group +{entering vcenter group (level 5) at line 353} +current group type (l.353): vcenter group +{leaving vcenter group (level 5) entered at line 353} +last node type (l.354): math mode node +{leaving math choice group (level 4) entered at line 352} +last node type (l.355): math mode node +{entering math left group (level 4) at line 356} +current group type (l.356): math left group +{leaving math left group (level 4) entered at line 356} +{entering math left group (level 4) at line 357} +current group type (l.357): math left group +{leaving math left group (level 4) entered at line 357} +{entering math left group (level 4) at line 358} +current group type (l.358): math left group +{leaving math left group (level 4) entered at line 358} +{leaving math shift group (level 3) entered at line 350} +{leaving vbox group (level 2) entered at line 315} +{entering adjusted hbox group (level 2) at line 396} +{leaving adjusted hbox group (level 2) entered at line 396} +{entering output group (level 2) at line 396} +current group type (l.396): output group +{entering vbox group (level 3) at line 396} +{entering adjusted hbox group (level 4) at line 396} +{entering hbox group (level 5) at line 396} +{entering simple group (level 6) at line 396} +{entering align group (level 7) at line 396} +{entering align group (level 8) at line 396} +{entering no align group (level 9) at line 396} +{entering math shift group (level 10) at line 396} +{entering vtop group (level 11) at line 396} +{entering math shift group (level 12) at line 396} +{entering math group (level 13) at line 396} +{entering math left group (level 14) at line 396} +{leaving math left group (level 14) entered at line 396} +{entering math left group (level 14) at line 396} +{entering math choice group (level 15) at line 396} +{leaving math choice group (level 15) entered at line 396} +{entering math choice group (level 15) at line 396} +{leaving math choice group (level 15) entered at line 396} +{entering math choice group (level 15) at line 396} +{entering vcenter group (level 16) at line 396} +{entering insert group (level 17) at line 396} +{entering disc group (level 18) at line 396} +{leaving disc group (level 18) entered at line 396} +{entering disc group (level 18) at line 396} + +### disc group (level 18) entered at line 396 (\discretionary{}{) +### insert group (level 17) entered at line 396 (\vadjust{) +### vcenter group (level 16) entered at line 396 (\vcenter to7.0pt{) +### math choice group (level 15) entered at line 396 (\mathchoice{}{}{) +### math left group (level 14) entered at line 396 (\middle) +### math group (level 13) entered at line 396 ({) +### math shift group (level 12) entered at line 396 ($$) +### vtop group (level 11) entered at line 396 (\vtop{) +### math shift group (level 10) entered at line 396 ($) +### no align group (level 9) entered at line 396 (\noalign{) +### align group (level 8) entered at line 396 (\cr) +### align group (level 7) entered at line 396 (\valign{) +### simple group (level 6) entered at line 396 ({) +### hbox group (level 5) entered at line 396 (\raise5.0pt\hbox{) +### adjusted hbox group (level 4) entered at line 396 (\hbox spread5.0pt +{) +### vbox group (level 3) entered at line 396 (\setbox0=\vbox{) +### output group (level 2) entered at line 396 (\output) +### semi simple group (level 1) entered at line 287 (\begingroup) +### bottom level + +! OK. + ...nary {}{\showgroups + }{} } } }{} \right . } $$ } $... +l.396 ...ox{}\vfil\penalty-10000 + + +{leaving disc group (level 18) entered at line 396} +{entering disc group (level 18) at line 396} +{leaving disc group (level 18) entered at line 396} +{leaving insert group (level 17) entered at line 396} +{leaving vcenter group (level 16) entered at line 396} +{leaving math choice group (level 15) entered at line 396} +{entering math choice group (level 15) at line 396} +{leaving math choice group (level 15) entered at line 396} +{leaving math left group (level 14) entered at line 396} +{leaving math group (level 13) entered at line 396} +{leaving math shift group (level 12) entered at line 396} +{leaving vtop group (level 11) entered at line 396} +{leaving math shift group (level 10) entered at line 396} +{leaving no align group (level 9) entered at line 396} +{leaving align group (level 8) entered at line 396} +{leaving align group (level 7) entered at line 396} +{leaving simple group (level 6) entered at line 396} +{leaving hbox group (level 5) entered at line 396} +{leaving adjusted hbox group (level 4) entered at line 396} +{leaving vbox group (level 3) entered at line 396} +{leaving output group (level 2) entered at line 396} +Checking expansion of \protected macros: +> \2=\protected macro: +->. +l.404 ...otected\def\2{} \show\2 + + +> \3=\protected macro: +->. +l.405 \let\3=\2 \show\3 + + +> \1=\protected macro: +->\2. +l.406 ...cted\def\1{\2}} \show\1 + + + +\1->\2 +\1\2 +\typeout ->\immediate \write 15 + +\1->\2 +\1\2 + +\1->\2 +> \box0= +\vbox(0.0+0.0)x0.0 +.\special{\1\2} + +! OK. +l.410 ...ndafter\1\1}} \showbox0 + + + +\1->\2 +> \5=macro: +->\1\2. +l.411 ...xpandafter\1\1} \show\5 + + + +\1->\2 + +\1->\3 + +\3-> + +\2-> +Checking \scantokens, \tracingscantokens, \readline, and \everyeof: + +Completed box being shipped out [1] +\vbox(0.0+0.0)x0.0 +.\openout1=etrip.out +.\write1{\unexpanded \expandafter {\1}} +.\closeout1 + +\openout1 = `etrip.out'. + +Memory usage before: 57&184; after: 40&178; still untouched: 2170 +(./etrip.out) ( +Warning: end of semi simple group (level 3) entered at line 433 of a dif +ferent file +Warning: end of \iftrue entered on line 433 of a different file +Warning: end of file when simple group (level 3) entered at line 3 is in +complete +Warning: end of file when \iffalse\else entered on line 4 is incomplete +) ( +Warning: end of semi simple group (level 3) entered at line 435 of a dif +ferent file +l.1 \endgroup + +l.435 ...ntokens\expandafter{\1} + \egroup \fi +Warning: end of \unless\iffalse entered on line 435 of a different file +l.2 \fi + +l.435 ...ntokens\expandafter{\1} + \egroup \fi +Warning: end of file when simple group (level 3) entered at line 3 is in +complete +Warning: end of file when \iffalse\else entered on line 4 is incomplete +l.5 \iffalse \else + +l.435 ...ntokens\expandafter{\1} + \egroup \fi) ( +Warning: end of hbox group (level 4) entered at line 1 of a different fi +le +l.1 \egroup + +l.6 } + +l.446 } + % end of outer \scantokens +Warning: end of \ifcase entered on line 2 of a different file +l.2 \else \fi + +l.6 } + +l.446 } + % end of outer \scantokens +Warning: end of hbox group (level 3) entered at line 437 of a different +file + +\1->\egroup + \fi +l.4 \1 + +l.6 } + +l.446 } + % end of outer \scantokens +Warning: end of \unless\iftrue entered on line 438 of a different file + +\1->\egroup \fi + +l.4 \1 + +l.6 } + +l.446 } + % end of outer \scantokens +Warning: end of file when math shift group (level 4) entered at line 7 i +s incomplete +Warning: end of file when vtop group (level 3) entered at line 5 is inco +mplete +Warning: end of file when \iffalse entered on line 9 is incomplete +Warning: end of file when \ifinner\else entered on line 8 is incomplete +Warning: end of file when \ifnum entered on line 6 is incomplete +l.10 \csname iffalse\endcsname + +l.6 } + +l.446 } + % end of outer \scantokens +! Incomplete \iffalse; all text was ignored after line 9. + + \fi +l.6 } + +l.446 } + % end of outer \scantokens +The file ended while I was skipping conditional text. +This kind of error happens when you say `\if...' and forget +the matching `\fi'. I've inserted a `\fi'; this might work. + +Warning: end of file when vtop group (level 3) entered at line 5 is inco +mplete +Warning: end of file when \ifnum entered on line 6 is incomplete +l.9 \fi + +l.446 } + % end of outer \scantokens) (./etrip.out +! Undefined control sequence. +\endgroup ->\9\9 + +l.1 \endgroup + +The control sequence at the end of the top line +of your error message was never \def'ed. If you have +misspelled it (e.g., `\hobx'), type `I' and the correct +spelling (e.g., `I\hbox'). Otherwise just continue, +and I'll forget about whatever was undefined. + +) ( +! Undefined control sequence. +\endgroup ->\9\9 + +l.1 \endgroup + +l.453 ...ntokens\expandafter{\1} + \egroup \fi +The control sequence at the end of the top line +of your error message was never \def'ed. If you have +misspelled it (e.g., `\hobx'), type `I' and the correct +spelling (e.g., `I\hbox'). Otherwise just continue, +and I'll forget about whatever was undefined. + +) ( ) +Runaway definition? +->\begingroup +! File ended while scanning definition of \1. + + } +l.455 ...scantokens{\begingroup} + % <== error +I suspect you have forgotten a `}', causing me +to read past where you wanted me to stop. +I'll try to recover; but if the error is serious, +you'd better type `E' or `X' now and fix your file. + +( ) ( level=2 ( level=3 ( level=4 +! Undefined control sequence. + ...uplevel \2\else \9 + \fi +l.2 + +\2...=\the \currentgrouplevel }} + \endgroup + ...rrentgrouplevel \2 + \else \9\fi +l.2 + +\2...=\the \currentgrouplevel }} + \endgroup + ...rrentgrouplevel \2 + \else \9\fi +l.2 + +\2...=\the \currentgrouplevel }} + \endgroup +l.463 ...evel\2\else\9\fi}}}\1\2 + +The control sequence at the end of the top line +of your error message was never \def'ed. If you have +misspelled it (e.g., `\hobx'), type `I' and the correct +spelling (e.g., `I\hbox'). Otherwise just continue, +and I'll forget about whatever was undefined. + +))) +{\tracingrestores} +{\tracingassigns} +{into \tracingassigns=1} +{\setbox} +{restricted horizontal mode: \unless} +{\unless\ifeof} +{true} +{\readline} +{changing \2=macro:->\begingroup \scantokens {\message \ETC.} +{into \2=macro:->\endgroup^^M} +{\endlinechar} +{changing \endlinechar=13} +{into \endlinechar=-1} +{the character \} +Missing character: There is no \ in font etrip! +{the character e} +Missing character: There is no e in font etrip! +{the character n} +Missing character: There is no n in font etrip! +{the character d} +Missing character: There is no d in font etrip! +{the character g} +Missing character: There is no g in font etrip! +{the character r} +Missing character: There is no o in font etrip! +{the character u} +Missing character: There is no ^^M in font etrip! +{\expandafter} +{\fi} +{\unless} +{\unless\ifeof} +{true} +{\readline} +{changing \2=macro:->\endgroup^^M} +{into \2=macro:->\fi} +{\endlinechar} +{reassigning \endlinechar=-1} +{the character \} +Missing character: There is no \ in font etrip! +{the character f} +Missing character: There is no f in font etrip! +{the character i} +Missing character: There is no i in font etrip! +{\expandafter} +{\fi} +{\unless} +{\unless\ifeof} +{true} +{\readline} +{changing \2=macro:->\fi} +{into \2=macro:->\bgroup} +{\endlinechar} +{reassigning \endlinechar=-1} +{the character \} +Missing character: There is no \ in font etrip! +{the character b} +Missing character: There is no g in font etrip! +{the character r} +Missing character: There is no o in font etrip! +{the character u} +{\expandafter} +{\fi} +{\unless} +{\unless\ifeof} +{true} +{\readline} +{changing \2=macro:->\bgroup} +{into \2=macro:->\iffalse \else} +{\endlinechar} +{reassigning \endlinechar=-1} +{the character \} +Missing character: There is no \ in font etrip! +{the character i} +Missing character: There is no i in font etrip! +{the character f} +Missing character: There is no f in font etrip! +{the character f} +Missing character: There is no f in font etrip! +{the character a} +Missing character: There is no l in font etrip! +{the character s} +Missing character: There is no e in font etrip! +{blank space } +{the character \} +Missing character: There is no \ in font etrip! +{the character e} +Missing character: There is no e in font etrip! +{the character l} +Missing character: There is no l in font etrip! +{the character s} +Missing character: There is no e in font etrip! +{\expandafter} +{\fi} +{\unless} +{\unless\ifeof} +{true} +{\readline} +{changing \2=macro:->\iffalse \else} +{into \2=macro:->} +{\endlinechar} +{reassigning \endlinechar=-1} +{\expandafter} +{\fi} +{\unless} +{\unless\ifeof} +{false} +{\showlists} + +### restricted horizontal mode entered at line 470 +\trip r +\trip r (ligature up) +\trip b +\trip r +\trip r (ligature up) +\trip a +\trip s +\glue 4.0 plus 2.0 minus 1.0 +\trip s +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.470 ...ox25=\hbox{\1\showlists + }^^M + +{end-group character }} +{restoring \endlinechar=13} +{restoring \2=macro:->\begingroup \scantokens {\message \ETC.} +{changing \box25=void} +{into \box25= +\hbox(8.0+2.0)x9.0 []} +{vertical mode: blank space } +{end-group character }} +{restoring \box25=void} +{restoring \tracingassigns=0} +Checking \marks etc., \showtokens, and \detokenize: + +Current marks: + \splitfirstmarks 0=. + \splitbotmarks 0=. + \splitfirstmarks 1=. + \splitbotmarks 1=. + \splitfirstmarks 3=. + \splitbotmarks 3=. +> \box0= +\vbox(188.0+0.0)x10.0 +.\mark{0-1} +.\marks1{1-1} +.\glue 1.0 +.\vbox(9.0+0.0)x0.0 +.\mark{0-2} +.\marks3{} +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +.\glue 5.0 +.\glue 0.0 plus 1.0fil +.\penalty 0 +.\glue 40.0 +.\mark{0-3} +.\glue 1.0 +.\glue(\lineskip) 0.0 +.\vbox(19.0+0.0)x0.0 +.\marks3{3-3} +.\glue 3.0 plus 1.0fil +.\penalty 0 +.\glue 40.0 +.\glue(\lineskip) 0.0 +.\vbox(30.0+0.0)x0.0 +.\glue 0.0 plus 1.0fil +.\penalty 0 +.\glue 40.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x10.0 + +! OK. +l.493 \1 \showbox0 + \let\5=\3 \def\3#1{\showtokens\expandaft... + +> 0-1. + } + +... +l.495 \1 + \showbox1 \showbox0 \let\3=\5 + +> 0-2. + } + +... +l.495 \1 + \showbox1 \showbox0 \let\3=\5 + +> 1-1. + } + +... +l.495 \1 + \showbox1 \showbox0 \let\3=\5 + +> 1-1. + } + +... +l.495 \1 + \showbox1 \showbox0 \let\3=\5 + +> . + } + +... +l.495 \1 + \showbox1 \showbox0 \let\3=\5 + +> . + } + +... +l.495 \1 + \showbox1 \showbox0 \let\3=\5 + + +Current marks: + \splitfirstmarks 0=0-1. + \splitbotmarks 0=0-2. + \splitfirstmarks 1=1-1. + \splitbotmarks 1=1-1. + \splitfirstmarks 3=. + \splitbotmarks 3=. +> \box1= +\vbox(17.0+0.0)x0.0, glue set 2.0fil +.\mark{0-1} +.\marks1{1-1} +.\glue 1.0 +.\vbox(9.0+0.0)x0.0 +.\mark{0-2} +.\marks3{} +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +.\glue 5.0 +.\glue 0.0 plus 1.0fil + +! OK. +l.495 \1 \showbox1 + \showbox0 \let\3=\5 + +> \box0= +\vbox(132.0+0.0)x10.0 +.\mark{0-3} +.\glue(\splittopskip) 0.0 +.\vbox(19.0+0.0)x0.0 +.\marks3{3-3} +.\glue 3.0 plus 1.0fil +.\penalty 0 +.\glue 40.0 +.\glue(\lineskip) 0.0 +.\vbox(30.0+0.0)x0.0 +.\glue 0.0 plus 1.0fil +.\penalty 0 +.\glue 40.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x10.0 + +! OK. +l.495 \1 \showbox1 \showbox0 + \let\3=\5 + + +Current marks: + \splitfirstmarks 0=0-3. + \splitbotmarks 0=0-3. + \splitfirstmarks 1=. + \splitbotmarks 1=. + \splitfirstmarks 3=3-3. + \splitbotmarks 3=3-3. +> \box1= +\vbox(27.0+0.0)x0.0, glue set 5.0fil +.\mark{0-3} +.\glue(\splittopskip) 0.0 +.\vbox(19.0+0.0)x0.0 +.\marks3{3-3} +.\glue 3.0 plus 1.0fil + +! OK. +l.497 \1 \showbox1 + \showbox0 + +> \box0= +\vbox(70.0+0.0)x10.0 +.\glue(\splittopskip) 0.0 +.\vbox(30.0+0.0)x0.0 +.\glue 0.0 plus 1.0fil +.\penalty 0 +.\glue 40.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x10.0 + +! OK. +l.497 \1 \showbox1 \showbox0 + + + +Current marks: + \splitfirstmarks 0=. + \splitbotmarks 0=. + \splitfirstmarks 1=. + \splitbotmarks 1=. + \splitfirstmarks 3=. + \splitbotmarks 3=. +> \box1= +\vbox(37.0+0.0)x0.0, glue set 7.0fil +.\glue(\splittopskip) 0.0 +.\vbox(30.0+0.0)x0.0 +.\glue 0.0 plus 1.0fil + +! OK. +l.499 \1 \showbox1 + \showbox0 + +> \box0= +\vbox(0.0+0.0)x10.0 +.\glue(\splittopskip) 0.0 +.\hbox(0.0+0.0)x10.0 + +! OK. +l.499 \1 \showbox1 \showbox0 + + + +Current marks: + \topmarks 0=. + \firstmarks 0=. + \botmarks 0=. + \topmarks 1=. + \firstmarks 1=. + \botmarks 1=. + \topmarks 3=. + \firstmarks 3=. + \botmarks 3=. + +Current marks: + \topmarks 0=. + \firstmarks 0=0-1. + \botmarks 0=0-2. + \topmarks 1=. + \firstmarks 1=1-1. + \botmarks 1=1-1. + \topmarks 3=. + \firstmarks 3=. + \botmarks 3=. +> \box255= +\vbox(35.0+0.0)x0.0, glue set 21.0fil +.\mark{0-1} +.\marks1{1-1} +.\glue(\topskip) 0.0 +.\vbox(9.0+0.0)x0.0 +.\mark{0-2} +.\marks3{} +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +.\glue 5.0 +.\glue 0.0 plus 1.0fil + +! OK. + {\1 \showbox 255 + \setbox 0=\box 255} +l.502 ...s3{}\vfil\penalty-10000 + + + +Current marks: + \topmarks 0=0-2. + \firstmarks 0=0-3. + \botmarks 0=0-3. + \topmarks 1=1-1. + \firstmarks 1=1-1. + \botmarks 1=1-1. + \topmarks 3=. + \firstmarks 3=3-3. + \botmarks 3=3-3. +> \box255= +\vbox(35.0+0.0)x0.0, glue set 13.0fil +.\mark{0-3} +.\glue(\topskip) 0.0 +.\vbox(19.0+0.0)x0.0 +.\marks3{3-3} +.\glue 3.0 plus 1.0fil + +! OK. + {\1 \showbox 255 + \setbox 0=\box 255} +l.502 ...s3{}\vfil\penalty-10000 + + + +Current marks: + \topmarks 0=0-3. + \firstmarks 0=0-3. + \botmarks 0=0-3. + \topmarks 1=1-1. + \firstmarks 1=1-1. + \botmarks 1=1-1. + \topmarks 3=3-3. + \firstmarks 3=3-3. + \botmarks 3=3-3. +> \box255= +\vbox(35.0+0.0)x0.0, glue set 5.0fil +.\glue(\topskip) 0.0 +.\vbox(30.0+0.0)x0.0 +.\glue 0.0 plus 1.0fil + +! OK. + {\1 \showbox 255 + \setbox 0=\box 255} +l.502 ...s3{}\vfil\penalty-10000 + + + +Current marks: + \topmarks 0=0-3. + \firstmarks 0=. + \botmarks 0=. + \topmarks 1=1-1. + \firstmarks 1=. + \botmarks 1=. + \topmarks 3=3-3. + \firstmarks 3=. + \botmarks 3=. +> \box255= +\vbox(35.0+0.0)x10.0, glue set 35.0fil +.\glue(\topskip) 0.0 +.\hbox(0.0+0.0)x10.0 +.\mark{} +.\marks1{} +.\marks3{} +.\glue 0.0 plus 1.0fil + +! OK. + {\1 \showbox 255 + \setbox 0=\box 255} +l.502 ...s3{}\vfil\penalty-10000 + + + +Current marks: + \topmarks 0=. + \firstmarks 0=. + \botmarks 0=. + \topmarks 1=. + \firstmarks 1=. + \botmarks 1=. + \topmarks 3=. + \firstmarks 3=. + \botmarks 3=. +> \box255= +\vbox(35.0+0.0)x0.0, glue set 35.0fil +.\glue(\topskip) 0.0 +.\hbox(0.0+0.0)x0.0 +.\mark{} +.\marks1{} +.\marks3{} +.\glue 0.0 plus 1.0fil + +! OK. + {\1 \showbox 255 + \setbox 0=\box 255} +l.503 ...s3{}\vfil\penalty-10000 + + + +Current marks: + \topmarks 0=. + \firstmarks 0=. + \botmarks 0=. + \topmarks 1=. + \firstmarks 1=. + \botmarks 1=. + \topmarks 3=. + \firstmarks 3=. + \botmarks 3=. +> \box255= +\vbox(35.0+0.0)x0.0, glue set 35.0fil +.\glue(\topskip) 0.0 +.\hbox(0.0+0.0)x0.0 +.\glue 0.0 plus 1.0fil + +! OK. + {\1 \showbox 255 + \setbox 0=\box 255} +l.504 ...x{}\vfil\penalty-10000 + % reclaim sparse array memory! + +Checking \middle: +! Missing $ inserted. + + $ +... +l.513 \setbox0=\vbox{\middle + \par \right \par} % <== 8 errors +I've inserted a begin-math/end-math symbol since I think +you left one out. Proceed, with fingers crossed. + +! Missing delimiter (. inserted). + + \par +l.513 ...box0=\vbox{\middle \par + \right \par} % <== 8 errors +I was expecting to see something like `(' or `\{' or +`\}' here. If you typed, e.g., `{' instead of `\{', you +should probably delete the `{' by typing `1' now, so that +braces don't get unbalanced. Otherwise just proceed. +Acceptable delimiters are characters whose \delcode is +nonnegative, or you can use `\delimiter '. + +! Extra \middle. + + \par +l.513 ...box0=\vbox{\middle \par + \right \par} % <== 8 errors +I'm ignoring a \middle that had no matching \left. + +! Missing $ inserted. + + $ +... +l.513 ...box0=\vbox{\middle \par + \right \par} % <== 8 errors +I've inserted a begin-math/end-math symbol since I think +you left one out. Proceed, with fingers crossed. + +! Missing $ inserted. + + $ +... +l.513 ...box{\middle \par \right + \par} % <== 8 errors +I've inserted a begin-math/end-math symbol since I think +you left one out. Proceed, with fingers crossed. + +! Missing delimiter (. inserted). + + \par +l.513 ...middle \par \right \par + } % <== 8 errors +I was expecting to see something like `(' or `\{' or +`\}' here. If you typed, e.g., `{' instead of `\{', you +should probably delete the `{' by typing `1' now, so that +braces don't get unbalanced. Otherwise just proceed. +Acceptable delimiters are characters whose \delcode is +nonnegative, or you can use `\delimiter '. + +! Extra \right. + + \par +l.513 ...middle \par \right \par + } % <== 8 errors +I'm ignoring a \right that had no matching \left. + +! Missing $ inserted. + + $ +... +l.513 ...middle \par \right \par + } % <== 8 errors +I've inserted a begin-math/end-math symbol since I think +you left one out. Proceed, with fingers crossed. + + +### math mode entered at line 524 +\mathord +.\fam1 r +this will begin denominator of: +\fraction, thickness = default +\\left"161361 +\\mathord +\.\fam1 p +\\middle"142342 +\\mathord +\.\fam1 q +\\middle"142342 +\\mathord +\.\fam1 q +### math mode entered at line 521 +\left"161361 +\mathord +.\fam1 p +\middle"142342 +\mathord +.\fam1 q +\middle"142342 +\mathord +.\fam1 q +### math mode entered at line 517 +\mathord +.\fam1 r +this will begin denominator of: +\fraction, thickness = default +\\left"161361 +\\mathord +\.\fam1 q +### math mode entered at line 516 +\left"161361 +\mathord +.\fam1 p +### math mode entered at line 515 +### restricted horizontal mode entered at line 514 +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.525 ... \over r\showlists + + + +### math mode entered at line 521 +\left"161361 +\mathord +.\fam1 p +\middle"142342 +\mathord +.\fam1 q +\middle"142342 +\mathord +.\fam1 q +\mathinner +.\left"161361 +.\mathord +..\fam1 p +.\middle"142342 +.\mathord +..\fam1 q +.\middle"142342 +.\fraction, thickness = default +.\\mathord +.\.\fam1 q +./\mathord +./.\fam1 r +.\right"162362 +### math mode entered at line 517 +\mathord +.\fam1 r +this will begin denominator of: +\fraction, thickness = default +\\left"161361 +\\mathord +\.\fam1 q +### math mode entered at line 516 +\left"161361 +\mathord +.\fam1 p +### math mode entered at line 515 +### restricted horizontal mode entered at line 514 +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.526 ... \right]\showlists + + + +### math mode entered at line 517 +\mathord +.\fam1 r +\mathinner +.\left"161361 +.\mathord +..\fam1 p +.\middle"142342 +.\mathord +..\fam1 q +.\middle"142342 +.\mathord +..\fam1 q +.\mathinner +..\left"161361 +..\mathord +...\fam1 p +..\middle"142342 +..\mathord +...\fam1 q +..\middle"142342 +..\fraction, thickness = default +..\\mathord +..\.\fam1 q +../\mathord +../.\fam1 r +..\right"162362 +.\right"162362 +this will begin denominator of: +\fraction, thickness = default +\\left"161361 +\\mathord +\.\fam1 q +### math mode entered at line 516 +\left"161361 +\mathord +.\fam1 p +### math mode entered at line 515 +### restricted horizontal mode entered at line 514 +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.527 ... \right]\showlists + + + +### math mode entered at line 516 +\left"161361 +\mathord +.\fam1 p +\mathinner +.\left"161361 +.\fraction, thickness = default +.\\mathord +.\.\fam1 q +./\mathord +./.\fam1 r +./\mathinner +./.\left"161361 +./.\mathord +./..\fam1 p +./.\middle"142342 +./.\mathord +./..\fam1 q +./.\middle"142342 +./.\mathord +./..\fam1 q +./.\mathinner +./..\left"161361 +./..\mathord +./...\fam1 p +./..\middle"142342 +./..\mathord +./...\fam1 q +./..\middle"142342 +./..\fraction, thickness = default +./..\\mathord +./..\.\fam1 q +./../\mathord +./../.\fam1 r +./..\right"162362 +./.\right"162362 +.\right"162362 +### math mode entered at line 515 +### restricted horizontal mode entered at line 514 +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.528 \right]\showlists + + + +### math mode entered at line 515 +\mathinner +.\left"161361 +.\mathord +..\fam1 p +.\mathinner +..\left"161361 +..\fraction, thickness = default +..\\mathord +..\.\fam1 q +../\mathord +../.\fam1 r +../\mathinner +../.\left"161361 +../.\mathord +../..\fam1 p +../.\middle"142342 +../.\mathord +../..\fam1 q +../.\middle"142342 +../.\mathord +../..\fam1 q +../.\mathinner +../..\left"161361 +../..\mathord +../...\fam1 p +../..\middle"142342 +../..\mathord +../...\fam1 q +../..\middle"142342 +../..\fraction, thickness = default +../..\\mathord +../..\.\fam1 q +../../\mathord +../../.\fam1 r +../..\right"162362 +../.\right"162362 +..\right"162362 +.\right"162362 +### restricted horizontal mode entered at line 514 +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.529 \right]\showlists + + + +### restricted horizontal mode entered at line 514 +\mathon +\hbox(30.99977+16.99977)x80.99994 +.\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +..\bigtrip a +.\trip p +.\glue(\thinmuskip) 4.99988 plus 0.99997 +.\hbox(30.99977+16.99977)x63.00005 +..\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +...\bigtrip a +..\hbox(8.5+16.49994)x50.00003 +...\hbox(0.0+0.0)x0.0, shifted -7.0 +...\vbox(8.5+16.49994)x50.00003 +....\hbox(0.0+0.0)x50.00003, glue set 25.00002fil +.....\glue 0.0 plus 1.0fil minus 1.0fil +.....\trip q +.....\glue 0.0 plus 1.0fil minus 1.0fil +....\kern1.0 +....\rule(1.0+0.0)x* +....\kern1.0 +....\hbox(17.99997+3.99997)x50.00003 +.....\trip r +.....\hbox(17.99997+3.99997)x50.00003 +......\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +.......\bigtrip a +......\trip p +......\hbox(16.0+4.00002)x6.0, shifted -1.0 +.......\bigtrip B +......\trip q +......\hbox(16.0+4.00002)x6.0, shifted -1.0 +.......\bigtrip B +......\trip q +......\hbox(17.0+3.00002)x25.00002 +.......\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +........\bigtrip a +.......\trip p +.......\hbox(16.0+4.00002)x6.0, shifted -1.0 +........\bigtrip B +.......\trip q +.......\hbox(16.0+4.00002)x6.0, shifted -1.0 +........\bigtrip B +.......\hbox(8.5+2.0)x0.0 +........\hbox(0.0+0.0)x0.0, shifted -7.0 +........\vbox(8.5+2.0)x0.0 +.........\hbox(0.0+0.0)x0.0 +..........\trip q +.........\kern1.0 +.........\rule(1.0+0.0)x* +.........\kern8.5 +.........\hbox(0.0+0.0)x0.0 +..........\trip r +........\hbox(0.0+0.0)x0.0, shifted -7.0 +.......\vbox(7.0+11.0)x7.0, shifted -9.0 +........\hbox(7.0+1.0)x3.0 +.........\trip A +........\hbox(8.0+2.0)x3.0 +.........\trip B +......\vbox(-1.00002+22.99995)x7.0, shifted -18.99998 +.......\hbox(-1.00002+2.0)x7.0 +........\trip ^^@ +.......\hbox(-1.00002+2.0)x7.0 +........\trip ^^@ +.......\hbox(7.0+1.0)x3.0 +........\trip A +.......\hbox(-1.00002+2.0)x7.0 +........\trip ^^@ +.......\hbox(-1.00002+2.0)x7.0 +........\trip ^^@ +.......\hbox(8.0+2.0)x3.0 +........\trip B +...\hbox(0.0+0.0)x0.0, shifted -7.0 +..\vbox(-1.00002+48.99956)x7.0, shifted -31.99979 +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(7.0+1.0)x3.0 +....\trip A +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(-1.00002+2.0)x7.0 +....\trip ^^@ +...\hbox(8.0+2.0)x3.0 +....\trip B +.\vbox(-1.00002+48.99956)x7.0, shifted -31.99979 +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(7.0+1.0)x3.0 +...\trip A +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(8.0+2.0)x3.0 +...\trip B +\mathoff +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.530 $\showlists + + + +### restricted horizontal mode entered at line 532 +\mathon +\hbox(17.0+3.00002)x19.00002 +.\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +..\bigtrip a +.\hbox(16.0+4.00002)x6.0, shifted -1.0 +..\bigtrip B +.\trip p +.\hbox(0.0+0.0)x0.0, shifted -16.5 +.\vbox(-1.00002+20.99998)x7.0, shifted -18.0 +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(7.0+1.0)x3.0 +...\trip A +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(8.0+2.0)x3.0 +...\trip B +\mathoff +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.534 ...box{}\right]$\showlists + } + + +### restricted horizontal mode entered at line 535 +\mathon +\hbox(17.99997+3.99997)x19.00002 +.\hbox(14.00002+2.0)x6.00002, shifted -0.99998 +..\bigtrip a +.\hbox(0.0+0.0)x0.0, shifted 3.0 +.\hbox(16.0+4.00002)x6.0, shifted -1.0 +..\bigtrip B +.\trip s +.\vbox(-1.00002+22.99995)x7.0, shifted -18.99998 +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(7.0+1.0)x3.0 +...\trip A +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(-1.00002+2.0)x7.0 +...\trip ^^@ +..\hbox(8.0+2.0)x3.0 +...\trip B +\mathoff +spacefactor 1000 +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +l.537 \right]$\showlists + } + +Checking TeX--XeT enhancements: + +\endL or \endR problem (0 missing, 1 extra) in paragraph at lines 550--5 +50 +[][][][][][] + +\hbox(0.0+0.0)x10.0, glue set 3.5fil +.\hbox(0.0+0.0)x0.5 +.\beginL +.\beginR +.\kern 3.0 +.\penalty 0 +.\hbox(0.0+0.0)x0.0 +.\kern 3.0 +.\kern 0.0 +.\endR +.\endL +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fil +.\glue(\rightskip) 0.0 + + +\endL or \endR problem (0 missing, 2 extra) in paragraph at lines 551--5 +51 +[] + +\hbox(0.0+0.0)x10.0, glue set 5.5fil +.\hbox(0.0+0.0)x0.5 +.\kern 0.0 +.\kern 4.0 +.\kern 0.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fil +.\glue(\rightskip) 0.0 + +> \box0= +\vbox(0.0+0.0)x10.0 +.\hbox(0.0+0.0)x10.0, glue set 8.5fil +..\hbox(0.0+0.0)x0.5 +..\beginL +..\kern 1.0 +..\penalty 10000 +..\glue(\parfillskip) 0.0 plus 1.0fil +..\endL +..\glue(\rightskip) 0.0 +.\glue(\parskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x10.0, glue set 7.5fil +..\hbox(0.0+0.0)x0.5 +..\beginR +..\kern 2.0 +..\penalty 10000 +..\glue(\parfillskip) 0.0 plus 1.0fil +..\endR +..\glue(\rightskip) 0.0 +.\glue(\parskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x10.0, glue set 3.5fil +..\hbox(0.0+0.0)x0.5 +..\beginL +..\beginR +..\kern 3.0 +..\penalty 0 +..\hbox(0.0+0.0)x0.0 +..\kern 3.0 +..\kern 0.0 +..\endR +..\endL +..\penalty 10000 +..\glue(\parfillskip) 0.0 plus 1.0fil +..\glue(\rightskip) 0.0 +.\glue(\parskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x10.0, glue set 5.5fil +..\hbox(0.0+0.0)x0.5 +..\kern 0.0 +..\kern 4.0 +..\kern 0.0 +..\penalty 10000 +..\glue(\parfillskip) 0.0 plus 1.0fil +..\glue(\rightskip) 0.0 + +! OK. +l.552 \showbox0 + + +Checking optimized \aftergroup: +! Undefined control sequence. + \x + }{\relax +l.564 ...roup{\aftergroup\relax} + } +The control sequence at the end of the top line +of your error message was never \def'ed. If you have +misspelled it (e.g., `\hobx'), type `I' and the correct +spelling (e.g., `I\hbox'). Otherwise just continue, +and I'll forget about whatever was undefined. + +Checking \showifs, \currentiftype, \currentiflevel, and \currentifbranch +: +\currentifbranch OK +current if level (l.583): 0 +current if level (l.584): 1 +current if level (l.585): 2 +current if type (l.603): \if!NONE +current if branch (l.603): no branch +current if type (l.604): \if +current if branch (l.604): true branch +current if type (l.604): \unless\if +current if branch (l.604): false branch +current if type (l.605): \if +current if branch (l.605): false branch +current if type (l.605): \unless\if +current if branch (l.605): true branch +current if type (l.606): \ifcat +current if branch (l.606): true branch +current if type (l.606): \unless\ifcat +current if branch (l.606): false branch +current if type (l.607): \ifcat +current if branch (l.607): false branch +current if type (l.607): \unless\ifcat +current if branch (l.607): true branch +current if type (l.608): \ifnum +current if branch (l.608): true branch +current if type (l.608): \unless\ifnum +current if branch (l.608): true branch +current if type (l.609): \ifdim +current if branch (l.609): false branch +current if type (l.609): \unless\ifdim +current if branch (l.609): true branch +current if type (l.610): \ifodd +current if branch (l.610): true branch +current if type (l.610): \unless\ifodd +current if branch (l.610): false branch +current if type (l.612): \ifvmode +current if branch (l.612): true branch +current if type (l.612): \unless\ifvmode +current if branch (l.612): false branch +current if type (l.615): \ifhmode +current if branch (l.615): true branch +current if type (l.615): \unless\ifhmode +current if branch (l.615): false branch +current if type (l.617): \ifmmode +current if branch (l.617): true branch +current if type (l.617): \unless\ifmmode +current if branch (l.617): false branch +current if type (l.619): \ifinner +current if branch (l.619): true branch +current if type (l.621): \unless\ifinner +current if branch (l.621): true branch +current if type (l.622): \ifvoid +current if branch (l.622): true branch +current if type (l.622): \unless\ifvoid +current if branch (l.622): true branch +current if type (l.623): \ifhbox +current if branch (l.623): true branch +current if type (l.623): \unless\ifhbox +current if branch (l.623): true branch +current if type (l.624): \ifvbox +current if branch (l.624): true branch +current if type (l.624): \unless\ifvbox +current if branch (l.624): true branch +current if type (l.625): \ifx +current if branch (l.625): false branch +current if type (l.625): \unless\ifx +current if branch (l.625): true branch +current if type (l.626): \ifeof +current if branch (l.626): true branch +current if type (l.626): \unless\ifeof +current if branch (l.626): false branch +current if type (l.627): \iftrue +current if branch (l.627): true branch +current if type (l.627): \unless\iftrue +current if branch (l.627): false branch +current if type (l.628): \iffalse +current if branch (l.628): false branch +current if type (l.628): \unless\iffalse +current if branch (l.628): true branch +current if type (l.629): \ifcase +current if branch (l.629): true branch +current if type (l.629): \ifcase +current if branch (l.629): false branch +current if type (l.630): \ifdefined +current if branch (l.630): true branch +current if type (l.630): \unless\ifdefined +current if branch (l.630): true branch +current if type (l.631): \ifcsname +current if branch (l.631): true branch +current if type (l.632): \unless\ifcsname +current if branch (l.632): true branch +current if type (l.633): \iffontchar +current if branch (l.633): true branch +current if type (l.633): \unless\iffontchar +current if branch (l.633): true branch +{math mode: \ifcsname: (level 41) entered on line 649} +{\unless\ifcsname: (level 42) entered on line 649} +{\iffontchar: (level 43) entered on line 650} +{\unless\iffontchar: (level 44) entered on line 650} + +### level 44: \unless\iffontchar entered on line 650 +### level 43: \iffontchar entered on line 650 +### level 42: \unless\ifcsname entered on line 649 +### level 41: \ifcsname entered on line 649 +### level 40: \unless\ifdefined entered on line 647 +### level 39: \ifdefined entered on line 647 +### level 38: \ifcase\else entered on line 646 +### level 37: \ifcase entered on line 646 +### level 36: \unless\iffalse entered on line 645 +### level 35: \iffalse\else entered on line 645 +### level 34: \unless\iftrue\else entered on line 645 +### level 33: \iftrue entered on line 645 +### level 32: \unless\ifx entered on line 644 +### level 31: \ifx\else entered on line 644 +### level 30: \unless\ifeof\else entered on line 643 +### level 29: \ifeof entered on line 643 +### level 28: \unless\ifvbox entered on line 643 +### level 27: \ifvbox entered on line 643 +### level 26: \unless\ifhbox entered on line 642 +### level 25: \ifhbox entered on line 642 +### level 24: \unless\ifvoid entered on line 642 +### level 23: \ifvoid entered on line 642 +### level 22: \unless\ifinner\else entered on line 641 +### level 21: \ifinner entered on line 641 +### level 20: \unless\ifmmode\else entered on line 641 +### level 19: \ifmmode entered on line 641 +### level 18: \unless\ifhmode\else entered on line 640 +### level 17: \ifhmode entered on line 640 +### level 16: \unless\ifvmode\else entered on line 639 +### level 15: \ifvmode entered on line 639 +### level 14: \unless\ifodd\else entered on line 638 +### level 13: \ifodd entered on line 638 +### level 12: \unless\ifdim entered on line 637 +### level 11: \ifdim\else entered on line 637 +### level 10: \unless\ifnum entered on line 637 +### level 9: \ifnum entered on line 637 +### level 8: \unless\ifcat entered on line 636 +### level 7: \ifcat\else entered on line 636 +### level 6: \unless\ifcat\else entered on line 636 +### level 5: \ifcat entered on line 636 +### level 4: \unless\if entered on line 635 +### level 3: \if\else entered on line 635 +### level 2: \unless\if\else entered on line 635 +### level 1: \if entered on line 635 + +! OK. +l.651 \showifs + % <== show 44 nested ifs + +{\fi: \unless\iffontchar (level 44) entered on line 650} +{\fi: \iffontchar (level 43) entered on line 650} +{\fi: \unless\ifcsname (level 42) entered on line 649} +{\fi: \ifcsname (level 41) entered on line 649} +Checking \iffontchar, \fontcharwd, etc.: +! Missing font identifier. + + \relax +... +l.674 \iffontchar \else + \fi % <== missing font identifie... +I was looking for a control sequence whose +current meaning has been defined by \font. + +! Missing number, treated as zero. + + \relax +... +l.674 \iffontchar \else + \fi % <== missing font identifie... +A number should have been here; I inserted `0'. +(If you can't figure out why I needed to see a number, +look up `weird error' in the index to The TeXbook.) + +! Bad character code (-1). +l.675 ...ffontchar\textfont2 -1 + \else \fi % <== bad charac... +A character number must be between 0 and 255, or KANJI code. +I changed this one to zero. + +! Bad character code (256). +l.676 \iffontchar\font 256 + \else \fi % <== bad character... +A character number must be between 0 and 255, or KANJI code. +I changed this one to zero. + +! You can't use `\fontcharwd' in vertical mode. +l.677 \fontcharwd + \fontcharht \fontchardp \fontcharic % ... +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\fontcharht' in vertical mode. +l.677 \fontcharwd \fontcharht + \fontchardp \fontcharic % ... +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\fontchardp' in vertical mode. +l.677 ...\fontcharht \fontchardp + \fontcharic % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\fontcharic' in vertical mode. +l.677 ...\fontchardp \fontcharic + % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +Font \font character A: wd=2.0pt ht=7.0pt dp=1.0pt ic=1.0pt +Font \textfont1 character B: wd=3.0pt ht=8.0pt dp=2.0pt +Font \scriptfont2 character B: wd=1.5pt ht=4.0pt dp=1.0pt +Font \scriptscriptfont3 character B: wd=6.0pt ht=16.0pt dp=4.00002pt +Font \trip character 7: +Font \trip character D does not exist +Font \nullfont character D does not exist +Font \font has 23 characters. +Font \trip has 23 characters. +Font \nullfont has 0 characters. +Checking \parshapelength, \parshapeindent, and \parshapedimen: +! You can't use `\parshapelength' in vertical mode. +l.701 \parshapelength + \parshapeindent \parshapedimen % <... +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\parshapeindent' in vertical mode. +l.701 ...elength \parshapeindent + \parshapedimen % <== can'... +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\parshapedimen' in vertical mode. +l.701 ...peindent \parshapedimen + % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +Parshape test 1 OK +Parshape test 2 OK +Parshape test 3 OK +Parshape test 4 OK +Checking \numexpr, \dimexpr, \glueexpr, and \muexpr: +! You can't use `\numexpr' in vertical mode. +l.765 \numexpr + \dimexpr \glueexpr \muexpr % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\dimexpr' in vertical mode. +l.765 \numexpr \dimexpr + \glueexpr \muexpr % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\glueexpr' in vertical mode. +l.765 ...expr \dimexpr \glueexpr + \muexpr % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\muexpr' in vertical mode. +l.765 ...mexpr \glueexpr \muexpr + % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! Missing ) inserted for expression. + + \9 +l.767 ...unt43=\numexpr ( ( 2 \9 + \dimen43=\dimexpr ... +I was expecting to see `+', `-', `*', `/', or `)'. Didn't. + +! Missing ) inserted for expression. + + \9 +l.767 ...unt43=\numexpr ( ( 2 \9 + \dimen43=\dimexpr ... +I was expecting to see `+', `-', `*', `/', or `)'. Didn't. + +! Missing ) inserted for expression. + + \9 +l.767 ...men43=\dimexpr ( 3pt \9 + +I was expecting to see `+', `-', `*', `/', or `)'. Didn't. + +\numexpr \count 43=2 +\dimexpr \dimen 43=3.0pt +\glueexpr \skip 43=4.0pt plus 3.0fil +\muexpr \muskip 43=5.0mu minus 1.0mu +{into \tracingassigns=5} +{changing \count44=0} +{into \count44=2147483647} +{changing \dimen44=0.0pt} +{into \dimen44=16383.99998pt} +{changing \count44=2147483647} +{into \count44=-2147483647} +{changing \dimen44=16383.99998pt} +{into \dimen44=-16383.99998pt} +{changing \count44=-2147483647} +{into \count44=2147450880} +{changing \dimen44=-16383.99998pt} +{into \dimen44=16383.5pt} +{changing \skip44=0.0pt} +{into \skip44=16383.99998pt} +{changing \skip44=16383.99998pt} +{into \skip44=16384.0pt} +! Dimension too large. +l.780 \dimen45=\skip44 + \dimen45=\dimexpr... +I can't work with sizes bigger than about 19 feet. +Continue and I'll use the largest value I can. + +{changing \dimen45=0.0pt} +{into \dimen45=16383.99998pt} +! Arithmetic overflow. + \9 + +l.780 ...5=\dimexpr1sp*\skip44\9 + +I can't evaluate this expression, +since the result is out of range. + +{changing \dimen45=16383.99998pt} +{into \dimen45=0.0pt} +{changing \dimen44=16383.5pt} +{into \dimen44=-16383.99998pt} +{changing \dimen44=-16383.99998pt} +{into \dimen44=-16384.0pt} +! Dimension too large. +l.782 \dimen45=\skip44 + \dimen45=\dimexpr... +I can't work with sizes bigger than about 19 feet. +Continue and I'll use the largest value I can. + +{changing \dimen45=0.0pt} +{into \dimen45=16383.99998pt} +! Arithmetic overflow. + \9 + +l.782 ...5=\dimexpr1sp*\skip44\9 + +I can't evaluate this expression, +since the result is out of range. + +{changing \dimen45=16383.99998pt} +{into \dimen45=0.0pt} +! Arithmetic overflow. + \9 + +l.783 ...4=\numexpr"7FFFFFFE+2\9 + \dimen44=\dimexpr"3FFFFFF... +I can't evaluate this expression, +since the result is out of range. + +{changing \count44=2147450880} +{into \count44=0} +! Arithmetic overflow. + \9 + +l.783 ...imexpr"3FFFFFFEsp+2sp\9 + +I can't evaluate this expression, +since the result is out of range. + +{changing \dimen44=-16384.0pt} +{into \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.784 ...=\numexpr-"7FFFFFFE-2\9 + \dimen44=\dimexpr-"3FFFFFF... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.784 ...mexpr-"3FFFFFFEsp-2sp\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.785 ...=\numexpr"10000*"8000\9 + \dimen44=\dimexpr"8000sp*"... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.785 ...\dimexpr"8000sp*"8000\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.786 ...\numexpr"10000*-"8000\9 + \dimen44=\dimexpr"8000sp*-"... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.786 ...dimexpr"8000sp*-"8000\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.787 ...\numexpr-"10000*"8000\9 + \dimen44=\dimexpr-"8000sp*"... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.787 ...dimexpr-"8000sp*"8000\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.788 ...numexpr-"10000*-"8000\9 + \dimen44=\dimexpr-"8000sp*-"... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.788 ...imexpr-"8000sp*-"8000\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.789 \count44=\numexpr0/0\9 + \dimen44=\dimexpr... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.789 ...dimen44=\dimexpr0pt/0\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.790 \count44=\numexpr1/0\9 + \dimen44=\dimexpr... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.790 ...dimen44=\dimexpr1pt/0\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +! Arithmetic overflow. + \9 + +l.791 ...\count44=\numexpr-1/0\9 + \dimen44=\dimexpr-... +I can't evaluate this expression, +since the result is out of range. + +{reassigning \count44=0} +! Arithmetic overflow. + \9 + +l.791 ...imen44=\dimexpr-1pt/0\9 + +I can't evaluate this expression, +since the result is out of range. + +{reassigning \dimen44=0.0pt} +{into \tracingassigns=5} +{changing \skip93=0.0pt} +{into \skip93=3.0pt minus 1.0fil} +{changing \skip93=3.0pt minus 1.0fil} +{into \skip93=3.0pt minus 1.0fil} +{changing \skip93=3.0pt minus 1.0fil} +{into \skip93=3.0pt minus 1.0fil} +{reassigning \skip93=3.0pt minus 1.0fil} +{changing \skip93=3.0pt minus 1.0fil} +{into \skip93=3.0pt plus 1.0fil} +{changing \skip93=3.0pt plus 1.0fil} +{into \skip93=3.0pt plus 1.0fil} +{reassigning \skip93=3.0pt plus 1.0fil} +{changing \skip93=3.0pt plus 1.0fil} +{into \skip93=2.0pt plus -1.0fil minus 1.0fil} +{changing \skip93=2.0pt plus -1.0fil minus 1.0fil} +{into \skip93=2.0pt plus -1.0fil minus 1.0fil} +{reassigning \skip93=2.0pt plus -1.0fil minus 1.0fil} +{changing \skip93=2.0pt plus -1.0fil minus 1.0fil} +{into \skip93=0.0pt plus 1.0fil minus 1.0fil} +{changing \skip93=0.0pt plus 1.0fil minus 1.0fil} +{into \skip93=1.0pt plus 2.0fil minus 1.0fil} +{changing \skip93=1.0pt plus 2.0fil minus 1.0fil} +{into \skip93=5.0pt minus 1.0fil} +Expr quotient rounding 1 OK +Expr quotient rounding 2 OK +Expr quotient rounding 3 OK +Expr quotient rounding 4 OK +! Incompatible glue units. + \9 + +... +l.831 \15{32}{5}{6} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + + p +... +l.831 \15{32}{5}{6} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + \relax + +... +l.831 \15{32}{5}{6} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +Expr quotient rounding 5 OK +! Incompatible glue units. + \9 + +... +l.832 \16{33}{5}{7} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + + p +... +l.832 \16{33}{5}{7} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + \relax + +... +l.832 \16{33}{5}{7} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +Expr quotient rounding 6 OK +! Incompatible glue units. + \9 + +... +l.833 \17{25}{4}{6} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + + p +... +l.833 \17{25}{4}{6} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + \relax + +... +l.833 \17{25}{4}{6} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +Expr quotient rounding 7 OK +! Incompatible glue units. + \9 + +... +l.834 \18{26}{4}{7} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + + p +... +l.834 \18{26}{4}{7} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. + \relax + +... +l.834 \18{26}{4}{7} + % <== three mu_error's (! Incompatibl... +I'm going to assume that 1mu=1pt when they're mixed. + +Expr quotient rounding 8 OK +Expr fraction rounding 1 OK +Expr fraction rounding 2 OK +! Arithmetic overflow. + + = +\1...\fi \ifdim \dimexpr 1sp*#6= + \dimexpr (#3sp)*(#4)/(#5)\els... +l.862 ...1 "7FFFFFFF 2 "40000000 + +I can't evaluate this expression, +since the result is out of range. + +! Arithmetic overflow. + \relax + + + \else +\1...expr (#3sp)*(#4)/(#5)\else + \2#2 \fi +l.862 ...1 "7FFFFFFF 2 "40000000 + +I can't evaluate this expression, +since the result is out of range. + +Expr fraction rounding 3 OK +[1] +Memory usage before: 58&322; after: 48&322; still untouched: 1170 +[1] +Memory usage before: 58&322; after: 48&322; still untouched: 1170 +Checking \mutoglue and \gluetomu: +! You can't use `\mutoglue' in vertical mode. +l.905 \mutoglue + \gluetomu % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\gluetomu' in vertical mode. +l.905 \mutoglue \gluetomu + % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! Incompatible glue units. +l.907 ...kip2=\gluetomu\muskip1 + % <== two mu_error's (! Inco... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. +l.907 ...kip2=\gluetomu\muskip1 + % <== two mu_error's (! Inco... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. +l.908 ...uskip2=\mutoglue\skip1 + % <== two mu_error's (! Inco... +I'm going to assume that 1mu=1pt when they're mixed. + +! Incompatible glue units. +l.908 ...uskip2=\mutoglue\skip1 + % <== two mu_error's (! Inco... +I'm going to assume that 1mu=1pt when they're mixed. + +{into \tracingassigns=1} +{changing \skip1=9.0pt} +{into \skip1=1.0pt plus -2.0pt minus -3.0fil} +{changing \muskip1=9.0mu} +{into \muskip1=1.0mu plus -2.0mu minus -3.0fil} +{changing \skip2=9.0pt} +{into \skip2=-4.0pt plus 5.0fill minus 6.0filll} +{changing \muskip2=9.0mu} +{into \muskip2=-4.0mu plus 5.0fill minus 6.0filll} +{changing \skip3=0.0pt} +{into \skip3=-1.0pt plus 2.0pt minus 3.0fil} +{changing \muskip3=0.0mu} +{into \muskip3=-1.0mu plus 2.0mu minus 3.0fil} +{changing \skip4=0.0pt} +{into \skip4=4.0pt plus -5.0fill minus -6.0filll} +{changing \muskip4=0.0mu} +{into \muskip4=4.0mu plus -5.0fill minus -6.0filll} +Checking (mu)glue identity: +{changing \1=undefined} +{into \1=\relax} +{changing \1=\relax} +{into \1=\skip65535} +{changing \skip65535=0.0pt} +{into \skip65535=7.0pt} +{changing \2=undefined} +{into \2=\relax} +{changing \2=\relax} +{into \2=\muskip32766} +{changing \muskip32766=0.0mu} +{into \muskip32766=7.0mu} +{changing \tracingassigns=1} +{into \tracingassigns=458752} +{reassigning \skip65535=7.0pt} +{reassigning \muskip32766=7.0mu} +{changing \tracingassigns=458752} +Checking \gluestretchorder, \glueshrinkorder, \gluestretch, and \glueshr +ink: +! You can't use `\gluestretchorder' in vertical mode. +l.932 \gluestretchorder + \gluestretch % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\gluestretch' in vertical mode. +l.932 ...retchorder \gluestretch + % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\glueshrinkorder' in vertical mode. +l.933 \glueshrinkorder + \glueshrink % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +! You can't use `\glueshrink' in vertical mode. +l.933 ...shrinkorder \glueshrink + % <== can't use +Sorry, but I'm not programmed to handle this case; +I'll just pretend that you didn't ask for it. +If you're in the wrong mode, you might be able to +return to the right one by typing `I}' or `I$' or `I\par'. + +Checking sparse arrays: +! Bad register code (-1). + + \countdef +... +l.970 \2\countdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + \countdef +... +l.970 \2\countdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +\count65535=0. +! Bad register code (-1). + + \dimendef +... +l.971 \2\dimendef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + \dimendef +... +l.971 \2\dimendef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +\dimen65535=0.0pt. +! Bad register code (-1). + + \skipdef +... +l.972 \2\skipdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + \skipdef +... +l.972 \2\skipdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +\skip65535=0.0pt. +! Bad register code (-1). + + \muskipdef +... +l.973 \2\muskipdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + \muskipdef +... +l.973 \2\muskipdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +\muskip65535=0.0mu. +! Bad register code (-1). + + \toksdef +... +l.974 \2\toksdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + \toksdef +... +l.974 \2\toksdef + % Bad register code (-1) ...and (65536). +A register number must be between 0 and 65535. +I changed this one to zero. + +\toks65535=. +> \9=\dimen256. +l.981 ...8 \let\8=\relax \show\9 + + +{restoring \9=undefined} +{restoring \8=undefined} +{restoring \skip22=0.0pt} +{restoring \dimen21=0.0pt} +{restoring \muskip2200=0.0mu} +{restoring \dimen2100=0.0pt} +{restoring \count2000=0} +{restoring \count20=0} +testing count registers ... +{into \tracingassigns=1} +{reassigning \count2000=0} +{restoring \tracingassigns=0} +\count2000=0, + \count2001=5, + \count2002=7, + \count2002=7. +\count2000=5, + \count2002=12, + \count2002=12. +\count2000=50, + \count2002=120, + \count2002=120. +\count2000=10, + \count2002=24, + \count2002=24. +{into \tracingassigns=1} +{globally changing \count2002=24} +{into \count2002=5} +{changing \count2002=5} +{into \count2002=7} +{globally changing \count2002=7} +{into \count2002=0} +{restoring \tracingassigns=0} +{restoring \1=undefined} +{retaining \count2002=0} +{restoring \count2000=0} +{retaining \count2002=0} +{restoring \count2001=0} +testing dimen registers ... +{into \tracingassigns=1} +{reassigning \dimen2000=0.0pt} +{restoring \tracingassigns=0} +\dimen2000=0.0pt, + \dimen2001=2.5pt, + \dimen2002=3.5pt, + \dimen2002=3.5pt. +\dimen2000=2.5pt, + \dimen2002=6.0pt, + \dimen2002=6.0pt. +\dimen2000=25.0pt, + \dimen2002=60.0pt, + \dimen2002=60.0pt. +\dimen2000=5.0pt, + \dimen2002=12.0pt, + \dimen2002=12.0pt. +{into \tracingassigns=1} +{globally changing \dimen2002=12.0pt} +{into \dimen2002=2.5pt} +{changing \dimen2002=2.5pt} +{into \dimen2002=3.5pt} +{globally changing \dimen2002=3.5pt} +{into \dimen2002=0.0pt} +{restoring \tracingassigns=0} +{restoring \1=undefined} +{retaining \dimen2002=0.0pt} +{restoring \dimen2000=0.0pt} +{retaining \dimen2002=0.0pt} +{restoring \dimen2001=0.0pt} +testing skip registers ... +{into \tracingassigns=1} +{reassigning \skip2000=0.0pt} +{restoring \tracingassigns=0} +\skip2000=0.0pt, + \skip2001=2.5pt plus 1.0fil, + \skip2002=3.5pt minus 1.0fill, + \skip2002=3.5pt minus 1.0fill. +\skip2000=2.5pt plus 1.0fil, + \skip2002=6.0pt plus 1.0fil minus 1.0fill, + \skip2002=6.0pt plus 1.0fil minus 1.0fill. +\skip2000=25.0pt plus 10.0fil, + \skip2002=60.0pt plus 10.0fil minus 10.0fill, + \skip2002=60.0pt plus 10.0fil minus 10.0fill. +\skip2000=5.0pt plus 2.0fil, + \skip2002=12.0pt plus 2.0fil minus 2.0fill, + \skip2002=12.0pt plus 2.0fil minus 2.0fill. +{into \tracingassigns=1} +{globally changing \skip2002=12.0pt plus 2.0fil minus 2.0fill} +{into \skip2002=2.5pt plus 1.0fil} +{changing \skip2002=2.5pt plus 1.0fil} +{into \skip2002=3.5pt minus 1.0fill} +{globally changing \skip2002=3.5pt minus 1.0fill} +{into \skip2002=0.0pt} +{restoring \tracingassigns=0} +{restoring \1=undefined} +{retaining \skip2002=0.0pt} +{restoring \skip2000=0.0pt} +{retaining \skip2002=0.0pt} +{restoring \skip2001=0.0pt} +testing muskip registers ... +{into \tracingassigns=1} +{reassigning \muskip2000=0.0mu} +{restoring \tracingassigns=0} +\muskip2000=0.0mu, + \muskip2001=2.5mu plus 1.0fil, + \muskip2002=3.5mu minus 1.0fill, + \muskip2002=3.5mu minus 1.0fill. +\muskip2000=2.5mu plus 1.0fil, + \muskip2002=6.0mu plus 1.0fil minus 1.0fill, + \muskip2002=6.0mu plus 1.0fil minus 1.0fill. +\muskip2000=25.0mu plus 10.0fil, + \muskip2002=60.0mu plus 10.0fil minus 10.0fill, + \muskip2002=60.0mu plus 10.0fil minus 10.0fill. +\muskip2000=5.0mu plus 2.0fil, + \muskip2002=12.0mu plus 2.0fil minus 2.0fill, + \muskip2002=12.0mu plus 2.0fil minus 2.0fill. +{into \tracingassigns=1} +{globally changing \muskip2002=12.0mu plus 2.0fil minus 2.0fill} +{into \muskip2002=2.5mu plus 1.0fil} +{changing \muskip2002=2.5mu plus 1.0fil} +{into \muskip2002=3.5mu minus 1.0fill} +{globally changing \muskip2002=3.5mu minus 1.0fill} +{into \muskip2002=0.0mu} +{restoring \tracingassigns=0} +{restoring \1=undefined} +{retaining \muskip2002=0.0mu} +{restoring \muskip2000=0.0mu} +{retaining \muskip2002=0.0mu} +{restoring \muskip2001=0.0mu} +testing toks registers ... +{into \tracingassigns=1} +{reassigning \toks2000=} +{restoring \tracingassigns=0} +\toks2000=, + \toks2001=a b c, + \toks2002=d e f, + \toks2002=d e f. +{into \tracingassigns=1} +{reassigning \toks20=} +{changing \toks21=} +{into \toks21=a b c} +{changing \toks2100=} +{into \toks2100=d e f} +{changing \toks2002=d e f} +{into \toks2002=} +{changing \toks2002=} +{into \toks2002=a b c} +{reassigning \toks2200=} +{changing \toks2200=} +{into \toks2200=a b c} +{changing \toks2002=a b c} +{into \toks2002=} +{changing \toks2002=} +{into \toks2002=a b c} +{changing \toks2200=a b c} +{into \toks2200=} +{changing \toks2200=} +{into \toks2200=a b c} +{changing \toks30=} +{into \toks30=a b c} +{changing \toks30=a b c} +{into \toks30=} +{changing \toks30=} +{into \toks30=a b c} +{changing \toks3000=} +{into \toks3000=a b c} +{changing \toks3000=a b c} +{into \toks3000=} +{changing \toks3000=} +{into \toks3000=a b c} +{restoring \toks30=} +{restoring \toks3000=} +{restoring \toks2200=} +{restoring \toks2002=d e f} +{restoring \toks2100=} +{restoring \toks21=} +{restoring \tracingassigns=0} +{into \tracingassigns=1} +{globally changing \toks2002=d e f} +{into \toks2002=a b c} +{changing \toks2002=a b c} +{into \toks2002=d e f} +{globally changing \toks2002=d e f} +{into \toks2002=} +{restoring \tracingassigns=0} +{restoring \1=undefined} +{retaining \toks2002=} +{retaining \toks2002=} +{restoring \toks2001=} +testing box registers ... +! Bad mathchar (-1). + + \mathchardef +... +l.1023 \2\mathchardef + % Bad mathchar (-1) ...and (32768). +A mathchar number must be between 0 and 32767. +I changed this one to zero. + +! Bad mathchar (32768). + + \mathchardef +... +l.1023 \2\mathchardef + % Bad mathchar (-1) ...and (32768). +A mathchar number must be between 0 and 32767. +I changed this one to zero. + +\mathchar"7FFF=32767. +! Bad register code (-1). + + = +l.1025 \setbox-1= + \copy65536 % Bad register code (-1) ...and... +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). +l.1025 \setbox-1=\copy65536 + % Bad register code (-1) ...and... +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + = +l.1026 \global\setbox65536= + \copy-1 % Bad register code (655... +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (-1). +l.1026 ...l\setbox65536=\copy-1 + % Bad register code (65536) .... +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (65536). + + = +l.1027 \wd65536= + \ht-1 % Bad register code (65536) ...and (-1). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (-1). +l.1027 \wd65536=\ht-1 + % Bad register code (65536) ...and (-1). +A register number must be between 0 and 65535. +I changed this one to zero. + +! Bad register code (-1). +l.1028 \showbox-1 + % Bad register code (-1). +A register number must be between 0 and 65535. +I changed this one to zero. + +> \box0=void + +! OK. +l.1028 \showbox-1 + % Bad register code (-1). + + +### vtop group (level 4) entered at line 1041 (\setbox32103=\vtop to7.0p +t{) +### vbox group (level 3) entered at line 1040 (\global\setbox32102=\vbox + to5.0pt{) +### hbox group (level 2) entered at line 1039 (\setbox32101=\hbox to3.0p +t{) +### semi simple group (level 1) entered at line 1021 (\begingroup) +### bottom level + +! OK. +l.1042 \showgroups + + +{restoring \box32103=void} +> \box32100=void + +! OK. +l.1046 \showbox32100 + + +> \box32101= +\hbox(0.0+0.0)x3.0 + +! OK. +l.1047 \showbox32101 + + +\box32101=\hbox,wd=3.0pt. +\box32102=\vbox,ht=5.0pt. +\box32103=void. +\box32101=\hbox,wd=3.0pt. +\box32103=\hbox,wd=3.0pt. +\box32102=void. +\box32104=\vbox,ht=5.0pt. +\box32101=\hbox,ht=2.0pt,wd=3.0pt. +\box32102=void. +\box32103=\hbox,dp=6.0pt,wd=3.0pt. +\box32104=\vbox,ht=5.0pt,wd=8.0pt. +\box32105=\hbox,ht=1.0pt,wd=5.0pt. +\box32105=\hbox,ht=1.0pt,wd=5.0pt. +\box32105=void. +\box32105=void. +\box32106=\hbox,ht=1.0pt,wd=10.0pt. +\box32105=\vbox,ht=5.0pt,wd=1.0pt. +\box32105=\vbox,ht=5.0pt,wd=1.0pt. +\box32105=void. +\box32105=void. +\box32106=\vbox,ht=10.0pt,wd=1.0pt. +\box32105=\vbox,ht=30.0pt. +\box32106=\vbox,ht=10.0pt. +\box32105=\vbox,ht=20.0pt. +{restoring \box32106=void} +{restoring \box32105=void} +{restoring \box32104=void} +{restoring \box32103=void} +{restoring \box32101=void} +Checking \lastlinefit: +@firstpass +[] [] +@ via @@0 b=371 p=0 d=137641 +@@1: line 1.0 t=137641 -> @@0 +[] +@ via @@0 b=12 p=0 d=144 +@@2: line 1.2 t=144 -> @@0 +[] +@ via @@1 b=371 p=0 d=137641 +@@3: line 2.0 t=275282 -> @@1 +[] +@\par via @@1 b=12 p=-10000 d=144 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=144 -> @@2 + +> \box0= +\vbox(0.0+0.0)x96.0 +.\hbox(0.0+0.0)x96.0, glue set - 0.5 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x96.0, glue set 31.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1081 \lastlinefit=-1 \1 + + +> \box0= +\hbox(0.0+0.0)x96.0, glue set 31.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1081 \lastlinefit=-1 \1 + + +@firstpass +[] [] +@ via @@0 b=371 p=0 d=137641 +@@1: line 1.0 t=137641 s=31.0 g=20.0 -> @@0 +[] +@ via @@0 b=12 p=0 d=144 +@@2: line 1.2 t=144 s=-4.0 g=8.0 -> @@0 +[] +@ via @@1 b=371 p=0 d=137641 +@@3: line 2.0 t=275282 s=31.0 g=20.0 -> @@1 +[] +@\par via @@1 b=12 p=-10000 d=144 +@\par via @@2 b=2 p=-10000 d=4 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=148 s=31.0 a=-1.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x96.0 +.\hbox(0.0+0.0)x96.0, glue set - 0.5 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x96.0, glue set - 0.25 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1082 \lastlinefit=500 \1 + + +> \box0= +\hbox(0.0+0.0)x96.0, glue set - 0.25 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 32.0 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1082 \lastlinefit=500 \1 + + +@firstpass +[] [] +@ via @@0 b=371 p=0 d=137641 +@@1: line 1.0 t=137641 s=31.0 g=20.0 -> @@0 +[] +@ via @@0 b=12 p=0 d=144 +@@2: line 1.2 t=144 s=-4.0 g=8.0 -> @@0 +[] +@ via @@1 b=371 p=0 d=137641 +@@3: line 2.0 t=275282 s=31.0 g=20.0 -> @@1 +[] +@\par via @@1 b=12 p=-10000 d=144 +@\par via @@2 b=12 p=-10000 d=144 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=288 s=31.0 a=-2.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x96.0 +.\hbox(0.0+0.0)x96.0, glue set - 0.5 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x96.0, glue set - 0.5 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1083 \lastlinefit=1001 \1 + + +> \box0= +\hbox(0.0+0.0)x96.0, glue set - 0.5 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 33.0 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1083 \lastlinefit=1001 \1 + + +@firstpass +[] +@ via @@0 b=0 p=0 d=0 +@@1: line 1.2 t=0 -> @@0 +[] +@ via @@0 b=0 p=0 d=0 +@ via @@1 b=0 p=0 d=0 +@@2: line 2.2 t=0 -> @@1 +[] +@ via @@0 b=2 p=0 d=4 +@ via @@1 b=0 p=0 d=0 +@ via @@2 b=0 p=0 d=0 +@@3: line 3.2 t=0 -> @@2 +[] +@ via @@1 b=2 p=0 d=4 +@ via @@2 b=0 p=0 d=0 +@ via @@3 b=0 p=0 d=0 +@@4: line 4.2 t=0 -> @@3 +[] +@\par via @@2 b=2 p=-10000 d=4 +@\par via @@3 b=0 p=-10000 d=0 +@\par via @@4 b=0 p=-10000 d=0 +@@5: line 5.2- t=0 -> @@4 + +> \box0= +\vbox(0.0+0.0)x98.0 +.\hbox(0.0+0.0)x98.0, glue set 68.0fill [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x98.0, glue set 68.0fill [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x98.0, glue set 68.0fill [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x98.0, glue set 68.0fill [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x98.0, glue set 34.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1087 ... \lastlinefit=1000 \1 + + +> \box0= +\hbox(0.0+0.0)x98.0, glue set 34.0fill +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 plus 1.0fill + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1087 ... \lastlinefit=1000 \1 + + +@firstpass +[] [] +@ via @@0 b=449 p=0 d=201601 +@@1: line 1.0 t=201601 s=33.0 g=20.0 -> @@0 +[] +@ via @@0 b=2 p=0 d=4 +@@2: line 1.2 t=4 s=-2.0 g=8.0 -> @@0 +[] +@ via @@1 b=449 p=0 d=201601 +@@3: line 2.0 t=403202 s=33.0 g=20.0 -> @@1 +[] +@\par via @@1 b=2 p=-10000 d=4 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=4 s=33.0 a=-0.5 -> @@2 + +> \box0= +\vbox(0.0+0.0)x98.0 +.\hbox(0.0+0.0)x98.0, glue set - 0.25 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x98.0, glue set - 0.125 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1089 \lastlinefit=500 \1 + + +> \box0= +\hbox(0.0+0.0)x98.0, glue set - 0.125 +.\glue(\leftskip) 0.0 plus -1.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 33.5 +.\glue(\rightskip) 0.0 plus 1.0fill + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1089 \lastlinefit=500 \1 + + +@firstpass +[] [] +@ via @@0 b=449 p=0 d=201601 +@@1: line 1.0 t=201601 s=33.0 g=20.0 -> @@0 +[] +@ via @@0 b=2 p=0 d=4 +@@2: line 1.2 t=4 s=-2.0 g=8.0 -> @@0 +[] +@ via @@1 b=449 p=0 d=201601 +@@3: line 2.0 t=403202 s=33.0 g=20.0 -> @@1 +[] +@\par via @@1 b=2 p=-10000 d=4 +@\par via @@2 b=2 p=-10000 d=4 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=8 s=33.0 a=-1.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x98.0 +.\hbox(0.0+0.0)x98.0, glue set - 0.25 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x98.0, glue set - 0.25 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1091 \lastlinefit=1000 \1 + + +> \box0= +\hbox(0.0+0.0)x98.0, glue set - 0.25 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 34.0 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1091 \lastlinefit=1000 \1 + + +@firstpass +[] [] +@ via @@0 b=533 p=0 d=284089 +@@1: line 1.0 t=284089 -> @@0 +[] +@ via @@0 b=0 p=0 d=0 +@@2: line 1.2 t=0 -> @@0 +[] +@ via @@1 b=533 p=0 d=284089 +@@3: line 2.0 t=568178 -> @@1 +[] +@\par via @@1 b=0 p=-10000 d=0 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x100.0 +.\hbox(0.0+0.0)x100.0 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x100.0, glue set 35.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1093 \lastlinefit=0 \1 + + +> \box0= +\hbox(0.0+0.0)x100.0, glue set 35.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1093 \lastlinefit=0 \1 + + +@firstpass +[] [] +@ via @@0 b=533 p=0 d=284089 +@@1: line 1.0 t=284089 s=35.0 g=20.0 -> @@0 +[] +@ via @@0 b=0 p=0 d=0 +@@2: line 1.2 t=0 s=0.0 g=0.0 -> @@0 +[] +@ via @@1 b=533 p=0 d=284089 +@@3: line 2.0 t=568178 s=35.0 g=20.0 -> @@1 +[] +@\par via @@1 b=0 p=-10000 d=0 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=0 s=0.0 a=0.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x100.0 +.\hbox(0.0+0.0)x100.0 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x100.0, glue set 35.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1094 \lastlinefit=500 \1 + + +> \box0= +\hbox(0.0+0.0)x100.0, glue set 35.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1094 \lastlinefit=500 \1 + + +@firstpass +[] [] +@ via @@0 b=533 p=0 d=284089 +@@1: line 1.0 t=284089 s=35.0 g=20.0 -> @@0 +[] +@ via @@0 b=0 p=0 d=0 +@@2: line 1.2 t=0 s=0.0 g=0.0 -> @@0 +[] +@ via @@1 b=533 p=0 d=284089 +@@3: line 2.0 t=568178 s=35.0 g=20.0 -> @@1 +[] +@\par via @@1 b=0 p=-10000 d=0 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=0 s=0.0 a=0.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x100.0 +.\hbox(0.0+0.0)x100.0 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x100.0, glue set 35.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1095 \lastlinefit=1000 \1 + + +> \box0= +\hbox(0.0+0.0)x100.0, glue set 35.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1095 \lastlinefit=1000 \1 + + +@firstpass +[] [] +@ via @@0 b=1137 p=0 d=1292769 +@@1: line 1.0 t=1292769 s=45.0 g=20.0 -> @@0 +[] +@ via @@0 b=2 p=0 d=4 +@@2: line 1.2 t=4 s=10.0 g=40.0 -> @@0 +[] +@ via @@1 b=1137 p=0 d=1292769 +@@3: line 2.0 t=2585538 s=45.0 g=20.0 -> @@1 + [] +@\par via @@1 b=0 p=-10000 d=0 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=4 s=0.0 a=0.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x110.0 +.\hbox(0.0+0.0)x110.0, glue set 0.25 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x110.0, glue set 45.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1099 ... \lastlinefit=1000 \1 + + +> \box0= +\hbox(0.0+0.0)x110.0, glue set 45.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\glue 0.0 plus 1.0fil +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1099 ... \lastlinefit=1000 \1 + + +@firstpass +[] [] +@ via @@0 b=1137 p=0 d=1292769 +@@1: line 1.0 t=1292769 s=45.0 g=20.0 -> @@0 +[] +@ via @@0 b=2 p=0 d=4 +@@2: line 1.2 t=4 s=10.0 g=40.0 -> @@0 +[] +@ via @@1 b=1137 p=0 d=1292769 +@@3: line 2.0 t=2585538 s=45.0 g=20.0 -> @@1 +[] +@\par via @@1 b=2 p=-10000 d=4 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=4 s=45.0 a=2.5 -> @@2 + +> \box0= +\vbox(0.0+0.0)x110.0 +.\hbox(0.0+0.0)x110.0, glue set 0.25 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x110.0, glue set 0.125 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1101 \lastlinefit=500 \1 + + +> \box0= +\hbox(0.0+0.0)x110.0, glue set 0.125 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 42.5 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1101 \lastlinefit=500 \1 + + +@firstpass +[] [] +@ via @@0 b=1137 p=0 d=1292769 +@@1: line 1.0 t=1292769 s=45.0 g=20.0 -> @@0 +[] +@ via @@0 b=2 p=0 d=4 +@@2: line 1.2 t=4 s=10.0 g=40.0 -> @@0 +[] +@ via @@1 b=1137 p=0 d=1292769 +@@3: line 2.0 t=2585538 s=45.0 g=20.0 -> @@1 +[] +@\par via @@1 b=2 p=-10000 d=4 +@\par via @@2 b=2 p=-10000 d=4 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=8 s=45.0 a=5.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x110.0 +.\hbox(0.0+0.0)x110.0, glue set 0.25 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x110.0, glue set 0.25 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1102 \lastlinefit=1000 \1 + + +> \box0= +\hbox(0.0+0.0)x110.0, glue set 0.25 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 40.0 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1102 \lastlinefit=1000 \1 + + +@firstpass +[] [] +@ via @@0 b=2073 p=0 d=4297329 +@@1: line 1.0 t=4297329 -> @@0 +[] +@ via @@0 b=12 p=0 d=144 +@@2: line 1.2 t=144 -> @@0 +[] +@ via @@1 b=2073 p=0 d=4297329 +@@3: line 2.0 t=8594658 -> @@1 +[] +@\par via @@1 b=0 p=-10000 d=0 +@\par via @@2 b=0 p=-10000 d=0 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=144 -> @@2 + +> \box0= +\vbox(0.0+0.0)x120.0 +.\hbox(0.0+0.0)x120.0, glue set 0.5 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x120.0, glue set 55.0fill [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1104 \lastlinefit=0 \1 + + +> \box0= +\hbox(0.0+0.0)x120.0, glue set 55.0fill +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 0.0 plus 1.0fill +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1104 \lastlinefit=0 \1 + + +@firstpass +[] [] +@ via @@0 b=2073 p=0 d=4297329 +@@1: line 1.0 t=4297329 s=55.0 g=20.0 -> @@0 +[] +@ via @@0 b=12 p=0 d=144 +@@2: line 1.2 t=144 s=20.0 g=40.0 -> @@0 +[] +@ via @@1 b=2073 p=0 d=4297329 +@@3: line 2.0 t=8594658 s=55.0 g=20.0 -> @@1 +[] +@\par via @@1 b=12 p=-10000 d=144 +@\par via @@2 b=2 p=-10000 d=4 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=148 s=55.0 a=5.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x120.0 +.\hbox(0.0+0.0)x120.0, glue set 0.5 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x120.0, glue set 0.25 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1105 \lastlinefit=500 \1 + + +> \box0= +\hbox(0.0+0.0)x120.0, glue set 0.25 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 50.0 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1105 \lastlinefit=500 \1 + + +@firstpass +[] [] +@ via @@0 b=2073 p=0 d=4297329 +@@1: line 1.0 t=4297329 s=55.0 g=20.0 -> @@0 +[] +@ via @@0 b=12 p=0 d=144 +@@2: line 1.2 t=144 s=20.0 g=40.0 -> @@0 +[] +@ via @@1 b=2073 p=0 d=4297329 +@@3: line 2.0 t=8594658 s=55.0 g=20.0 -> @@1 +[] +@\par via @@1 b=12 p=-10000 d=144 +@\par via @@2 b=12 p=-10000 d=144 +@\par via @@3 b=0 p=-10000 d=0 +@@4: line 2.2- t=288 s=55.0 a=10.0 -> @@2 + +> \box0= +\vbox(0.0+0.0)x120.0 +.\hbox(0.0+0.0)x120.0, glue set 0.5 [] +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x120.0, glue set 0.5 [] + +! OK. +\1...nt \2\2\2\2\3\2}\showbox 0 + \setbox 0=\vbox {\unvbox 0 \s... +l.1106 \lastlinefit=1000 \1 + + +> \box0= +\hbox(0.0+0.0)x120.0, glue set 0.5 +.\hbox(0.0+0.0)x30.0 +.\glue 5.0 plus 20.0 minus 4.0 +.\hbox(0.0+0.0)x30.0 +.\penalty 10000 +.\glue(\parfillskip) 45.0 +.\glue(\rightskip) 0.0 + +! OK. +\1...tbox 0=\lastbox \showbox 0 + } +l.1106 \lastlinefit=1000 \1 + + +Checking expansion of V 2 \protected macros: +\1 (l.1115) +\1 (l.1115) +relax (l.1117) +relax (l.1117) +Checking hyphenation and \savinghyphcodes: + +Underfull \hbox (badness 10000) in paragraph at lines 1134--1134 + []\trip pp1Aqq []pp1Aqq []pp1A1qq []pp1Aqq []ppAqq + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1134--1134 + []\trip up1Aqq []up1Aqq []up1A1qq []up1Aqq []upAqq + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1134--1134 + []\trip ppB1qq []ppB1qq []ppB1qq []pp1B1qq []ppBqq + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1134--1134 + []\trip upB1qq []upB1qq []upB1qq []up1B1qq []upBqq + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1136--1136 + []\trip pp1A1qq []pp1Aqq []pp1A1qq []pp1Aqq []ppAqq + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1136--1136 + []\trip up1A1qq []up1Aqq []up1A1qq []up1Aqq []upAqq + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1136--1136 + []\trip ppB1qq []ppB1qq []ppB1qq []pp1B1qq []ppBqq + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1136--1136 + []\trip upB1qq []upB1qq []upB1qq []up1B1qq []upBqq + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1138--1138 + []\trip pp1Aqq []pp1Aqq []pp1A1qq []pp1Aqq []ppAqq + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1138--1138 + []\trip up1Aqq []up1Aqq []up1A1qq []up1Aqq []upAqq + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1138--1138 + []\trip pp1B1qq []ppB1qq []ppB1qq []pp1B1qq []ppBqq + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1138--1138 + []\trip up1B1qq []upB1qq []upB1qq []up1B1qq []upBqq + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1140--1140 + []\trip qq1app []qq1app []qqapp []qq1app []qqapp + +\hbox(7.0+1.0)x16383.99998, glue set 1635.4 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1140--1140 + []\trip qqb1pp []qqb1pp []qqb1pp []qqb1pp []qqbpp + +\hbox(8.0+2.0)x16383.99998, glue set 1634.9 [] + + +Underfull \hbox (badness 10000) in paragraph at lines 1140--1140 + []\trip qqrpp []qqrpp []qq1r1pp []qq1r1pp []qqrpp + +\hbox(0.0+0.0)x16383.99998, glue set 1634.9 [] + +Checking \savingvdiscards, \pagediscards, and \splitdiscards: +! Missing $ inserted. + + $ +... +l.1148 ...oindent$\splitdiscards + \noindent$\pagediscards} +I've inserted a begin-math/end-math symbol since I think +you left one out. Proceed, with fingers crossed. + +! Missing $ inserted. + + $ +... +l.1148 ...noindent$\pagediscards + } +I've inserted a begin-math/end-math symbol since I think +you left one out. Proceed, with fingers crossed. + +> \box27= +\vbox(0.0+0.0)x0.0 +.\hbox(0.0+0.0)x0.0 +..\mathon +..\mathoff +..\penalty 10000 +..\glue(\parfillskip) 0.0 +..\glue(\rightskip) 0.0 +.\glue(\parskip) 0.0 +.\glue(\baselineskip) 0.0 +.\hbox(0.0+0.0)x0.0 +..\mathon +..\mathoff +..\penalty 10000 +..\glue(\parfillskip) 0.0 +..\glue(\rightskip) 0.0 + +! OK. +l.1149 \showbox27 + + +> \box0= +\vbox(40.0+0.0)x0.0 +.\vbox(20.0+0.0)x0.0 +..\vbox(20.0+0.0)x0.0 +..\openout0=abc +..\penalty 0 +..\write1{write 1} +.\vbox(20.0+0.0)x0.0 +..\write2{write 2} +..\closeout3 +..\glue(\splittopskip) 0.0 +..\vbox(20.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil + +! OK. +\1...cards \box 28 } \showbox 0 + } +l.1177 \1 -1 20 + \1 0 30 \1 1 20 \1 2 30 + +> \box0= +\vbox(50.0+0.0)x0.0 +.\vbox(30.0+0.0)x0.0 +..\vbox(20.0+0.0)x0.0 +..\openout0=abc +..\penalty 0 +..\write1{write 1} +..\glue 10.0 plus 1.0 minus 1.0 +..\write2{write 2} +.\vbox(20.0+0.0)x0.0 +..\closeout3 +..\glue(\splittopskip) 0.0 +..\vbox(20.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil + +! OK. +\1...cards \box 28 } \showbox 0 + } +l.1177 \1 -1 20 \1 0 30 + \1 1 20 \1 2 30 + +> \box0= +\vbox(60.0+0.0)x0.0 +.\vbox(20.0+0.0)x0.0 +..\vbox(20.0+0.0)x0.0 +..\openout0=abc +..\penalty 0 +..\write1{write 1} +.\glue 10.0 plus 1.0 minus 1.0 +.\penalty 0 +.\kern 10.0 +.\vbox(20.0+0.0)x0.0 +..\write2{write 2} +..\closeout3 +..\glue(\splittopskip) 0.0 +..\vbox(20.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil + +! OK. +\1...cards \box 28 } \showbox 0 + } +l.1177 ... \1 0 30 \1 1 20 + \1 2 30 + +> \box0= +\vbox(60.0+0.0)x0.0 +.\vbox(30.0+0.0)x0.0 +..\vbox(20.0+0.0)x0.0 +..\openout0=abc +..\penalty 0 +..\write1{write 1} +..\glue 10.0 plus 1.0 minus 1.0 +..\write2{write 2} +.\penalty 0 +.\kern 10.0 +.\vbox(20.0+0.0)x0.0 +..\closeout3 +..\glue(\splittopskip) 0.0 +..\vbox(20.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil + +! OK. +\1...cards \box 28 } \showbox 0 + } +l.1177 ... \1 1 20 \1 2 30 + + + +### internal vertical mode entered at line 1186 +prevdepth ignored +### vertical mode entered at line 0 +### recent contributions: +\glue 0.0 plus 1.0fil +\kern 20.0 +prevdepth 0.0 + +! OK. +\1...{ \pagediscards \showlists + }} +l.1186 ...0 \vfil \kern 20 pt \1 + \penalty -1 \1 + + +### internal vertical mode entered at line 1186 +prevdepth ignored +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +\1...{ \pagediscards \showlists + }} +l.1186 ...0 pt \1 \penalty -1 \1 + + + +### internal vertical mode entered at line 1187 +prevdepth ignored +### vertical mode entered at line 0 +### recent contributions: +\glue 0.0 plus 1.0fill +\kern 2.0 +prevdepth 0.0 + +! OK. +\1...{ \pagediscards \showlists + }} +l.1187 ...1 \vfill \kern 2 pt \1 + \penalty 10 \1 + + +### internal vertical mode entered at line 1187 +\glue 0.0 plus 1.0fill +\kern 2.0 +\penalty 10 +prevdepth ignored +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +\1...{ \pagediscards \showlists + }} +l.1187 ...2 pt \1 \penalty 10 \1 + + +> \box0= +\vbox(12.0+0.0)x0.0 +.\kern 5.0 +.\penalty 0 +.\kern 7.0 +.\glue(\baselineskip) 0.0 + +! OK. + ...scards } \showbox 0 + \showbox 255 \setbox 0 = \box... +l.1192 ...box {} \penalty -10000 + + +> \box255= +\vbox(0.0+0.0)x0.0 +.\write1{} +.\write2{} +.\write3{} +.\glue(\topskip) 0.0 +.\hbox(0.0+0.0)x0.0 + +! OK. + ...wbox 0 \showbox 255 + \setbox 0 = \box 255 \global ... +l.1192 ...box {} \penalty -10000 + + + +### internal vertical mode entered at line 1193 +\penalty 10000 +prevdepth ignored +### vertical mode entered at line 0 +prevdepth 0.0 + +! OK. +\1...{ \pagediscards \showlists + }} +l.1193 \1 + + +Checking \interlinepenalties, \clubpenalties, \widowpenalties, and \disp +laywidowpenalties: +{into \tracingassigns=1} +{changing \tracingrestores=0} +{into \tracingrestores=1} +\interlinepenalties=0 +\clubpenalties=0 +\widowpenalties=0 +\displaywidowpenalties=0 +\interlinepenalties-1=0 +\interlinepenalties0=0 +\interlinepenalties5=0 +\interlinepenalties\interlinepenalties0=0 +\clubpenalties-1=0 +\clubpenalties0=0 +\clubpenalties5=0 +\clubpenalties\clubpenalties0=0 +\widowpenalties-1=0 +\widowpenalties0=0 +\widowpenalties5=0 +\widowpenalties\widowpenalties0=0 +\displaywidowpenalties-1=0 +\displaywidowpenalties0=0 +\displaywidowpenalties5=0 +\displaywidowpenalties\displaywidowpenalties0=0 +{changing \interlinepenalties=0} +{into \interlinepenalties=3 101\ETC.} +{changing \clubpenalties=0} +{into \clubpenalties=1 1} +{changing \clubpenalties=1 1} +{into \clubpenalties=4 201\ETC.} +{changing \widowpenalties=0} +{into \widowpenalties=5 301\ETC.} +{changing \displaywidowpenalties=0} +{into \displaywidowpenalties=6 401\ETC.} +\interlinepenalties=3 101 102 103 +\clubpenalties=4 201 202 203 204 +\widowpenalties=5 301 302 303 304 305 +\displaywidowpenalties=6 401 402 403 404 405 406 +\interlinepenalties-1=0 +\interlinepenalties0=3 +\interlinepenalties5=103 +\interlinepenalties\interlinepenalties0=103 +\clubpenalties-1=0 +\clubpenalties0=4 +\clubpenalties5=204 +\clubpenalties\clubpenalties0=204 +\widowpenalties-1=0 +\widowpenalties0=5 +\widowpenalties5=305 +\widowpenalties\widowpenalties0=305 +\displaywidowpenalties-1=0 +\displaywidowpenalties0=6 +\displaywidowpenalties5=405 +\displaywidowpenalties\displaywidowpenalties0=406 +{changing \interlinepenalties=3 101\ETC.} +{into \interlinepenalties=0} +{restoring \interlinepenalties=3 101\ETC.} +{changing \box0=void} +{into \box0= +\vbox(0.0+0.0)x0.0} +{restoring \box0=void} +{restoring \displaywidowpenalties=0} +{restoring \widowpenalties=0} +{restoring \clubpenalties=0} +{restoring \interlinepenalties=0} +Checking hyphenation of LR and RL segments: + +Overfull \hbox (15.0pt too wide) in paragraph at lines 1256--1256 + \trip MM1 + +\hbox(0.0+0.0)x0.0, glue set - 1.0 +.\glue 4.0 plus 2.0 minus 1.0 +.\trip M +.\trip M +.\discretionary +.\trip 1 +.\trip 7 (ligature |) +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +\trip MM + +\hbox(0.0+0.0)x0.0 +.\trip M +.\trip M +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM1[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip M +.\trip M +.\discretionary +.\trip 1 +.\trip 7 (ligature |) +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip M +.\trip M +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM1[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip M +.\trip M +.\discretionary +.\trip 1 +.\trip 7 (ligature |) +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip M +.\trip M +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM1[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip M +.\trip M +.\discretionary +.\trip 1 +.\trip 7 (ligature |) +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM[] + +\hbox(0.0+0.0)x0.0 +.\beginL +.\trip M +.\trip M +.\endL +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM1[] + +\hbox(0.0+0.0)x0.0 +.\beginR +.\trip M +.\trip M +.\discretionary +.\trip 1 +.\trip 7 (ligature |) +.\endR +.\glue(\rightskip) 0.0 + + +Overfull \hbox (12.0pt too wide) in paragraph at lines 1256--1256 +[]\trip MM[] + +\hbox(0.0+0.0)x0.0 +.\beginR +.\trip M +.\trip M +.\endR +.\penalty 10000 +.\glue(\parfillskip) 0.0 +.\glue(\rightskip) 0.0 + + ) +Here is how much of TeX's memory you used: + 19 strings out of 1692 + 145 string characters out of 8157 + 3330 words of memory out of 4500 + 463 multiletter control sequences out of 15000+0 + 3796 words of font info for 5 fonts, out of 20000 for 75 + 10 hyphenation exceptions out of 659 + 10i,15n,8p,137b,79s stack positions out of 200i,40n,60p,500b,600s + +Output written on etrip.dvi (3 pages, 220 bytes). diff --git a/Build/source/texk/web2c/euptexdir/eptrip/eptrip.tex b/Build/source/texk/web2c/euptexdir/eptrip/eptrip.tex new file mode 100644 index 00000000000..6d359151e47 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/eptrip/eptrip.tex @@ -0,0 +1,1265 @@ +%%; This is `eptrip.tex' for e-pTeX v3.141592653-2.6 as of Jan 28, 2021. +%%; +%%; This is a diabolical test file for e-pTeX, an extension of TeX82. +%%; It is not as diabolical as `trip.tex', Knuth's torture test for TeX. +%%; +%%; ==>> Do not use this TeX code and its macros as an example <<== +%%; ==>> how you can make use of the new e-TeX features! It is <<== +%%; ==>> meant to test these extensions and often uses slightly <<== +%%; ==>> wrong e-TeX input to produce errors and warnings. <<== +%%; +\catcode`\{=1\catcode`\}=2\catcode`\#=6 \let\bgroup={ \let\egroup=} +\def\etripdate {2021-01-28} +\def\texversion {3.141592653} +\def\etripversion{2.6} +% +\message{This is the e-Trip test [\etripdate] for + e-TeX v\texversion-\etripversion.} +% +% --- Make sure that e-Trip is run in e-TeX extended mode +\def\stop#1{\message{Emergency stop: #1!}} +\expandafter\ifx\csname eTeXversion\endcsname\relax + \stop{You aren't using e-TeX in extended mode} + \message{(Do not forget to give an asterisk `*' as the first non-blank} + \message{character to make e-IniTeX enter extended mode.)} + \expandafter\end +\fi +% +% --- Check for e-TeX version +\def\1.#1#2\relax{\bgroup + \edef\1{\egroup + \def\noexpand\2{\number\eTeXversion\eTeXrevision}% + \def\noexpand\1{\number\eTeXversion.#1}}\1} +\expandafter\1\eTeXrevision\relax +\message{(You are using e-TeX version/revision \2)} +\ifx\1\etripversion \else \stop{I have expected e-TeX + v\texversion-\etripversion...}\expandafter\end\fi +\let\1=\5 \let\2=\5 +% +% --- a special branch for e-IniTeX +\ifx\einitex\undefined \def\einitex{} + % + \message{e-IniTeX: Assigning category codes,} + \catcode`\$=3\catcode`\&=4 + \catcode`\^=7\catcode`\^^I=10\catcode`\_=8 + \message{tracing switches,} + \tracingstats=4\tracinglostchars=2 + \message{other codes,} + \endlinechar=`\^^M \newlinechar=`\^^J + % + \message{definitions for e-VirTeX e-Trip test run,} + \def\error{\immediate\write15{Bug in your e-TeX implementation!}% + \immediate\write15 } + \def\typeout{\immediate\write15 } + \def\empty{} \def\space{ } + % + \message{constants and registers,} + \chardef\zero=0\chardef\one=1\chardef\two=2 + \countdef\ctmp=255 \countdef\cndx=254 + % + \message{fonts,} + \fontdimen12\nullfont=13pt + \font\trip=etrip \hyphenchar\trip=`1 \trip + \textfont0=\trip \textfont1=\trip + \font\smalltrip=etrip scaled 500\relax % our symbols font + \fontdimen22\smalltrip=7pt + \textfont2=\smalltrip \scriptfont2=\smalltrip + \scriptscriptfont2=\smalltrip + \font\bigtrip=etrip at 20pt\relax % our extension font + \textfont3=\bigtrip \scriptfont3=\bigtrip + \scriptscriptfont3=\bigtrip + % + \message{some math characters,} + \delcode`\[="161361 % small (family 1, character "61 (a)), large (3,"61) + \delcode`\|="142342 % small (family 1, character "42 (B)), large (3,"42) + \delcode`\]="162362 % small (family 1, character "62 (b)), large (3,"62) + % + \message{some math parameters,} + \thinmuskip=18mu plus 3.6mu + \medmuskip=27mu plus 9mu minus 18mu + \thickmuskip=36mu minus 7.2mu + % + \message{hyphenation,} + \lefthyphenmin=2\righthyphenmin=2 + \begingroup + \def\x{\patterns{% + .pp1aqq. .up1aqq. .ppb1qq. .upb1qq. .pp1r1qq. .up1r1qq.}} + \language=0 \x \savinghyphcodes=1 + \language=1 \lccode`A=`a \lccode`B=`b \x + \language=2 \lccode`A=`r \lccode`B=`b \x + \language=3 \lccode`A=`a \lccode`B=`r \x + {\def\1{\lccode\count20=0 \ifnum\count20<255 \advance\count20 1 + \expandafter\1\fi}\count20=0 \1 + \language=4 \patterns{}} + {\lccode`B=`b \hyphenation{qqB-pp}} + \count20=\interactionmode \nonstopmode + {\setbox0\vbox{\parfillskip=0pt + \hbadness=0 \showboxdepth=0 + \hsize=16383.99999pt \pretolerance=-1 \tolerance=-1 + \trip\ ppaqq upaqq ppbqq upbqq pprqq uprqq qqbpp}} + {\lccode`B=`b \language=4 \hyphenation{-q-}} + \interactionmode=\count20 + {\lccode`B=`b \hyphenation{qq-B-pp}} + \endgroup + % + \message{enable e-TeX enhancements (TeXXeT),} + \TeXXeTstate=1 + % + \message{prepare saved items (not to be dumped),} + \bgroup \savingvdiscards=1 + \vfill \penalty 1234 % set \pagediscards + \setbox0=\vbox{\vbox to10pt{}\vskip5pt\penalty-4321} + \setbox1=\vsplit0 to10pt % set \splitdiscards + \egroup + % + \message{everyjob ...dumped.} + \everyjob={\message{e-IniTeX: e-Trip format loaded.}} + \expandafter\dump +\fi + +% +% -- Test \lostchars=1 and 2 +\begingroup + \tracingonline=0 + \setbox0=\hbox{% + \tracinglostchars=0 \nullfont a% + \tracinglostchars=1 \nullfont b% + \tracinglostchars=2 \nullfont c% + } +\endgroup +% +% -- Do the rest in silent, almost all of it: +\batchmode + +% +% -- Check that all e-TeX enhancements are switched off +\ifnum\TeXXeTstate=0 \else + \error{dumped e-TeX enhancement state registers aren't switch off} +\fi + +% +% ============================== input/output: new csnames +% +% -- Check table of equivalents and the routines |id_lookup|, +% |print_cmd_chr| for all new e-TeX control sequences +% -- Check new primitive \unexpanded (first test) +\typeout{Checking input/output of new csnames:} +\begingroup + \edef\1{% + \unexpanded{% +% --- additional e-TeX V 1 primitives + \eTeXversion \eTeXrevision \showgroups \showtokens + \tracingassigns \tracinggroups \tracingifs \tracingscantokens + \currentgrouplevel \currentgrouptype \middle \lastnodetype + \TeXXeTstate \beginL \endL \beginR \endR \predisplaydirection + \marks \topmarks \firstmarks \botmarks + \splitfirstmarks \splittopmarks + \protected \unexpanded \detokenize \scantokens \readline + \unless \ifdefined \ifcsname \everyeof \interactionmode +% --- additional e-TeX V 2 primitives + \currentiflevel \currentiftype \currentifbranch \showifs + \fontcharwd \fontcharht \fontchardp \fontcharic \iffontchar + \tracingnesting \parshapelength \parshapeindent \parshapedimen + \numexpr \dimexpr \glueexpr \muexpr \mutoglue \gluetomu + \gluestretchorder \glueshrinkorder \gluestretch \glueshrink + \savingvdiscards \pagediscards \splitdiscards + \lastlinefit \savinghyphcodes \interlinepenalties + \clubpenalties \widowpenalties \displaywidowpenalties + }% + } + +% loop through the list, count the number of csnames, +% insert the \newlinechar after the 2nd, 4th, 6th, ... + \ctmp=0\def\3{} + \def\2#1{\ifx\relax#1\else + \advance\ctmp\one + \edef\3{\unexpanded\expandafter{\3 #1}\ifodd\ctmp\else ^^J\fi}% + \expandafter\2\fi} + \expandafter\2\1\relax + \typeout{e-TeX Version \number\eTeXversion\space has + \number\ctmp\space new csnames:}% + \show\3\endgroup + +% +% ============================== create and output nodes +% +% -- Check |new_...| routines and |short_display|, |show_node_list| +% for all new e-TeX node types and subtypes +% -- Check for new primitives disabled when read. +\typeout{Checking creation and printing for new node types:} +\tracingonline=1 +\showboxbreadth=255\showboxdepth=255 +\begingroup + \setbox0=\vbox{\hsize=0pt\TeXXeTstate=1\relax + %% []\trip a[]b[]p$q [] t$u[][] % <== \endR\endL at end + a\beginL b\beginR p$q\left[\mathpunct{r}\middle|s\right]t$u + %% \trip aMb + $$aMb$$ % \hbox ..., display + %% [][]\trip p[]q$st$u[] % <== \beginL\beginR at beginning + p\endR q\mathsurround=12.3pt$st$u % <== \endL at end + %% \trip rMs + $$rMs$$ % \hbox ..., display + %% []\trip tp[]u % <== \beginL at beginning + tp\endL u + %% \trip rMs + $$rMs$$ % \hbox ..., display + %% \trip tp % <== no \mark(s), no \(begin/end)(L/R)! + tp\mark{0old}\marks0{0}\marks1{1}\marks15{15}\marks65535{65535}% + \marks-1{-1}\marks65536{65536}% Bad register (-1) ...and (65536). + \TeXXeTstate=0\relax + \beginL\beginR\endL\endR % Improper \(begin/end)(L/R) + }\showbox0 +\endgroup + +% +% +% ============================== \interactionmode +% +% -- Check new special register \interactionmode +\typeout{Checking \string\interactionmode:} +\begingroup \ctmp=\interactionmode % save current value +\nonstopmode +% test inquiry using \interactionmode +\def\3{\typeout{current interactionmode (l.\number\inputlineno): + \ifcase\interactionmode batch\or nonstop\or scroll\or + errorstop\else UNKNOWN!\fi}} +\def\1#1{\relax\ifnum#1=\interactionmode \3 \else + \typeout{wrong interactionmode: + \number\interactionmode\space should be \number#1!}\fi} +\batchmode \1 0 +\nonstopmode \1 1 +\scrollmode \1 2 +\errorstopmode \1 3 +% test setting |interaction_mode| using this special register +\def\2#1{\interactionmode=#1\relax \1{#1}} + \nonstopmode + % generate two errors: + \interactionmode=-1 \1 1 % nonstop + \interactionmode=4 \1 1 % nonstop +\2 2 \2 2 \2 1 \2 1 \2 3 \2 3 \2 0 \2 0 +\1 0{\interactionmode=3}\1 3 % global assignment! +% Test for the correct call of |new_interaction|, i.e. +% correct setting of |selector|: +\interactionmode=1 \message{1 (l.\number\inputlineno)}% log+term +\interactionmode=0 \message{0 (l.\number\inputlineno)}% log only +\interactionmode=1 \message{1 (l.\number\inputlineno)}% log+term +% Some tests with TeX's old command and register assignments +\batchmode \1 0 \2 3 \scrollmode \1 2 \2 1 +\2 \ctmp +\endgroup + +% +% -- Check \tracingifs +\typeout{Checking \string\tracingifs:} +\begingroup + \def\1#1\1{\def\2{#1\iffalse \else \fi}#1\iftrue \2\else \2\fi} + \tracingifs=1 + \1\1 + \1\unless\1 + \tracingcommands=2 + \ifdefined\hbox \unless\ifdefined\abc \ifcase 2 \or \or + \ifcsname hbox\endcsname \ifcsname abc\endcsname \abc \else + \ifx\abc\relax \else \ifx\abc\relax \fi \fi \fi \fi \or\fi \fi \fi +\endgroup +% +% -- Check \tracingassigns +\typeout{Checking \string\tracingassigns:} +\begingroup + \tracingrestores=1 \tracingassigns=1 + \global\font\6=etrip at 11pt \font\6=etrip at 11pt + \global\count17=7 \count17=7 + \global\def\9{\relax} \global\let\8=\9 \let\8=\9 + \bgroup + \global\font\5=etrip at 12pt \font\5=etrip at 12pt \let\4=\5 + \global\count17=0 \count17=0 + \global\let\9=\7 \global\let\8=\9 \let\8=\9 + \egroup +\endgroup + +% +% -- Check \currentgrouptype, \currentgrouplevel, and \lastnodetype +\typeout{Checking \string\currentgrouptype, + \string\currentgrouplevel, and \string\lastnodetype:} +\typeout{current group level (l.\number\inputlineno): + \ifcase\currentgrouplevel outer level\else BAD!\fi} +\typeout{current group type (l.\number\inputlineno): + \ifcase\currentgrouptype bottom level\else BAD!\fi} +\begingroup + \def\4{\typeout{current group type (l.\number\inputlineno): + \ifcase\currentgrouptype bottom level\or simple group\or + hbox group\or adjusted hbox group\or vbox group\or + vtop group\or align group\or no align group\or + output group\or math group\or disc group\or + insert group\or vcenter group\or math choice group\or + semi simple group\or math shift group\or + math left group\else UNKNOWN!\fi}} + \def\1 #1 {\relax\ifnum#1=\currentgrouptype \4\else + \typeout{wrong current group type: + \number\currentgrouptype\space should be #1!}\fi} + \def\5{\edef\6{\ifcase\lastnodetype char node\or hlist node\or + vlist node\or rule node\or ins node\or mark node\or + adjust node\or ligature node\or disc node\or whatsit node\or + math node\or glue node\or kern node\or penalty node\or + unset node\or math mode node\else + \ifnum-1=\lastnodetype empty\else UNKNOWN!\fi\fi}% + \typeout{last node type (l.\number\inputlineno): \6}} + \def\2 #1 {\relax\ifnum#1=\lastnodetype \5\else + \edef\6{\number\lastnodetype}% + \typeout{wrong last node type: \6 should be #1!}\fi} + \def\3 #1 {\relax\ifnum#1=\currentgrouplevel \else + \typeout{wrong current group level: + \number\currentgrouplevel\space should be #1!}\fi} + \tracinggroups=1 + \1 14 % semi simple group + \3 1 % group level 1 + \setbox0=\vbox{\1 4 % vbox group + \hbox{\1 3 % adjusted hbox group + {\1 1 % simple group + }\2 -1 % empty list + \hbox{\1 2 % hbox group + \discretionary{\1 10 }{\1 10 }{\1 10 % disc group + \3 5 % group level 5 + }\2 8 % disc node + A\2 0 % char node + AA\2 7 % ligature node + \insert27{\1 11 % insert group + }\2 4 % ins node + \vadjust{\1 11 % insert group + }\2 6 % adjust node + \mark{}\2 5 % mark node + \vrule \2 3 % rule node + \hfil \2 11 % glue node + \kern 0pt\2 12 % kern node + \penalty 0\2 13 % penalty node + \vtop{\1 5 % vtop group + }\2 2 % vlist node + \write5{}\2 9 % whatsit node + $\1 15 % math shift group + {\1 9 % math group + } + $\2 10 % math node + \TeXXeTstate=1\beginR\2 10 % math node + \endR\2 10 % math node + \valign{#\cr\1 6 % two align groups + \cr\noalign{\1 7 % no align agroup + \2 14 % unset node + } + } + } + }\2 1 % hlist node + $$\1 15 % math shift group + \2 -1 % empty list + \mathchoice{\1 13 }{\1 13 }{\1 13 }{\1 13 % math choice group + \vcenter{\1 12 % vcenter group + }\2 15 % math mode node + }\2 15 % math mode node + \left.\1 16 % math left group + \middle.\1 16 % math left group + \middle.\1 16 % math left group + \right. + $$ + } + \output={\1 8 % output group + \setbox0=\box255 + \setbox0=\vbox{ % vbox group % this is definitely weird! + \hbox spread 5pt{\hfil % adjusted hbox group + \raise5pt\hbox{ % hbox group + { %simple group + \valign{#\cr % two align groups + \noalign{ % no align group + $ % math shift group + \vtop{ % vtop group + $$ % math shift group + { % math group + \left.\middle. % math left group + \mathchoice{}{}{ % math choice group + \vcenter to 7pt{\vss % vcenter group + \noindent\vadjust{ % insert group + \discretionary{}{% disc group + \showgroups % show all of them + }{} + } + } + }{} + \right. + } + $$ + } + $ + } + } + } + } + } + } + } + \hbox{}\vfil\penalty-10000 + \deadcycles=0 +\endgroup + +% +% -- Check expansion of \protected macros +\typeout{Checking expansion of \string\protected\space macros:} +\begingroup + \protected\def\2{} \show\2 + \let\3=\2 \show\3 + \protected\unexpanded\bgroup\2\protected\3\protected\def\1{\2}} \show\1 + \tracingmacros=1 + \message{\expandafter\1\1} + \typeout{\expandafter\1\1} + \setbox0=\vbox{\special{\expandafter\1\1}} \showbox0 + \edef\5{\expandafter\1\1} \show\5 + \setbox0=\vbox{\halign{#\1&#\span\1\cr + \protected\def\1{\3}&\protected\def\1{\3}\cr}} +\endgroup + +% +% -- Check \scantokens, \tracingscantokens, \readline, and \everyeof +\typeout{Checking \string\scantokens, \string\tracingscantokens, + \string\readline, and \string\everyeof:} +\begingroup + \newlinechar=`\^^J + \def\1{\endgroup ^^J\fi ^^J\bgroup ^^J\iffalse \else} + \tracingoutput=1 + \shipout\vbox{\global\advance\count\zero by\one + \openout1=\jobname.out + \write1{\unexpanded\expandafter{\1}} + \closeout1} + \begingroup \iftrue \input\jobname.out \egroup \fi + \begingroup \iftrue \scantokens\expandafter{\1} \egroup \fi + \errorcontextlines=1000 \tracingscantokens=1 + \begingroup + \tracingnesting=1 + \begingroup \iftrue \scantokens\expandafter{\1} \egroup \fi + \tracingnesting=2 + \begingroup \unless\iffalse \scantokens\expandafter{\1} \egroup \fi +% and now a really weird (although legitimate) combination + \setbox0=\hbox\bgroup + \unless\iftrue\else + \scantokens{\hbox\bgroup^^J\ifcase0^^J\tracingscantokens=0^^J + \newlinechar=`\^^Z + \scantokens{\egroup^^Z\else\fi^^Z\def\1{\egroup\fi}^^Z\1^^Z^^J + \setbox0=\vtop\bgroup^^Z\ifnum0=0^^Z$$^^Z\ifinner\else^^Z + \csname iffalse\endcsname^^J + }^^J % end of inner scantokens + $$^^J\fi + } % end of outer \scantokens + \egroup + \else\fi + \endgroup + \begingroup \iftrue \let\9=\endgroup \def\endgroup{\9\9} + \input\jobname.out \egroup \fi + \begingroup \iftrue \let\9=\endgroup \def\endgroup{\9\9} + \scantokens\expandafter{\1} \egroup \fi + + \edef\1{\scantokens{\begingroup} % <== error + \everyeof={\noexpand} + \edef\1{\scantokens{\begingroup}\endgroup} % <== OK + \errorcontextlines=100 + \def\2{\begingroup\scantokens{\message{level=\the\currentgrouplevel}}% + \endgroup} + \bgroup\bgroup\bgroup \edef\1{\egroup\egroup\egroup + \everyeof={\noexpand\ifnum\number\currentgrouplevel + \unexpanded{>\currentgrouplevel\2\else\9\fi}}}\1\2 + + \openin7=\jobname.out + \bgroup + \def\1{\unless\ifeof7\readline7to\2% + \endlinechar=-\one\2\expandafter\1\fi} + \tracingcommands=2 \tracingrestores=1 \tracingassigns=1 + \setbox25=\hbox{\1\showlists} + \egroup + +\endgroup + +% +% -- Check \marks etc., \showtokens, and \detokenize +\typeout{Checking \string\marks\space etc., \string\showtokens, and + \string\detokenize:} +\begingroup + \newlinechar=`\^^J + \def\4{\message{Current marks:\9^^J}} + \def\3#1{\edef\9{\9^^J \detokenize{#1}=\detokenize\expandafter{#1}.}} + \def\2#1 {\3{\splitfirstmarks#1}\3{\splitbotmarks#1}} + \def\0{\let\9=\empty} + \def\7{\penalty0\vskip40pt} + \def\1{\0\20 \21 \23 \4} + \setbox0=\vbox{% + \marks0{0-1}\marks1{1-1}\vskip1pt\vbox to9pt{} + \mark{0-2}\marks3{}\hbox{}\vskip5pt\vfil\7 + \marks0{0-3}\vskip1pt\vbox to19pt{}\marks3{3-3}\vskip3ptplus1fil\7 + \vbox to30pt{}\vfil\7\hbox to10pt{}} + \setbox4=\copy0 + \1 \showbox0 \let\5=\3 \def\3#1{\showtokens\expandafter{#1}\5{#1}} + \setbox1=\vsplit0to17pt + \1 \showbox1 \showbox0 \let\3=\5 + \setbox1=\vsplit0to27pt + \1 \showbox1 \showbox0 + \setbox1=\vsplit0to37pt + \1 \showbox1 \showbox0 + \def\2#1 {\3{\topmarks#1}\3{\firstmarks#1}\3{\botmarks#1}} + \vsize=35pt \output{\1 \showbox255 \setbox0=\box255}\1 + \unvbox4\marks0{}\marks1{}\marks3{}\vfil\penalty-10000 + \hbox{}\marks0{}\marks1{}\marks3{}\vfil\penalty-10000 + \hbox{}\vfil\penalty-10000 % reclaim sparse array memory! + \deadcycles=0 +\endgroup + +% +% -- Check \middle +\typeout{Checking \string\middle:} +\begingroup + \scriptfont1=\textfont1 \scriptscriptfont1=\scriptfont1 + \setbox0=\vbox{\middle \par \right \par} % <== 8 errors + \setbox0=\hbox{% + $ + \left[p + \left[q + \over r + \left[p + \middle|q + \middle|q + \left[p + \middle|q + \middle|q + \over r\showlists + \right]\showlists + \right]\showlists + \right]\showlists + \right]\showlists + $\showlists + } + \setbox0=\hbox{$\displaystyle + \left[\scriptstyle\middle|\mathchoice{p}{q}{r}{s} + \raise16.5pt\hbox{}\right]$\showlists} + \setbox0=\hbox{$\scriptscriptstyle + \left[\displaystyle\lower3pt\hbox{}\middle|\mathchoice{p}{q}{r}{s} + \right]$\showlists} +\endgroup + +% +% -- Check TeX--XeT's new primitives +\typeout{Checking TeX--XeT enhancements:} +\begingroup +% -- incorrect matching & conversion +% (extra `endL/R' nodes are converted to `kern 0.0' nodes) + \setbox0=\vbox{\TeXXeTstate=1 + \parfillskip=0pt plus1fil\hsize=10pt\parindent=.5pt + \beginL\kern1pt\par + \beginR\kern2pt\par + \beginL\beginR\kern3pt\penalty0\hbox{}\kern3pt\endL\endR\endL\par + \endL\kern4pt\endR\par} + \showbox0 +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% STILL INCOMPLETE!!! +% %%%%% Missing: Test for functionality of all new primitives +% \TeXXeTstate \beginL \endL \beginR \endR \predisplaydirection +% %%%%% +\endgroup + +% +% -- Check optimized \aftergroup +\typeout{Checking optimized \string\aftergroup:} +\begingroup + \errorcontextlines=1000 + {{\aftergroup\x\aftergroup}\aftergroup{\aftergroup\relax}} +\endgroup + +% +% -- Check \showifs, \currentiftype, \currentiflevel, and \currentifbranch +\typeout{Checking \string\showifs, \string\currentiftype, + \string\currentiflevel, and \string\currentifbranch:} +\begingroup + \def\1{ !BAD} \edef\2{ \ifnum0=\currentifbranch OK\else!BAD\fi} + \iftrue \expandafter \ifnum \number\currentifbranch=1 + \iffalse \else \expandafter \ifnum \number\currentifbranch=-1 + \ifnum \currentifbranch=0 \let\1=\2 \fi \fi \fi \fi \fi + \message{\string\currentifbranch \1} + \def\1 #1 {\edef\2{\number\currentiflevel}% + \ifnum\2=#1 + \typeout{current if level (l.\number\inputlineno): \number\2}% + \else + \typeout{wrong current if level: \2\space should be #1!}% + \fi} + \1 0 % if level 0 + \iftrue \1 1 % if level 1 + \iftrue \1 2 % if level 2 + \fi + \fi + \def\1 #1 #2 {\edef\2{\number\currentiftype}% + \edef\3{\number\currentifbranch}% + \ifnum\2=#1 \4\else + \typeout{wrong current if type: \2\space should be #1!}\fi + \ifnum\3=#2 \5\else + \typeout{wrong current if branch: \3\space should be #2!}\fi} + \def\4{\typeout{current if type (l.\number\inputlineno): + \ifnum\2<0 \string\unless\6{-\2}\else\6{\2}\fi}} + \def\5{\typeout{current if branch (l.\number\inputlineno): + \ifnum\3>0 true\else \ifnum\3<0 false\else + \ifnum0=\3 no\else !UNKNOWN\fi\fi\fi\space branch}} + \def\6#1{\string\if \ifcase#1!NONE\or \or cat\or num\or dim\or odd\or + vmode\or hmode\or mmode\or inner\or void\or hbox\or vbox\or x\or + eof\or true\or false\or case\or defined\or csname\or fontchar\else + !UNKNOWN\fi} + \1 0 0 + \if00 \1 1 1 \fi \unless\if00 \else \1 -1 -1 \fi + \if0a \else \1 1 -1 \fi \unless\if0a \1 -1 1 \fi + \ifcat00 \1 2 1 \fi \unless\ifcat00 \else \1 -2 -1 \fi + \ifcat0a \else \1 2 -1 \fi \unless\ifcat0a \1 -2 1 \fi + \ifnum1=1 \1 3 1 \fi \unless\ifnum1<1 \1 -3 1 \fi + \ifdim1pt=2pt \else \1 4 -1 \fi \unless\ifdim1pt>2pt \1 -4 1 \fi + \ifodd5 \1 5 1 \fi \unless\ifodd5 \else \1 -5 -1 \fi + \setbox2=\vbox{ + \ifvmode \1 6 1 \fi \unless\ifvmode \else \1 -6 -1 \fi + } \setbox0=\box2 + \setbox1=\hbox{ + \ifhmode \1 7 1 \fi \unless\ifhmode \else \1 -7 -1 \fi + $ + \ifmmode \1 8 1 \fi \unless\ifmmode \else \1 -8 -1 \fi + $ + \ifinner \1 9 1 \fi + } + \unless\ifinner \1 -9 1 \fi + \ifvoid2 \1 10 1 \fi \unless\ifvoid0 \1 -10 1 \fi + \ifhbox1 \1 11 1 \fi \unless\ifhbox2 \1 -11 1 \fi + \ifvbox0 \1 12 1 \fi \unless\ifvbox1 \1 -12 1 \fi + \ifx\abc\relax \else \1 13 -1 \fi \unless\ifx\relax\abc \1 -13 1 \fi + \ifeof7 \1 14 1 \fi \unless\ifeof5 \else \1 -14 -1 \fi + \iftrue \1 15 1 \fi \unless\iftrue \else \1 -15 -1 \fi + \iffalse \else \1 16 -1 \fi \unless\iffalse \1 -16 1 \fi + \ifcase2 \or \or \1 17 1 \fi \ifcase2 \or \else \1 17 -1 \fi + \ifdefined\hbox \1 18 1 \fi \unless\ifdefined\abc \1 -18 1 \fi + \ifcsname hbox\endcsname \1 19 1 \fi + \unless\ifcsname abc\endcsname \1 -19 1 \fi + \iffontchar\trip`b \1 20 1 \fi \unless\iffontchar\trip`c \1 -20 1 \fi +% + \if00 \unless\if00 \else \if0a \else \unless\if0a + \ifcat00 \unless\ifcat00 \else \ifcat0a \else \unless\ifcat0a + \ifnum1=1 \unless\ifnum1<1 \ifdim1pt=2pt \else \unless\ifdim1pt>2pt + \ifodd5 \unless\ifodd5 \else + \setbox3=\vbox{\ifvmode \unless\ifvmode \else + \hbox{\ifhmode \unless\ifhmode \else + $\ifmmode \unless\ifmmode \else \ifinner \unless\ifinner \else + \ifvoid2 \unless\ifvoid0 \ifhbox1 \unless\ifhbox2 + \ifvbox0 \unless\ifvbox1 \ifeof7 \unless\ifeof5 \else + \ifx\abc\relax \else \unless\ifx\relax\abc + \iftrue \unless\iftrue \else \iffalse \else \unless\iffalse + \ifcase2 \or \or \ifcase2 \or \else + \ifdefined\hbox \unless\ifdefined\abc + \begingroup \tracingifs=1 + \ifcsname hbox\endcsname \unless\ifcsname abc\endcsname + \iffontchar\trip`b \unless\iffontchar\trip`c + \showifs % <== show 44 nested ifs + \fi \fi + \fi \fi + \endgroup + \fi \fi + \fi \fi + \fi \fi \fi \fi + \fi \fi + \fi \fi \fi \fi + \fi \fi \fi \fi + \fi \fi \fi \fi $ + \fi \fi } + \fi \fi } + \fi \fi + \fi \fi \fi \fi + \fi \fi \fi \fi + \fi \fi \fi \fi +\endgroup + +% +% -- Check \iffontchar, \fontcharwd, etc. +\typeout{Checking \string\iffontchar, \string\fontcharwd, etc.:} +\begingroup + \iffontchar \else \fi % <== missing font identifier and number + \iffontchar\textfont2 -1 \else \fi % <== bad character code + \iffontchar\font 256 \else \fi % <== bad character code + \fontcharwd \fontcharht \fontchardp \fontcharic % <== can't use + \def\1#1#2{% + \def\2##1##2{\ifdim\csname fontchar##1##2\endcsname#1`#2=0pt \else + \space##1##2=\the\csname fontchar##1##2\endcsname#1`#2 \fi}% + \typeout{Font \string#1 character #2% + \iffontchar#1`#2:\2wd\2ht\2dp\2ic\else \space does not exist\fi}} + \1\font A \1{\textfont1}B \1{\scriptfont2}B \1{\scriptscriptfont3}B + \1\trip 7 \1\trip D \1\nullfont D +% + \def\1#1{\cndx=\zero \ctmp=\zero + \def\2{\iffontchar#1\cndx \advance\ctmp by\one \fi + \advance\cndx by\one + \ifnum\cndx<256 \expandafter\2\fi}% + \2% + \typeout{Font \string#1 has \number\ctmp\space character% + \ifnum1=\cndx \else s\fi .}} + \1\font \1\trip \1\nullfont +\endgroup + +% +% -- Check \parshapelength, \parshapeindent, and \parshapedimen +\typeout{Checking \string\parshapelength, \string\parshapeindent, and + \string\parshapedimen:} +\begingroup + \parshapelength \parshapeindent \parshapedimen % <== can't use + \def\1#1 {\edef\2{\2 #1}} + \let\2=\empty + \ifdim\parshapeindent-5=0pt \else\1a \fi + \ifdim\parshapelength-5=0pt \else\1b \fi + \ifdim\parshapeindent-1=0pt \else\1c \fi + \ifdim\parshapelength-1=0pt \else\1d \fi + \ifdim\parshapeindent-0=0pt \else\1e \fi + \ifdim\parshapelength-0=0pt \else\1f \fi + \ifdim\parshapeindent 1=0pt \else\1g \fi + \ifdim\parshapelength 1=0pt \else\1h \fi + \ifdim\parshapeindent 5=0pt \else\1j \fi + \ifdim\parshapelength 5=0pt \else\1i \fi + \ifdim\parshapedimen-5=0pt \else\1k \fi + \ifdim\parshapedimen-1=0pt \else\1l \fi + \ifdim\parshapedimen 0=0pt \else\1m \fi + \ifdim\parshapedimen 1=0pt \else\1n \fi + \ifdim\parshapedimen 2=0pt \else\1o \fi + \typeout{Parshape test 1 \ifx\2\empty OK\else error(s):\2\fi} + \parshape=2 1pt 2pt 3pt 4pt + \let\2=\empty + \ifdim\parshapeindent-5=0pt \else\1a \fi + \ifdim\parshapelength-5=0pt \else\1b \fi + \ifdim\parshapeindent-1=0pt \else\1c \fi + \ifdim\parshapelength-1=0pt \else\1d \fi + \ifdim\parshapeindent-0=0pt \else\1e \fi + \ifdim\parshapelength-0=0pt \else\1f \fi + \ifdim\parshapedimen-5=0pt \else\1g \fi + \ifdim\parshapedimen-1=0pt \else\1h \fi + \ifdim\parshapedimen 0=0pt \else\1i \fi + \typeout{Parshape test 2 \ifx\2\empty OK\else error(s):\2\fi} + \parshape=2 1pt 2pt 3pt 4pt + \parshape=2 \parshapelength2 \parshapeindent2 + \parshapelength1 \parshapeindent1 + \let\2=\empty + \ifdim\parshapeindent1=4pt \else\1A \fi + \ifdim\parshapelength1=3pt \else\1B \fi + \ifdim\parshapeindent2=2pt \else\1C \fi + \ifdim\parshapelength2=1pt \else\1D \fi + \ifdim\parshapeindent3=2pt \else\1E \fi + \ifdim\parshapelength3=1pt \else\1F \fi + \ifdim\parshapeindent9=2pt \else\1G \fi + \ifdim\parshapelength9=1pt \else\1H \fi + \typeout{Parshape test 3 \ifx\2\empty OK\else error(s):\2\fi} + \parshape=2 1pt 2pt 3pt 4pt + \parshape=2 11\parshapedimen4 11\parshapedimen3 + 11\parshapedimen2 11\parshapedimen1 + \let\2=\empty + \ifdim\parshapedimen1=44pt \else\1A \fi + \ifdim\parshapedimen2=33pt \else\1B \fi + \ifdim\parshapedimen3=22pt \else\1C \fi + \ifdim\parshapedimen4=11pt \else\1D \fi + \ifdim\parshapedimen5=22pt \else\1E \fi + \ifdim\parshapedimen6=11pt \else\1F \fi + \ifdim\parshapedimen99=22pt \else\1G \fi + \ifdim\parshapedimen100=11pt \else\1H \fi + \typeout{Parshape test 4 \ifx\2\empty OK\else error(s):\2\fi} +\endgroup + +% +% -- Check \numexpr, \dimexpr, \glueexpr, and \muexpr +\typeout{Checking \string\numexpr, \string\dimexpr, \string\glueexpr, + and \string\muexpr:} +\begingroup + \numexpr \dimexpr \glueexpr \muexpr % <== can't use + \let\9=\relax + \count43=\numexpr ( ( 2 \9 \dimen43=\dimexpr ( 3pt \9 + \skip43=\glueexpr 4pt plus 3fil \9 \muskip43=\muexpr(5muminus1mu)\9 + \def\1#1 {\typeout{\detokenize{#1}=\the#1}} + \1\numexpr\count43 \1\dimexpr\dimen43 + \1\glueexpr\skip43 \1\muexpr\muskip43 + + % Test arithmetic overflow + \begingroup + \tracingassigns=5 + \count44=\numexpr"7FFFFFFE+1 \dimen44=\dimexpr"3FFFFFFEsp+1sp + \count44=\numexpr-"7FFFFFFE-1 \dimen44=\dimexpr-"3FFFFFFEsp-1sp + \count44=\numexpr"FFFF*"8000 \dimen44=\dimexpr"7FFFsp*"8000 + \skip44="3FFFFFFFsp \advance\skip44by1sp \relax + \dimen45=\skip44 \dimen45=\dimexpr1sp*\skip44\9 + \dimen44=-"3FFFFFFFsp \advance\dimen44by-1sp + \dimen45=\skip44 \dimen45=\dimexpr1sp*\skip44\9 + \count44=\numexpr"7FFFFFFE+2\9 \dimen44=\dimexpr"3FFFFFFEsp+2sp\9 + \count44=\numexpr-"7FFFFFFE-2\9 \dimen44=\dimexpr-"3FFFFFFEsp-2sp\9 + \count44=\numexpr"10000*"8000\9 \dimen44=\dimexpr"8000sp*"8000\9 + \count44=\numexpr"10000*-"8000\9 \dimen44=\dimexpr"8000sp*-"8000\9 + \count44=\numexpr-"10000*"8000\9 \dimen44=\dimexpr-"8000sp*"8000\9 + \count44=\numexpr-"10000*-"8000\9 \dimen44=\dimexpr-"8000sp*-"8000\9 + \count44=\numexpr0/0\9 \dimen44=\dimexpr0pt/0\9 + \count44=\numexpr1/0\9 \dimen44=\dimexpr1pt/0\9 + \count44=\numexpr-1/0\9 \dimen44=\dimexpr-1pt/0\9 + \endgroup + + % Test glue arithmetic (add and sub) + \begingroup + \skip90=3pt plus 0fill minus 1fil + \skip91=3pt plus 1fil minus 0fill + \skip92=2pt plus -1fil minus 1fil + \tracingassigns=5 + \skip93=\glueexpr\skip90+0pt \skip93=\glueexpr\skip90+0pt + \skip93=\glueexpr--\skip90 \skip93=\glueexpr--\skip90 + \skip93=\glueexpr\skip91+0pt + \skip93=\glueexpr--\skip91 \skip93=\glueexpr--\skip91 + \skip93=\glueexpr\skip92+0pt + \skip93=\glueexpr--\skip92 \skip93=\glueexpr--\skip92 + \skip93=\glueexpr\skip90-\skip91 + \skip93=\glueexpr\skip91-\skip92 + \skip93=\glueexpr\skip91+\skip92 + \endgroup + + % Test rounding of division (all combinations of signs) + \def\2#1 {\edef\3{\3 #1}} + \def\1#1#2#3#4{\let\3=\empty + \ifnum#4=\numexpr#2/#3\else\2a \fi + \ifnum#4=-\numexpr-#2/#3\else\2b \fi + \ifnum-#4=\numexpr#2/-#3\else\2c \fi + \ifnum#4=\numexpr-#2/-#3\else\2d \fi + \typeout{Expr quotient rounding #1 \ifx\3\empty OK\else + error(s):\3\fi}} + \11{"3FFFFFFF}{"7FFFFFFF}{0} + \12{"40000000}{"7FFFFFFF}{1} + \13{"3FFFFFFE}{"7FFFFFFE}{0} + \14{"3FFFFFFF}{"7FFFFFFE}{1} + \def\1#1#2#3#4{\let\3=\empty + \ifnum#4=\numexpr#2/#3\else\2a \fi + \ifnum#4=-\dimexpr-#2sp/#3\else\2b \fi + \ifnum-#4=\glueexpr\muexpr#2mu/"10000\9/-#3\else\2c \fi + \ifnum#4=\muexpr-\dimexpr#2spplus-1muminus-1fil/-#3\else\2d \fi + \typeout{Expr quotient rounding #1 \ifx\3\empty OK\else + error(s):\3\fi}} + \15{32}{5}{6} % <== three mu_error's (! Incompatible glue units) + \16{33}{5}{7} % <== three mu_error's (! Incompatible glue units) + \17{25}{4}{6} % <== three mu_error's (! Incompatible glue units) + \18{26}{4}{7} % <== three mu_error's (! Incompatible glue units) + + % Test rounding of fractions + \begingroup + \def\1#1 #2 #3 #4 #5 {\let\3=\empty + \ifnum#5=\numexpr#2*#3/#4\else\2a \fi + \ifnum-#5=\numexpr-#2*#3/#4\else\2b \fi + \ifnum-#5=\numexpr#2*-#3/#4\else\2c \fi + \ifnum#5=\numexpr-#2*-#3/#4\else\2d \fi + \ifnum-#5=\numexpr#2*#3/-#4\else\2e \fi + \ifnum#5=\numexpr-#2*#3/-#4\else\2f \fi + \ifnum#5=\numexpr#2*-#3/-#4\else\2g \fi + \ifnum-#5=\numexpr-#2*-#3/-#4\else\2h \fi + \4#1} + \def\4#1{\typeout{Expr fraction rounding #1 \ifx\3\empty OK\else + error(s):\3\fi}\let\3=\empty} + \11 "7FFFFFFE "7FFFFFFE "7FFFFFFD "7FFFFFFF + \12 "7FFFFFFE "7FFFFFFE "7FFFFFFF "7FFFFFFD + \def\1#1#2 #3 #4 #5 #6 {\let\3=\empty + \ifnum\numexpr#6=\numexpr(#3)*(#4)/(#5)\else\2#1 \fi + \ifdim\dimexpr1sp*#6=\dimexpr(#3sp)*(#4)/(#5)\else\2#2 \fi} + \1ab "3FFFFFFE "7FFFFFFE "7FFFFFFD "3FFFFFFF + \1cd "3FFFFFFE "7FFFFFFE "7FFFFFFF "3FFFFFFD + \1ef "1FFFBFFE "20003FFE "1FFFFFFE "1FFFFFFF + \1gh "1FFFBFFF "20003FFF "1FFFFFFF "20000000 + \1ij "1FFFC000 "20004000 "20000000 "20000000 + \1kl "1FFFC001 "20004001 "20000001 "20000001 + \errorcontextlines=100 + \1mn 1 "7FFFFFFF 2 "40000000 + \43 + \endgroup + + \bgroup + \skip44=\glueexpr ( \skip43 ) + 3 pt plus 1 fil minus 1 fil l l + \muskip44=\muexpr (\muskip43)+3muplus1fill + \dimen44=\dimexpr\skip43+\count43pt + \dimen44=\dimexpr(\skip43)+(\count43pt) + \dimen44=\dimexpr\skip43*\count43 + \skip44=\glueexpr\skip43/\count43 + \skip44=\glueexpr\skip43*2/3 + \egroup + + % Test operator precedence + \bgroup + \def\1#1#2#3#4{#1#2#3#4=#2#3(#4)\else + \typeout{expression error (l.\number\inputlineno)}\fi} + \1\ifnum\numexpr{1+}{2*3} + \1\ifnum\numexpr{4-}{5*6} + \1\ifnum\numexpr{7+}{12/4} + \1\ifnum\numexpr{4-}{6/3} + \1\ifdim\dimexpr{1pt+}{2pt*3} + \1\ifdim\dimexpr{4pt-}{5pt*6} + \1\ifdim\dimexpr{7pt+}{12pt/4} + \1\ifdim\dimexpr{4pt-}{6pt/3} + \1\ifdim\glueexpr{7pt+}{12pt/4} + \egroup + + % Test glue reference count handling + \shipout\hbox{} + \bgroup + \skip43=\glueexpr1ptplus0ptminus0pt + \skip43=\glueexpr1pt-0pt+0pt + \skip43=\glueexpr(((\skip43))) + \egroup + \shipout\hbox{} +\endgroup + +% +% -- Check \mutoglue and \gluetomu +\typeout{Checking \string\mutoglue\space and \string\gluetomu:} +\begingroup + \mutoglue \gluetomu % <== can't use + \skip1=-\mutoglue-\gluetomu9pt \muskip1=-\gluetomu-\mutoglue9mu + \skip2=\gluetomu\muskip1 % <== two mu_error's (! Incompatible glue units) + \muskip2=\mutoglue\skip1 % <== two mu_error's (! Incompatible glue units) + \tracingassigns=1 + \skip1=\mutoglue1muplus-2muminus-3fil + \muskip1=\gluetomu1ptplus-2ptminus-3fil + \skip2=\mutoglue-4muplus5fillminus6filll + \muskip2=\gluetomu-4ptplus5fillminus6filll + \skip3=-\mutoglue\muskip1 + \muskip3=-\gluetomu\skip1 + \skip4=\mutoglue-\muskip2 + \muskip4=\gluetomu-\skip2 + +% +% -- Check (mu)glue identity + \typeout{Checking (mu)glue identity:} + \skipdef\165535\1=7ptplus0filminus0fill\muskipdef\232766\2=\gluetomu\1 + \tracingassigns=\1 + \1=--\mutoglue--\muexpr(--\gluetomu--\glueexpr(--\1)) + \2=--\gluetomu--\glueexpr(--\mutoglue--\muexpr(--\2)) + \tracingassigns=0 + +% +% -- Check \gluestretchorder, \glueshrinkorder, \gluestretch, and \glueshrink + \typeout{Checking \string\gluestretchorder, \string\glueshrinkorder, + \string\gluestretch, and \string\glueshrink:} + \gluestretchorder \gluestretch % <== can't use + \glueshrinkorder \glueshrink % <== can't use + \skip5=1ptminus0fil + \skip6=1ptplus0fillminus0filll + \def\2#1{\typeout{wrong glue #1 (l.\number\inputlineno)}} + \def\1#1#2pt#3#4pt#5 {% + \ifnum\gluestretchorder#5=#1 \else \2{stretch order}\fi + \ifdim\gluestretch#5=#2pt \else \2{stretch}\fi + \ifnum\glueshrinkorder#5=#3 \else \2{shrink order}\fi + \ifdim\glueshrink#5=#4pt \else \2{shrink}\fi} + \def\9{\relax} + \100pt10pt1ptminus0fil + \100pt10pt\mutoglue1muminus0fil + \100pt10pt\mutoglue\gluetomu1ptminus0fil + \100pt10pt\skip5 + \muskip5=\gluetomu\skip5 + \100pt10pt\mutoglue\muskip5 + \100pt10pt\glueexpr\mutoglue\muexpr\gluetomu\skip5\9\9 + \100pt00pt\glueexpr\skip5+0pt\9 + \120pt30pt1ptplus0fillminus0filll + \120pt30pt\mutoglue1muplus0fillminus0filll + \120pt30pt\mutoglue\gluetomu1ptplus0fillminus0filll + \120pt30pt\skip6 + \muskip6=\gluetomu\skip6 + \120pt30pt\mutoglue\muskip6 + \120pt30pt\mutoglue\muexpr\gluetomu\glueexpr\skip6\9\9 + \100pt00pt\glueexpr\skip6+0pt\9 + \10-2pt1-3pt\skip1 + \10-2pt1-3pt\mutoglue\muskip1 + \125pt36pt\skip2 + \125pt36pt\mutoglue\muskip2 +\endgroup + +% +% -- Check sparse arrays +\typeout{Checking sparse arrays:} +\begingroup + \def\2#1{#1\1=-1#1\1=65536#1\1=0#1\1=65535\typeout{\meaning\1=\the\1.}} + \2\countdef % Bad register code (-1) ...and (65536). + \2\dimendef % Bad register code (-1) ...and (65536). + \2\skipdef % Bad register code (-1) ...and (65536). + \2\muskipdef % Bad register code (-1) ...and (65536). + \2\toksdef % Bad register code (-1) ...and (65536). + \tracingrestores=1 + \count20=5 + \count2000=5 + \dimen21=5pt + \dimen2100=5pt + \skip22=5pt\relax \muskip2200=5mu\relax + \dimendef\8=256\relax \let\9=\8 \let\8=\relax \show\9 +\endgroup +\begingroup + \def\4#1#2#3#4{{\typeout{testing #1 registers ...}% + \5\2{#1}\5\3{#1def}% define, e.g., \count and \countdef + \newlinechar=`^^J \tracingrestores=1 {\tracingassigns=1 + \22000=#2} \22001=#3 \3\1=2002 \1=#4 + \typeout{\6\22000=\the\22000,^^J \6\22001=\the\22001,^^J + \6\22002=\the\22002,^^J \7\1=\the\1.}% + \expandafter\unless\expandafter\ifx\2\toks +% more tests for \count, \dimen, \skip, and \muskip + \advance\22000by#3 \advance\1by#3 \8 + \multiply\22000by10 \multiply\1by10 \8 + \divide\22000by5 \divide\1by5 \8 + \else +% more tests for \toks + \begingroup + \tracingassigns=1 + \toks20=#2 \toks21=#3 \toks2100=#4 + \1=\toks20 \1=\toks21 + \toks2200=\toks20 \toks2200=\toks21 + \1=\toks2000 \1=\toks2001 + \toks2200=\toks2000 \toks2200=\toks2001 + \toks30=\1 \toks30=\toks2000 \toks30=\toks2001 + \toks3000=\1 \toks3000=\toks2000 \toks3000=\toks2001 + \endgroup + \fi + \tracingassigns=1 \global\22002=#3 \1=#4 \global\1=#2 + }} + \def\5#1#2{\edef#1{\csname#2\endcsname}} + \def\6{\expandafter\string} + \def\7{\expandafter\meaning} + \def\8{\typeout{\6\22000=\the\22000,^^J \6\22002=\the\22002,^^J + \7\1=\the\1.}} + \4{count}{0}{5}{7} % test \count, \countdef + \4{dimen}{0pt}{2.5pt}{3.5pt} % test \dimen, \dimendef + \4{skip}{0pt}{2.5ptplus1fil}{3.5ptminus1fill} % test \skip, \skipdef + \4{muskip}{0mu}{2.5muplus1fil}{3.5muminus1fill} % test \muskip, \muskipdef + \4{toks}{{}}{{a b c}}{{d e f}} % test \toks and \toksdef +\endgroup +\begingroup \typeout{testing box registers ...} + \def\2#1{#1\1=-1#1\1=32768#1\1=0#1\1=32767\typeout{\meaning\1=\the\1.}} + \2\mathchardef % Bad mathchar (-1) ...and (32768). + \def\2#1{#1\1=-1#1\1=65536#1\1=0#1\1=65535\typeout{\meaning\1=\the\1.}} + \setbox-1=\copy65536 % Bad register code (-1) ...and (65536). + \global\setbox65536=\copy-1 % Bad register code (65536) ...and (-1). + \wd65536=\ht-1 % Bad register code (65536) ...and (-1). + \showbox-1 % Bad register code (-1). + \def\2#1{\typeout{\string\box#1=% + \ifhbox#1 \ifvbox#1 \else\ifvoid#1 \else\string\hbox\fi\fi\fi + \ifvbox#1 \ifhbox#1 \else\ifvoid#1 \else\string\vbox\fi\fi\fi + \ifvoid#1 void\else + \ifdim\ht#1 =0pt \else,ht=\the\ht#1 \fi + \ifdim\dp#1 =0pt \else,dp=\the\dp#1 \fi + \ifdim\wd#1 =0pt \else,wd=\the\wd#1 \fi + \fi.}} + \def\1#1{\2{3210#1}} + \tracingrestores=1 + \setbox32101=\hbox to 3pt{% + \global\setbox32102=\vbox to 5pt{% + \setbox32103=\vtop to 7pt{% + \showgroups + }% + }% + } + \showbox32100 + \showbox32101 + \11\12\13 + \setbox32103=\copy32101 \11\13 + \setbox32104=\box32102 \12\14 + \ht32101=2pt \11 + \ht32102=4pt \12 + \dp32103=6pt \13 + \wd32104=8pt \14 + \setbox32105=\hbox{\vbox to1pt{}\hskip5pt} \15 + \setbox32106=\hbox{% + \unhcopy32105 \15% + \unhbox32105 \15% + \unhcopy32105 \unhbox32105 } \15 \16 + \setbox32105=\vbox{\hbox to1pt{}\vskip5pt} \15 + \setbox32106=\vbox{% + \unvcopy32105 \15% + \unvbox32105 \15% + \unvcopy32105 \unvbox32105 } \15 \16 + \setbox32105=\vbox{\vbox to10pt{}\penalty0\vbox to20pt{}} \15 + \setbox32106=\vsplit32105 to 10pt \16 \15 +\endgroup + +% +% -- Check \lastlinefit +\typeout{Checking \string\lastlinefit:} +\begingroup + \def\1{\setbox0=\vbox{\noindent\2\2\2\2\3\2}\showbox0 + \setbox0=\vbox{\unvbox0 \setbox0=\lastbox \showbox0 }} + \def\2{\hbox to30pt{}\hskip 5pt plus 20pt minus 4pt } + \def\3{} + \tracingparagraphs=1 \showboxdepth=1 + \hbadness=100 \pretolerance=9000 + \parfillskip=0pt plus 1fill \relax + \hsize=96pt + \lastlinefit=-1 \1 + \lastlinefit=500 \1 + \lastlinefit=1001 \1 + \hsize=98pt + \begingroup + \rightskip=0pt plus 1fill \relax + \lastlinefit=1000 \1 + \leftskip=0pt plus -1fill \relax + \lastlinefit=500 \1 + \endgroup + \lastlinefit=1000 \1 + \hsize=100pt + \lastlinefit=0 \1 + \lastlinefit=500 \1 + \lastlinefit=1000 \1 + \hsize=110pt + \begingroup + \let\3=\hfil + \lastlinefit=1000 \1 + \endgroup + \lastlinefit=500 \1 + \lastlinefit=1000 \1 + \hsize=120pt + \lastlinefit=0 \1 + \lastlinefit=500 \1 + \lastlinefit=1000 \1 +\endgroup + +% +% -- Check expansion of V 2 \protected macros +\typeout{Checking expansion of V 2 \string\protected\space macros:} +\begingroup + \protected\def\1{\omit} \def\2{\omit} \def\3{relax} + \setbox0=\vbox{\halign{&\typeout{# (l.\number\inputlineno)}\cr + \1& \1\cr + \2& \2\cr + \3& \3\cr}} +\endgroup + +% +% -- Check hyphenation and \savinghyphcodes +\typeout{Checking hyphenation and \string\savinghyphcodes:} +\begingroup + \def\2#1#2 {\language=#1 #2 } + \def\1#1 {\noindent\trip\ \20#1 \21#1 \22#1 \23#1 \24#1 \par} + \parfillskip=0pt \hbadness=0 \showboxdepth=0 + \hsize=16383.99999pt \pretolerance=-1 \tolerance=-1 + \setbox0=\vbox{ + \lccode`A=`a \lccode`B=`b + \language=0 \hyphenation{qq-App qqB-pp} + \language=1 \hyphenation{qq-App qqB-pp} + \language=2 \hyphenation{qq-A-pp qqB-pp} + \language=3 \hyphenation{qq-App qq-B-pp} + \1ppAqq \1upAqq \1ppBqq \1upBqq + \lccode`A=`r \lccode`B=`b + \1ppAqq \1upAqq \1ppBqq \1upBqq + \lccode`A=`a \lccode`B=`r + \1ppAqq \1upAqq \1ppBqq \1upBqq + } + \setbox0=\vbox{\language=3 \1qqapp \1qqbpp \1qqrpp } +\endgroup + +% +% -- Check \savingvdiscards, \pagediscards, and \splitdiscards +\typeout{Checking \string\savingvdiscards, \string\pagediscards, and + \string\splitdiscards:} +\begingroup + \setbox27=\vbox{\noindent$\splitdiscards\noindent$\pagediscards} + \showbox27 + \setbox 27 = \vbox { + \vbox to 20 pt {} + \prevdepth = -10000 pt + \openout 0 = abc + \penalty 0 + \write 1 {write 1} + \vskip 10 pt plus 1 pt minus 1 pt + \write 2 {write 2} + \penalty 0 + \closeout 3 + \kern 10 pt + \vbox to 20 pt {} + \vfil + } + \def\1 #1 #2 {% + \savingvdiscards = #1 + \setbox 28 = \copy 27 + { + \setbox 0 = \vbox { + \vsplit 28 to #2 pt + \prevdepth = -10000 pt + \splitdiscards + \box 28 + } + \showbox 0 + } + } + \1 -1 20 \1 0 30 \1 1 20 \1 2 30 + \output = {% + \setbox 0 = \vbox { \pagediscards } + \showbox 0 + \showbox 255 + \setbox 0 = \box 255 + \global \deadcycles = 0 + } + \def\1{{\setbox 0 = \vbox { \pagediscards \showlists }}} + \savingvdiscards = 0 \vfil \kern 20 pt \1 \penalty -1 \1 + \savingvdiscards = 1 \vfill \kern 2 pt \1 \penalty 10 \1 + \kern 5 pt \write 1 {} \penalty 0 + { \savingvdiscards = 0 + \kern 6 pt \write 2 {} \penalty 1 + } + \kern 7 pt \write 3 {} \hbox {} \penalty -10000 + \1 +\endgroup + +% +% -- Check \interlinepenalties, \clubpenalties, \widowpenalties, +% and \displaywidowpenalties +\typeout{Checking \string\interlinepenalties, \string\clubpenalties, + \string\widowpenalties, and \string\displaywidowpenalties:} +\begingroup + \begingroup + \def\2#1{% + \typeout{\string#1-1=\the#1-1}% + \typeout{\string#10=\the#10}% + \typeout{\string#15=\the#15}% + \typeout{\string#1\string#10=\the#1#10}} + \def\1{% + \2\interlinepenalties + \2\clubpenalties + \2\widowpenalties + \2\displaywidowpenalties} + \def\5#1#2{\number#1#2 + \ifnum#2<#10 \space\expandafter\5\expandafter#1\expandafter + {\number\numexpr#2+1\expandafter}\fi} + \def\4#1{\typeout{\string#1=\5#1{0}}} + \def\3{% + \4\interlinepenalties + \4\clubpenalties + \4\widowpenalties + \4\displaywidowpenalties} + \tracingassigns=1 \tracingrestores=1 + \3 \1 + \interlinepenalties=3 101 102 103 + \clubpenalties=1 1 \clubpenalties=4 201 202 203 204 + \widowpenalties=5 301 302 303 304 305 + \displaywidowpenalties=6 401 402 403 404 405 406 + \3 \1 + \setbox0=\vbox{} + \endgroup + \parfillskip=0pt \interlinepenalty=7 \clubpenalty=500 \widowpenalty=300 + \displaywidowpenalty=310 \rightskip=0ptplus1fil \hsize=20pt + \def\3#1 {\setbox0=\lastbox \unskip \count0=\lastpenalty \unpenalty + \ifnum\count0=#1 \else \typeout{Wrong penalty \number\count0 + \space should be #1 (l.\number\inputlineno)}\fi} + \def\2{\vrule height1ptwidth19pt\hskip5pt } + \def\1#1#2 #3 #4 #5 #6 #7 {\setbox0=\vbox{#1\noindent\2\2\2\2$$ + $$\2\2\2\2\par\3#7 \3#6 \3#5 \30 \30 \30 \30 \3#4 \3#3 \3#2 \30 }} + + \1{\interlinepenalties=8 8 7 6 5 4 3 2 1 }508 7 316 501 1 301 + \1{\clubpenalties=2 200 100 }207 107 417 207 107 407 + \1{\widowpenalties=2 2000 1000 \displaywidowpenalties=3 2200 1100 0 }% + 507 1107 2207 1507 1007 2007 +\endgroup + +% +% -- Check hyphenation of LR and RL segments +\typeout{Checking hyphenation of LR and RL segments:} +\begingroup + \setbox0=\vbox{\trip +% \language=5 + \lccode`M=`M \hyphenation{MM-MM} + \TeXXeTstate=1 + \hsize=0pt + \parfillskip=0pt + \noindent{} MMMM \beginL MMMM MMMM MMMM\endL{} \beginR MMMM\endR \par + } +\endgroup + +% +\showboxbreadth=10\showboxdepth=10 +\tracingonline=1\tracingoutput=1 +\end +\error{e-VirTeX: can't happen in e-trip test!} +%% End of file `etrip.tex'. diff --git a/Build/source/texk/web2c/euptexdir/eptrip/texmf.cnf b/Build/source/texk/web2c/euptexdir/eptrip/texmf.cnf new file mode 100644 index 00000000000..7ad7bffd6d3 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/eptrip/texmf.cnf @@ -0,0 +1,41 @@ +% eptexdir/eptrip/texmf.cnf -- configuration for the e-ptrip test. + +% These values apply to all the programs, and they are necessary for any +% kind of reasonable diff. +error_line = 64 +half_error_line = 32 +max_print_line = 72 + +% e-pTeX. +mem_bot = 1 +main_memory = 4500 +max_strings = 3300 +pool_size = 40000 + +string_vacancies = 8000 + +% TeX end e-TeX. +font_mem_size = 20000 +font_max = 75 +stack_size = 200 +nest_size = 40 +buf_size = 500 +save_size = 600 +dvi_buf_size = 800 +% Although hyph_size is settable, it can't be . + +@x [10] m.135 l.2895 - e-TeX TeXXeT +|fil|, |fill|, or |filll|). The |subtype| field is not used in \TeX. +@y +|fil|, |fill|, or |filll|). The |subtype| field is not used. +@z + +@x [17.236] l.4960 - first web2c, then e-TeX additional integer parameters +@d int_pars=web2c_int_pars {total number of integer parameters} +@# +@d etex_int_base=tex_int_pars {base for \eTeX's integer parameters} +@y +@d int_pars=web2c_int_pars {total number of integer parameters} +@z + +@x [18.???] pTeX: ensure buffer2[]=0 in primitive + for j:=0 to l-1 do buffer[first+j]:=so(str_pool[k+j]); +@y + for j:=0 to l-1 do buffer[j]:=so(str_pool[k+j]); +@z + +@x [26.413] + {fetch an internal parameter} +label exit; +var m:halfword; {|chr_code| part of the operand token} +@!q,@!r:pointer; {general purpose indices} +@!tx:pointer; {effective tail node} +@y + {fetch an internal parameter} +var m:halfword; {|chr_code| part of the operand token} +@z + +@x [26.413] +exit:end; +@y +end; +@z + +@x +@d badness_code=input_line_no_code+1 {code for \.{\\badness}} +@y +@d badness_code=glue_val+2 {code for \.{\\badness}} +@z + +@x [26.420] +begin scan_register_num; fetch_box(q); +if q=null then cur_val:=0 @+else cur_val:=mem[q+m].sc; +@y +begin scan_eight_bit_int; +if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc; +@z + +@x [26.424] +legal in similar contexts. + +@y +legal in similar contexts. +@z + +@x [26.424] +@d find_effective_tail==find_effective_tail_eTeX + +@y +@z + +@x + if m>=eTeX_glue then @@; + else if m>=eTeX_dim then + begin case m of + @/@@/ + end; {there are no other cases} + cur_val_level:=dimen_val; + end + else begin case m of + input_line_no_code: cur_val:=line; + badness_code: cur_val:=last_badness; + @/@@/ + end; {there are no other cases} +@y + begin if cur_chr=input_line_no_code then cur_val:=line + else cur_val:=last_badness; {|cur_chr=badness_code|} +@z + +@x [26.424] + find_effective_tail; +@y +@z + +@x [26.424] + if not is_char_node(tx)and(mode<>0) then + case cur_chr of + int_val: if type(tx)=penalty_node then cur_val:=penalty(tx); + dimen_val: if type(tx)=kern_node then cur_val:=width(tx); + glue_val: if type(tx)=glue_node then + begin cur_val:=glue_ptr(tx); + if subtype(tx)=mu_glue then cur_val_level:=mu_val; +@y + if not is_char_node(tail)and(mode<>0) then + case cur_chr of + int_val: if type(tail)=penalty_node then cur_val:=penalty(tail); + dimen_val: if type(tail)=kern_node then cur_val:=width(tail); + glue_val: if type(tail)=glue_node then + begin cur_val:=glue_ptr(tail); + if subtype(tail)=mu_glue then cur_val_level:=mu_val; +@z + +@x [26.424] + else if (mode=vmode)and(tx=head) then +@y + else if (mode=vmode)and(tail=head) then +@z + +@x [27.468] +@d etex_convert_base=5 {base for \eTeX's command codes} +@d eTeX_revision_code=etex_convert_base {command code for \.{\\eTeXrevision}} +@d etex_convert_codes=etex_convert_base+1 {end of \eTeX's command codes} +@d job_name_code=etex_convert_codes {command code for \.{\\jobname}} +@y +@d job_name_code=5 {command code for \.{\\jobname}} +@z + +@x [30.581] +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var old_setting: integer; {saved value of |tracing_online|} +@y +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +@z + +@x [32.619] +save_loc:=dvi_offset+dvi_ptr; base_line:=cur_v; +prev_p:=this_box+list_offset; +@; +left_edge:=cur_h; +@y +save_loc:=dvi_offset+dvi_ptr; base_line:=cur_v; left_edge:=cur_h; +@z + +@x [32.620] + prev_p:=link(prev_p); {N.B.: not |prev_p:=p|, |p| might be |lig_trick|} +@y +@z + +@x [32.624] l.13005 - pTeX: output a box(and dir_node) with disp + cur_h:=edge; cur_v:=base_line; +@y + cur_h:=edge+width(p); cur_v:=base_line; +@z + +@x [33.649] +exit: if TeXXeT_en then @; +hpack:=r; +@y +exit: hpack:=r; +@z + +@x [44.977] +q:=prune_page_top(q,saving_vdiscards>0); +p:=list_ptr(v); free_node(v,box_node_size); +if q<>null then q:=vpack(q,natural); +change_box(q); {the |eq_level| of the box stays the same} +@y +q:=prune_page_top(q); p:=list_ptr(v); free_node(v,box_node_size); +if q=null then box(n):=null {the |eq_level| of the box stays the same} +else box(n):=vpack(q,natural); +@z + +@x [47.1079] +@!r:pointer; {running behind |p|} +@!fm:boolean; {a final \.{\\beginM} \.{\\endM} node pair?} +@!tx:pointer; {effective tail node} +@y +@z + +@x [47.1080] +@d check_effective_tail(#)==find_effective_tail_eTeX +@d fetch_effective_tail==fetch_effective_tail_eTeX + +@y +@z +@x [47.1080] +else begin check_effective_tail(goto done); + if not is_char_node(tx) then + if (type(tx)=hlist_node)or(type(tx)=vlist_node) then + @; + done:end; +@y +else begin if not is_char_node(tail) then + if (type(tail)=hlist_node)or(type(tail)=vlist_node) then + @; + end; +@z + +@x [47.1081] +begin fetch_effective_tail(goto done); +cur_box:=tx; shift_amount(cur_box):=0; +end +@y +begin q:=head; +repeat p:=q; +if not is_char_node(q) then if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tail then goto done; + end; +q:=link(p); +until q=tail; +cur_box:=tail; shift_amount(cur_box):=0; +tail:=p; link(p):=null; +done:end +@z + +@x [47.1096] + else line_break(false); +@y + else line_break(widow_penalty); +@z + +@x [47.1105] +@!r:pointer; {running behind |p|} +@!fm:boolean; {a final \.{\\beginM} \.{\\endM} node pair?} +@!tx:pointer; {effective tail node} +@y +@z + +@x [47.1105] +else begin check_effective_tail(return); + if not is_char_node(tx) then if type(tx)=cur_chr then + begin fetch_effective_tail(return); + flush_node_list(tx); +@y +else begin if not is_char_node(tail) then if type(tail)=cur_chr then + begin q:=head; + repeat p:=q; + if not is_char_node(q) then if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tail then return; + end; + q:=link(p); + until q=tail; + link(p):=null; flush_node_list(tail); tail:=p; +@z + +@x [47.1110] +else begin link(tail):=list_ptr(p); change_box(null); +@y +else begin link(tail):=list_ptr(p); box(cur_val):=null; +@z + +@x [48.1145] +else begin line_break(true);@/ +@y +else begin line_break(display_widow_penalty);@/ +@z + +@x [49.1247] +if b<>null then mem[b+c].sc:=cur_val; +@y +if box(b)<>null then mem[box(b)+c].sc:=cur_val; +@z + diff --git a/Build/source/texk/web2c/euptexdir/etex.ch1 b/Build/source/texk/web2c/euptexdir/etex.ch1 new file mode 100644 index 00000000000..5826dbcb4f8 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/etex.ch1 @@ -0,0 +1,214 @@ +% eptexdir/etex.ch1: changefile used to build e-pTeX, see eptexdir/eptex-base.ch for details. +% Public domain. Originally written by Peter Breitenlohner . + +@x [12.184] + begin print(", "); print_direction(box_dir(p)); +@y + begin print_direction_alt(box_dir(p)); +@z + +@x [16.215] - e-pTeX last_node_subtype +last_glue:=max_halfword; last_penalty:=0; last_kern:=0; +last_node_type:=-1; +@y +last_glue:=max_halfword; last_penalty:=0; last_kern:=0; +last_node_type:=-1; last_node_subtype:=-1; +@z + +@x [17.236] +@d int_pars=web2c_int_pars {total number of integer parameters} +@y +@d etex_int_base=web2c_int_pars {base for \eTeX's integer parameters} +@z + +@x [18] + for j:=0 to l-1 do begin + buffer[j]:=Lo(so(str_pool[k+j])); buffer2[j]:=Hi(so(str_pool[k+j])); end; +@y + for j:=0 to l-1 do begin + buffer[first+j]:=Lo(so(str_pool[k+j])); buffer2[first+j]:=Hi(so(str_pool[k+j])); end; +@z + +@x [26.413] +@; +end; +@y +@; +exit:end; +@z + +@x +@d eTeX_int=badness_code+1 {first of \eTeX\ codes for integers} +@y +@d eTeX_int=ptex_minor_version_code+1 {first of \eTeX\ codes for integers} +@z + +@x + begin case m of + input_line_no_code: cur_val:=line; + badness_code: cur_val:=last_badness; + ptex_version_code: cur_val:=pTeX_version; + eptex_version_code: cur_val:=epTeX_version_number; + ptex_minor_version_code: cur_val:=pTeX_minor_version; + end; {there and no other cases} +@y + if m>=eTeX_glue then @@; + else if m>=eTeX_dim then + begin case m of + @/@@/ + end; {there are no other cases} + cur_val_level:=dimen_val; + end + else begin case m of + input_line_no_code: cur_val:=line; + badness_code: cur_val:=last_badness; + ptex_version_code: cur_val:=pTeX_version; + eptex_version_code: cur_val:=epTeX_version_number; + ptex_minor_version_code: cur_val:=pTeX_minor_version; + @/@@/ + end; {there are no other cases} +@z + +@x [27.468] +@d job_name_code=ptex_convert_codes {command code for \.{\\jobname}} +@y +@d etex_convert_base=ptex_convert_codes {base for \eTeX's command codes} +@d eTeX_revision_code=etex_convert_base {command code for \.{\\eTeXrevision}} +@d etex_convert_codes=etex_convert_base+1 {end of \eTeX's command codes} +@d job_name_code=etex_convert_codes {command code for \.{\\jobname}} +@z + +@x [30.581] +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var @!l:0..255; {small indices or counters} +@y +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var @!l:0..255; {small indices or counters} +old_setting: integer; {saved value of |tracing_online|} +@z + +@x [32.619] +base_line:=cur_v; left_edge:=cur_h; disp:=0; +@y +base_line:=cur_v; disp:=0; revdisp:=0; +prev_p:=this_box+list_offset; +@; +left_edge:=cur_h; +@z + +@x [32.622] +@= +@y +@= +@z +@x [32.622] + p:=link(p); +@y + prev_p:=link(prev_p); {N.B.: not |prev_p:=p|, |p| might be |lig_trick|} + p:=link(p); +@z + +@x [32.623] +disp_node: begin disp:=disp_dimen(p); cur_v:=base_line+disp; end; +@y +disp_node: begin disp:=disp_dimen(p); revdisp:=disp; cur_v:=base_line+disp; end; +@z + +@x [32.624] + cur_h:=edge+width(p); cur_v:=base_line+disp; cur_dir_hv:=save_dir; +@y + cur_h:=edge; cur_v:=base_line+disp; cur_dir_hv:=save_dir; +@z + +@x [33.649] +exit: last_disp:=disp; hpack:=r; +@y +exit: last_disp:=disp; +if TeXXeT_en then @; +hpack:=r; +@z + +@x [33.651] + disp_node:disp:=disp_dimen(p); +@y + disp_node:begin disp:=disp_dimen(p); revdisp:=disp; end; +@z + +@x [44.977] +q:=prune_page_top(q); p:=list_ptr(v); +if q=null then box(n):=null {the |eq_level| of the box stays the same} +else begin + box(n):=vpack(q,natural); set_box_dir(box(n))(box_dir(v)); + end; +@y +q:=prune_page_top(q,saving_vdiscards>0); +p:=list_ptr(v); +if q<>null then begin + q:=vpack(q,natural); set_box_dir(q)(box_dir(v)); + end; +change_box(q); +@z + +@x [47.1096] + else begin adjust_hlist(head,true); line_break(widow_penalty) +@y + else begin adjust_hlist(head,true); line_break(false) +@z + +@x [47.1110] + begin if type(box(cur_val))=dir_node then + begin delete_glue_ref(space_ptr(box(cur_val))); + delete_glue_ref(xspace_ptr(box(cur_val))); + free_node(box(cur_val),box_node_size); +@y + begin if type(p)=dir_node then + begin delete_glue_ref(space_ptr(p)); + delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); +@z +@x [47.1110] + link(tail):=list_ptr(p); box(cur_val):=null; +@y + link(tail):=list_ptr(p); change_box(null); +@z + +@x [48.1145] + pop_nest; w:=-max_dimen; + end + { |disp_node|-only paragraphs are ignored } +@y + @ + end + { |disp_node|-only paragraphs are ignored } +@z + +@x [48.1145] +else begin adjust_hlist(head,true); line_break(display_widow_penalty);@/ +@y +else begin adjust_hlist(head,true); line_break(true);@/ +@z + +@x [49.1247] +if box(b)<>null then + begin q:=box(b); p:=link(q); +@y +if b<>null then + begin q:=b; p:=link(q); +@z +@x [49.1247] + begin p:=link(box(b)); link(box(b)):=null; +@y + begin p:=link(b); link(b):=null; +@z +@x [49.1247] + link(q):=p; link(box(b)):=q; +@y + link(q):=p; link(b):=q; +@z + +@x [49.1291] +@d show_mode=4 { \.{\\showmode} } +@y +@d show_mode=7 { \.{\\showmode} } +@z + diff --git a/Build/source/texk/web2c/euptexdir/fam256.ch b/Build/source/texk/web2c/euptexdir/fam256.ch new file mode 100644 index 00000000000..583c5b8d21a --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/fam256.ch @@ -0,0 +1,1537 @@ +% fam256.ch +% (C) 2009--2017 by Hironori Kitagawa. +% +% This patch is derived from om16bit.ch and omfi.ch (both in Omega). +% (Omega is copyright by John Plaice and Yannis Haralambous.) +% +%----------------------------------------------- +@x +@d hyph_prime=607 {another prime for hashing \.{\\hyphenation} exceptions; + if you change this, you should also change |iinf_hyphen_size|.} +@y +@d hyph_prime=607 {another prime for hashing \.{\\hyphenation} exceptions; + if you change this, you should also change |iinf_hyphen_size|.} +@d text_size=0 {size code for the largest size in a family} +@d script_size=256 {size code for the medium size in a family} +@d script_script_size=512 {size code for the smallest size in a family} +@z +%----------------------------------------------- +@x +@d not_found4=49 {like |not_found|, when there's more than four} +@y +@d not_found4=49 {like |not_found|, when there's more than four} +@d not_found5=50 {like |not_found|, when there's more than five} +@z +%----------------------------------------------- +@x +specifies the order of infinity to which glue setting applies (|normal|, +|fil|, |fill|, or |filll|). The |subtype| field is not used in \TeX. +@y +specifies the order of infinity to which glue setting applies (|normal|, +|sfi|, |fil|, |fill|, or |filll|). The |subtype| field is not used in \TeX. +@z +%----------------------------------------------- +@x +orders of infinity (|normal|, |fil|, |fill|, or |filll|) +@y +orders of infinity (|normal|, |sfi|, |fil|, |fill|, or |filll|) +@z +%----------------------------------------------- +@x +@d fil=1 {first-order infinity} +@d fill=2 {second-order infinity} +@d filll=3 {third-order infinity} +@y +@d sfi=1 {first-order infinity} +@d fil=2 {second-order infinity} +@d fill=3 {third-order infinity} +@d filll=4 {fourth-order infinity} +@z +%----------------------------------------------- +@x +@!glue_ord=normal..filll; {infinity to the 0, 1, 2, or 3 power} +@y +@!glue_ord=normal..filll; {infinity to the 0, 1, 2, 3, or 4 power} +@z +%----------------------------------------------- +@x +@d fil_glue==zero_glue+glue_spec_size {\.{0pt plus 1fil minus 0pt}} +@y +@d sfi_glue==zero_glue+glue_spec_size {\.{0pt plus 1fi minus 0pt}} +@d fil_glue==sfi_glue+glue_spec_size {\.{0pt plus 1fil minus 0pt}} +@z +%----------------------------------------------- +@x +stretch(fil_glue):=unity; stretch_order(fil_glue):=fil;@/ +stretch(fill_glue):=unity; stretch_order(fill_glue):=fill;@/ +@y +stretch(sfi_glue):=unity; stretch_order(sfi_glue):=sfi;@/ +stretch(fil_glue):=unity; stretch_order(fil_glue):=fil;@/ +stretch(fill_glue):=unity; stretch_order(fill_glue):=fill;@/ +@z +%----------------------------------------------- +@x + begin print("fil"); + while order>fil do +@y + begin print("fi"); + while order>sfi do +@z +%----------------------------------------------- +@x +@d last_item=math_given+1 {most recent item ( \.{\\lastpenalty}, +@y +@d omath_given=math_given+1 {math code defined by \.{\\omathchardef}} +@d last_item=omath_given+1 {most recent item ( \.{\\lastpenalty}, +@z +%----------------------------------------------- +@x +@d math_font_base=cur_font_loc+1 {table of 48 math font numbers} +@d cur_jfont_loc=math_font_base+48 +@y +@d math_font_base=cur_font_loc+1 {table of 768 math font numbers} +@d cur_jfont_loc=math_font_base+768 +@z +%----------------------------------------------- +@x +@d var_code==@'70000 {math code meaning ``use the current family''} +@y +@d var_code==@"70000 {math code meaning ``use the current family''} +@z +%----------------------------------------------- +@x +for k:=math_font_base to math_font_base+47 do eqtb[k]:=eqtb[cur_font_loc]; +@y +for k:=math_font_base to math_font_base+767 do eqtb[k]:=eqtb[cur_font_loc]; +@z +%----------------------------------------------- +@x +begin if n=cur_font_loc then print("current font") +else if n +@y +primitive("delimiter",delim_num,0);@/ +@!@:delimiter_}{\.{\\delimiter} primitive@> +primitive("odelimiter",delim_num,1);@/ +@!@:delimiter_}{\.{\\odelimiter} primitive@> +@z +%----------------------------------------------- +@x +primitive("mathaccent",math_accent,0);@/ +@!@:math_accent_}{\.{\\mathaccent} primitive@> +primitive("mathchar",math_char_num,0);@/ +@!@:math_char_}{\.{\\mathchar} primitive@> +@y +primitive("mathaccent",math_accent,0);@/ +@!@:math_accent_}{\.{\\mathaccent} primitive@> +primitive("mathchar",math_char_num,0);@/ +@!@:math_char_}{\.{\\mathchar} primitive@> +primitive("omathaccent",math_accent,1);@/ +@!@:math_accent_}{\.{\\omathaccent} primitive@> +primitive("omathchar",math_char_num,1);@/ +@!@:math_char_}{\.{\\omathchar} primitive@> +@z +%----------------------------------------------- +@x +primitive("radical",radical,0);@/ +@!@:radical_}{\.{\\radical} primitive@> +@y +primitive("radical",radical,0);@/ +@!@:radical_}{\.{\\radical} primitive@> +primitive("oradical",radical,1);@/ +@!@:radical_}{\.{\\oradical} primitive@> +@z +%----------------------------------------------- +@x +delim_num: print_esc("delimiter"); +@y +delim_num: if chr_code=0 then print_esc("delimiter") + else print_esc("odelimiter"); +@z +@x +math_accent: print_esc("mathaccent"); +math_char_num: print_esc("mathchar"); +@y +math_accent: if chr_code=0 then print_esc("mathaccent") + else print_esc("omathaccent"); +math_char_num: if chr_code=0 then print_esc("mathchar") + else print_esc("omathchar"); +@z +@x +radical: print_esc("radical"); +@y +radical: if chr_code=0 then print_esc("radical") + else print_esc("oradical"); +@z +%----------------------------------------------- +@x +@p procedure eq_word_define(@!p:pointer;@!w:integer); +label exit; +begin if eTeX_ex and(eqtb[p].int=w) then + begin assign_trace(p,"reassigning")@;@/ + return; + end; +assign_trace(p,"changing")@;@/ +if xeq_level[p]<>cur_level then + begin eq_save(p,xeq_level[p]); xeq_level[p]:=cur_level; + end; +eqtb[p].int:=w; +assign_trace(p,"into")@;@/ +exit:end; +@y +@p procedure eq_word_define(@!p:pointer;@!w:integer); +label exit; +begin if eTeX_ex and(eqtb[p].int=w) then + begin assign_trace(p,"reassigning")@;@/ + return; + end; +assign_trace(p,"changing")@;@/ +if xeq_level[p]<>cur_level then + begin eq_save(p,xeq_level[p]); xeq_level[p]:=cur_level; + end; +eqtb[p].int:=w; +assign_trace(p,"into")@;@/ +exit:end; +@# +procedure del_eq_word_define(@!p:pointer;@!w,wone:integer); +label exit; +begin if eTeX_ex and(eqtb[p].int=w)and(getintone(eqtb[p])=wone) then + begin assign_trace(p,"reassigning")@;@/ + return; + end; +assign_trace(p,"changing")@;@/ +if xeq_level[p]<>cur_level then + begin eq_save(p,xeq_level[p]); xeq_level[p]:=cur_level; + end; +eqtb[p].int:=w; setintone(eqtb[p],wone); +assign_trace(p,"into")@;@/ +exit:end; +@z +%----------------------------------------------- +@x +procedure geq_word_define(@!p:pointer;@!w:integer); {global |eq_word_define|} +begin assign_trace(p,"globally changing")@;@/ +begin eqtb[p].int:=w; xeq_level[p]:=level_one; +end; +assign_trace(p,"into")@;@/ +end; +@y +procedure geq_word_define(@!p:pointer;@!w:integer); {global |eq_word_define|} +begin assign_trace(p,"globally changing")@;@/ +begin eqtb[p].int:=w; xeq_level[p]:=level_one; +end; +assign_trace(p,"into")@;@/ +end; +@# +procedure del_geq_word_define(@!p:pointer;@!w,wone:integer); + {global |del_eq_word_define|} +begin assign_trace(p,"globally changing")@;@/ +begin eqtb[p].int:=w; setintone(eqtb[p],wone); xeq_level[p]:=level_one; +end; +assign_trace(p,"into")@;@/ +end; +@z +%----------------------------------------------- +@x +@d tok_val=5 {token lists} + +@= +@!cur_val:integer; {value returned by numeric scanners} +@y +@d tok_val=5 {token lists} + +@= +@!cur_val:integer; {value returned by numeric scanners} +@!cur_val1:integer; +@z +%----------------------------------------------- +@x +char_given,math_given: scanned_result(cur_chr)(int_val); +@y +omath_given, +char_given,math_given: scanned_result(cur_chr)(int_val); +@z +%----------------------------------------------- +@x +@ @= +begin +if m=math_code_base then + begin scan_ascii_num; + scanned_result(ho(math_code(cur_val)))(int_val); end +@y +@ @= +begin +if m=math_code_base then begin + scan_ascii_num; cur_val1:=ho(math_code(cur_val)); + if ((cur_val1 div @"10000)>8) or + (((cur_val1 mod @"10000) div @"100)>15) then + begin print_err("Extended mathchar used as mathchar"); +@.Bad mathchar@> + help2("A mathchar number must be between 0 and ""7FFF.")@/ + ("I changed this one to zero."); int_error(cur_val1); + scanned_result(0)(int_val) + end; + cur_val1:=(cur_val1 div @"10000)*@"1000+cur_val1 mod @"1000; + scanned_result(cur_val1)(int_val); + end +else if m=(math_code_base+128) then begin + scan_ascii_num; cur_val1:=ho(math_code(cur_val)); + cur_val:=(cur_val1 div @"10000) * @"1000000 + +((cur_val1 div @"100) mod @"100) * @"10000 + +(cur_val1 mod @"100); + scanned_result(cur_val)(int_val); + end +else if m=del_code_base then begin + scan_ascii_num; cur_val1:=del_code(cur_val); cur_val:=del_code1(cur_val); + if ((cur_val1 div @"100) mod @"100 >= 16) or (cur_val>=@"1000) then + begin print_err("Extended delimiter code used as delcode"); +@.Bad delimiter code@> + help2("A numeric delimiter code must be between 0 and 2^{27}-1.")@/ + ("I changed this one to zero."); error; + scanned_result(0)(int_val); + end + else if cur_val1<0 then + scanned_result(cur_val)(int_val) + else + scanned_result(cur_val1*@"1000+cur_val)(int_val); + end +else if m=(del_code_base+128) then begin + { Aleph seems \.{\\odelcode} always returns $-1$.} + scan_ascii_num; scanned_result(-1)(int_val); + end +@z +%----------------------------------------------- +@x +procedure scan_four_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>15) then + begin print_err("Bad number"); +@.Bad number@> + help2("Since I expected to read a number between 0 and 15,")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@y +procedure scan_four_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>15) then + begin print_err("Bad number"); +@.Bad number@> + help2("Since I expected to read a number between 0 and 15,")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@# +procedure scan_big_four_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>255) then + begin print_err("Bad number"); +@.Bad register code@> + help2("Since I expected to read a number between 0 and 255,")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@z +%----------------------------------------------- +@x +procedure scan_fifteen_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@'77777) then + begin print_err("Bad mathchar"); +@.Bad mathchar@> + help2("A mathchar number must be between 0 and 32767.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@y +procedure scan_fifteen_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@'77777) then + begin print_err("Bad mathchar"); +@.Bad mathchar@> + help2("A mathchar number must be between 0 and 32767.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +cur_val:=((cur_val div @"1000) * @"10000)+(cur_val mod @"1000); +end; +@# +procedure scan_real_fifteen_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@'77777) then + begin print_err("Bad mathchar"); +@.Bad mathchar@> + help2("A mathchar number must be between 0 and 32767.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@# +procedure scan_big_fifteen_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@"7FFFFFF) then + begin print_err("Bad extended mathchar"); +@.Bad mathchar@> + help2("An extended mathchar number must be between 0 and ""7FFFFFF.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +{ e-pTeX doesn't support 65536 characters for math font. } +cur_val:=((cur_val div @"10000) * @"100)+(cur_val mod @"100); +end; +@# +procedure scan_omega_fifteen_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@"7FFFFFF) then + begin print_err("Bad extended mathchar"); +@.Bad mathchar@> + help2("An extended mathchar number must be between 0 and ""7FFFFFF.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@z +%----------------------------------------------- +@x +procedure scan_twenty_seven_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@'777777777) then + begin print_err("Bad delimiter code"); +@.Bad delimiter code@> + help2("A numeric delimiter code must be between 0 and 2^{27}-1.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@y +procedure scan_twenty_seven_bit_int; +begin scan_int; +if (cur_val<0)or(cur_val>@'777777777) then + begin print_err("Bad delimiter code"); +@.Bad delimiter code@> + help2("A numeric delimiter code must be between 0 and 2^{27}-1.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +cur_val1 := cur_val mod @"1000; cur_val := cur_val div @"1000; +cur_val := ((cur_val div @"1000) * @"10000) + (cur_val mod @"1000); +end; +@# +procedure scan_fifty_one_bit_int; +var iiii:integer; +begin scan_int; +if (cur_val<0)or(cur_val>@'777777777) then + begin print_err("Bad delimiter code"); +@.Bad delimiter code@> + help2("A numeric delimiter (first part) must be between 0 and 2^{27}-1.") + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +iiii:=((cur_val div @"10000) * @"100) + (cur_val mod @"100); +scan_int; +if (cur_val<0)or(cur_val>@"FFFFFF) then + begin print_err("Bad delimiter code"); +@.Bad delimiter code@> +help2("A numeric delimiter (second part) must be between 0 and 2^{24}-1.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +{ e-pTeX doesn't support 65536 characters for math font. } +cur_val1:=((cur_val div @"10000) * @"100) + (cur_val mod @"100); +cur_val:=iiii; +end; +@z +%----------------------------------------------- +@x +@= +if scan_keyword("fil") then +@.fil@> + begin cur_order:=fil; +@y +@= +if scan_keyword("fi") then +@.fil@> + begin cur_order:=sfi; +@z +%----------------------------------------------- +@x +else if cur_cmd=def_family then + begin m:=cur_chr; scan_four_bit_int; f:=equiv(m+cur_val); +@y +else if cur_cmd=def_family then + begin m:=cur_chr; scan_big_four_bit_int; f:=equiv(m+cur_val); +@z +%----------------------------------------------- +@x +total_stretch[normal]:=0; total_shrink[normal]:=0; +@y +total_stretch[normal]:=0; total_shrink[normal]:=0; +total_stretch[sfi]:=0; total_shrink[sfi]:=0; +@z +%----------------------------------------------- +@x +else if total_stretch[fil]<>0 then o:=fil +@y +else if total_stretch[fil]<>0 then o:=fil +else if total_stretch[sfi]<>0 then o:=sfi +@z +%----------------------------------------------- +@x +else if total_shrink[fil]<>0 then o:=fil +@y +else if total_shrink[fil]<>0 then o:=fil +else if total_shrink[sfi]<>0 then o:=sfi +@z +%----------------------------------------------- +@x +\yskip\hang|math_type(q)=math_char| means that |fam(q)| refers to one of +the sixteen font families, and |character(q)| is the number of a character +@y +\yskip\hang|math_type(q)=math_char| means that |fam(q)| refers to one of +the 256 font families, and |character(q)| is the number of a character +@z +%----------------------------------------------- +@x +procedure print_fam_and_char(@!p:pointer;@!t:small_number); +@y +procedure print_fam_and_char(@!p:pointer;@!t:integer); +@z +%----------------------------------------------- +@x +other font information. A size code, which is a multiple of 16, is added to a +family number to get an index into the table of internal font numbers +for each combination of family and size. (Be alert: Size codes get +larger as the type gets smaller.) + +@d text_size=0 {size code for the largest size in a family} +@d script_size=16 {size code for the medium size in a family} +@d script_script_size=32 {size code for the smallest size in a family} +@y +other font information. A size code, which is a multiple of 256, is added to a +family number to get an index into the table of internal font numbers +for each combination of family and size. (Be alert: Size codes get +larger as the type gets smaller.) +@z +%----------------------------------------------- +@x +else cur_size:=16*((cur_style-text_style) div 2); +@y +else cur_size:=script_size*((cur_style-text_style) div 2); +@z +%----------------------------------------------- +@x +function var_delimiter(@!d:pointer;@!s:small_number;@!v:scaled):pointer; +@y +function var_delimiter(@!d:pointer;@!s:integer;@!v:scaled):pointer; +@z +%----------------------------------------------- +@x +@!hd: eight_bits; {height-depth byte} +@!r: four_quarters; {extensible pieces} +@!z: small_number; {runs through font family members} +@y +@!hd: eight_bits; {height-depth byte} +@!r: four_quarters; {extensible pieces} +@!z: integer; {runs through font family members} +@z +%----------------------------------------------- +@x + begin z:=z+s+16; + repeat z:=z-16; g:=fam_fnt(z); +@y + begin z:=z+s+script_size; + repeat z:=z-script_size; g:=fam_fnt(z); +@z +%----------------------------------------------- +@x + until z<16; +@y + until z0)or(cur_active_width[4]<>0)or@| + (cur_active_width[5]<>0) then +@y +if (cur_active_width[3]<>0)or(cur_active_width[4]<>0)or@| + (cur_active_width[5]<>0)or(cur_active_width[6]<>0) then +@z +%----------------------------------------------- +@x +@ Shrinkability is never infinite in a paragraph; +we can shrink the line from |r| to |cur_p| by at most |cur_active_width[6]|. + +@= +begin if -shortfall>cur_active_width[6] then b:=inf_bad+1 +else b:=badness(-shortfall,cur_active_width[6]); +@y +@ Shrinkability is never infinite in a paragraph; +we can shrink the line from |r| to |cur_p| by at most |cur_active_width[7]|. + +@= +begin if -shortfall>cur_active_width[7] then b:=inf_bad+1 +else b:=badness(-shortfall,cur_active_width[7]); +@z +%----------------------------------------------- +@x + active_width[6]:=active_width[6]+shrink(cur_kanji_skip); +@y + active_width[7]:=active_width[7]+shrink(cur_kanji_skip); +@z +%----------------------------------------------- +@x +active_width[6]:=active_width[6]+shrink(q) +@y +active_width[7]:=active_width[7]+shrink(q) +@z +%----------------------------------------------- +@x + if (active_height[3]<>0) or (active_height[4]<>0) or + (active_height[5]<>0) then b:=0 + else b:=badness(h-cur_height,active_height[2]) +else if cur_height-h>active_height[6] then b:=awful_bad +else b:=badness(cur_height-h,active_height[6]) +@y + if (active_height[3]<>0) or (active_height[4]<>0) or + (active_height[5]<>0) or (active_height[6]<>0) then b:=0 + else b:=badness(h-cur_height,active_height[2]) +else if cur_height-h>active_height[7] then b:=awful_bad +else b:=badness(cur_height-h,active_height[7]) +@z +%----------------------------------------------- +@x + active_height[6]:=active_height[6]+shrink(q); +@y + active_height[7]:=active_height[7]+shrink(q); +@z +%----------------------------------------------- +@x +on the current page. This array contains six |scaled| numbers, like the +@y +on the current page. This array contains seven |scaled| numbers, like the +@z +%----------------------------------------------- +@x +@d page_shrink==page_so_far[6] {shrinkability of the current page} +@d page_depth==page_so_far[7] {depth of the current page} +@y +@d page_shrink==page_so_far[7] {shrinkability of the current page} +@d page_depth==page_so_far[8] {depth of the current page} +@z +%----------------------------------------------- +@x +@= +@!page_so_far:array [0..7] of scaled; {height and glue of the current page} +@y +@= +@!page_so_far:array [0..8] of scaled; {height and glue of the current page} +@z +%----------------------------------------------- +@x +primitive("pagefilstretch",set_page_dimen,3); +@!@:page_fil_stretch_}{\.{\\pagefilstretch} primitive@> +primitive("pagefillstretch",set_page_dimen,4); +@!@:page_fill_stretch_}{\.{\\pagefillstretch} primitive@> +primitive("pagefilllstretch",set_page_dimen,5); +@!@:page_filll_stretch_}{\.{\\pagefilllstretch} primitive@> +primitive("pageshrink",set_page_dimen,6); +@!@:page_shrink_}{\.{\\pageshrink} primitive@> +primitive("pagedepth",set_page_dimen,7); +@!@:page_depth_}{\.{\\pagedepth} primitive@> +@y +primitive("pagefistretch",set_page_dimen,3); +@!@:page_fi_stretch_}{\.{\\pagefistretch} primitive@> +primitive("pagefilstretch",set_page_dimen,4); +@!@:page_fil_stretch_}{\.{\\pagefilstretch} primitive@> +primitive("pagefillstretch",set_page_dimen,5); +@!@:page_fill_stretch_}{\.{\\pagefillstretch} primitive@> +primitive("pagefilllstretch",set_page_dimen,6); +@!@:page_filll_stretch_}{\.{\\pagefilllstretch} primitive@> +primitive("pageshrink",set_page_dimen,7); +@!@:page_shrink_}{\.{\\pageshrink} primitive@> +primitive("pagedepth",set_page_dimen,8); +@!@:page_depth_}{\.{\\pagedepth} primitive@> +@z +%----------------------------------------------- +@x +3: print_esc("pagefilstretch"); +4: print_esc("pagefillstretch"); +5: print_esc("pagefilllstretch"); +6: print_esc("pageshrink"); +@y +3: print_esc("pagefistretch"); +4: print_esc("pagefilstretch"); +5: print_esc("pagefillstretch"); +6: print_esc("pagefilllstretch"); +7: print_esc("pageshrink"); +@z +%----------------------------------------------- +@x +print_plus(3)("fil"); +print_plus(4)("fill"); +print_plus(5)("filll"); +@y +print_plus(3)("fi"); +print_plus(4)("fil"); +print_plus(5)("fill"); +print_plus(6)("filll"); +@z +%----------------------------------------------- +@x + if (page_so_far[3]<>0) or (page_so_far[4]<>0) or@| + (page_so_far[5]<>0) then b:=0 +@y + if (page_so_far[3]<>0) or (page_so_far[4]<>0) or@| + (page_so_far[5]<>0) or (page_so_far[6]<>0) then b:=0 +@z +%----------------------------------------------- +@x +non_math(math_given), non_math(math_comp), non_math(delim_num), +@y +non_math(math_given), non_math(omath_given), +non_math(math_comp), non_math(delim_num), +@z +%----------------------------------------------- +@x +@d fil_code=0 {identifies \.{\\hfil} and \.{\\vfil}} +@d fill_code=1 {identifies \.{\\hfill} and \.{\\vfill}} +@d ss_code=2 {identifies \.{\\hss} and \.{\\vss}} +@d fil_neg_code=3 {identifies \.{\\hfilneg} and \.{\\vfilneg}} +@d skip_code=4 {identifies \.{\\hskip} and \.{\\vskip}} +@d mskip_code=5 {identifies \.{\\mskip}} +@y +@d sfi_code=0 {identifies \.{\\hfi} and \.{\\vfi}} +@d fil_code=1 {identifies \.{\\hfil} and \.{\\vfil}} +@d fill_code=2 {identifies \.{\\hfill} and \.{\\vfill}} +@d ss_code=3 {identifies \.{\\hss} and \.{\\vss}} +@d fil_neg_code=4 {identifies \.{\\hfilneg} and \.{\\vfilneg}} +@d skip_code=5 {identifies \.{\\hskip} and \.{\\vskip}} +@d mskip_code=6 {identifies \.{\\mskip}} +@z +%----------------------------------------------- +@x +primitive("hfil",hskip,fil_code); +@!@:hfil_}{\.{\\hfil} primitive@> +@y +primitive("hfi",hskip,sfi_code); +@!@:hfi_}{\.{\\hfi} primitive@> +primitive("hfil",hskip,fil_code); +@!@:hfil_}{\.{\\hfil} primitive@> +@z +%----------------------------------------------- +@x +primitive("vfil",vskip,fil_code); +@!@:vfil_}{\.{\\vfil} primitive@> +@y +primitive("vfi",vskip,sfi_code); +@!@:vfi_}{\.{\\vfi} primitive@> +primitive("vfil",vskip,fil_code); +@!@:vfil_}{\.{\\vfil} primitive@> +@z +%----------------------------------------------- +@x +hskip: case chr_code of + skip_code:print_esc("hskip"); +@y +hskip: case chr_code of + skip_code:print_esc("hskip"); + sfi_code:print_esc("hfi"); +@z +%----------------------------------------------- +@x +vskip: case chr_code of + skip_code:print_esc("vskip"); +@y +vskip: case chr_code of + skip_code:print_esc("vskip"); + sfi_code:print_esc("vfi"); +@z +%----------------------------------------------- +@x +begin s:=cur_chr; +case s of +fil_code: cur_val:=fil_glue; +@y +begin s:=cur_chr; +case s of +sfi_code: cur_val:=sfi_glue; +fil_code: cur_val:=fil_glue; +@z +%----------------------------------------------- +@x +|global_box_flag-1| represent `\.{\\setbox0}' through `\.{\\setbox32767}'; +codes |global_box_flag| through |ship_out_flag-1| represent +`\.{\\global\\setbox0}' through `\.{\\global\\setbox32767}'; +@y +|global_box_flag-1| represent `\.{\\setbox0}' through `\.{\\setbox65535}'; +codes |global_box_flag| through |ship_out_flag-1| represent +`\.{\\global\\setbox0}' through `\.{\\global\\setbox65535}'; +@z +%----------------------------------------------- +@x +@d box_flag==@'10000000000 {context code for `\.{\\setbox0}'} +@d global_box_flag==@'10000100000 {context code for `\.{\\global\\setbox0}'} +@d ship_out_flag==@'10000200000 {context code for `\.{\\shipout}'} +@d leader_flag==@'10000200001 {context code for `\.{\\leaders}'} +@y +@d box_flag==@"40000000 {context code for `\.{\\setbox0}'} +@d global_box_flag==@"40010000 {context code for `\.{\\global\\setbox0}'} +@d ship_out_flag==@"40020000 {context code for `\.{\\shipout}'} +@d leader_flag==@"40020001 {context code for `\.{\\leaders}'} +@z +%----------------------------------------------- +@x +@d fam_in_range==((cur_fam>=0)and(cur_fam<16)) +@y +@d fam_in_range==((cur_fam>=0)and(cur_fam=var_code)and(fam_in_range) then fam(p):=cur_fam + else fam(p):=(c div 256) mod 16; +@y + if (c>=var_code)and(fam_in_range) then fam(p):=cur_fam + else fam(p):=(c div 256) mod 256; +@z +%----------------------------------------------- +@x +mmode+math_char_num: begin scan_fifteen_bit_int; set_math_char(cur_val); + end; +mmode+math_given: set_math_char(cur_chr); +mmode+delim_num: begin scan_twenty_seven_bit_int; + set_math_char(cur_val div @'10000); +@y +mmode+math_char_num: begin + if cur_chr=0 then scan_fifteen_bit_int + else scan_big_fifteen_bit_int; + set_math_char(cur_val); + end; +mmode+math_given: begin + set_math_char(((cur_chr div @"1000) * @"10000)+(cur_chr mod @"1000)); + end; +mmode+omath_given: begin + set_math_char(((cur_chr div @"10000) * @"100)+(cur_chr mod @"100)); + end; +mmode+delim_num: begin + if cur_chr=0 then scan_twenty_seven_bit_int + else scan_fifty_one_bit_int; + set_math_char(cur_val); {character code of left delimiter} +@z +%----------------------------------------------- +@x +procedure set_math_char(@!c:integer); +var p:pointer; {the new noad} +begin if c>=@'100000 then + @ +else begin p:=new_noad; math_type(nucleus(p)):=math_char; + character(nucleus(p)):=qi(c mod 256); + fam(nucleus(p)):=(c div 256) mod 16; + if c>=var_code then + begin if fam_in_range then fam(nucleus(p)):=cur_fam; + type(p):=ord_noad; + end + else type(p):=ord_noad+(c div @'10000); + link(tail):=p; tail:=p; + if font_dir[fam_fnt(fam(nucleus(p))+cur_size)]<>dir_default then begin +@y +procedure set_math_char(@!c:integer); +var p:pointer; {the new noad} +begin if c>=@"80000 then + @ +else begin p:=new_noad; math_type(nucleus(p)):=math_char; + character(nucleus(p)):=qi(c mod 256); + fam(nucleus(p)):=(c div 256) mod 256; + if c>=var_code then + begin if fam_in_range then fam(nucleus(p)):=cur_fam; + type(p):=ord_noad; + end + else type(p):=ord_noad+(c div @"10000); + link(tail):=p; tail:=p; + if font_dir[fam_fnt(fam(nucleus(p))+cur_size)]<>dir_default then begin +@z +%----------------------------------------------- +@x +@= +procedure scan_delimiter(@!p:pointer;@!r:boolean); +begin if r then scan_twenty_seven_bit_int +else begin @; + case cur_cmd of + letter,other_char: cur_val:=del_code(cur_chr); + delim_num: scan_twenty_seven_bit_int; + othercases cur_val:=-1 + endcases; + end; +if cur_val<0 then @; +small_fam(p):=(cur_val div @'4000000) mod 16; +small_char(p):=qi((cur_val div @'10000) mod 256); +large_fam(p):=(cur_val div 256) mod 16; +large_char(p):=qi(cur_val mod 256); +end; +@y +@= +procedure scan_delimiter(@!p:pointer;@!r:boolean); +begin if r=1 then scan_twenty_seven_bit_int +else if r=2 then scan_fifty_one_bit_int +else begin @; + case cur_cmd of + letter,other_char: begin + cur_val:=del_code(cur_chr); cur_val1:=del_code1(cur_chr); + end; + delim_num: if cur_chr=0 then scan_twenty_seven_bit_int + else scan_fifty_one_bit_int; + othercases begin cur_val:=-1; cur_val1:=-1; end; + endcases; + end; +if cur_val<0 then begin @; + cur_val1:=0; + end; +small_fam(p):=(cur_val div @"100) mod @"100; +small_char(p):=qi(cur_val mod @"100); +large_fam(p):=(cur_val1 div @"100) mod @"100; +large_char(p):=qi(cur_val1 mod @"100); +end; +@z +%----------------------------------------------- +@x +scan_delimiter(left_delimiter(tail),true); +@y +scan_delimiter(left_delimiter(tail),cur_chr+1); +@z +%----------------------------------------------- +@x +scan_fifteen_bit_int; +character(accent_chr(tail)):=qi(cur_val mod 256); +if (cur_val>=var_code)and fam_in_range then fam(accent_chr(tail)):=cur_fam +else fam(accent_chr(tail)):=(cur_val div 256) mod 16; +@y +if cur_chr=0 then scan_fifteen_bit_int +else scan_big_fifteen_bit_int; +character(accent_chr(tail)):=qi(cur_val mod 256); +if (cur_val>=var_code)and fam_in_range then fam(accent_chr(tail)):=cur_fam +else fam(accent_chr(tail)):=(cur_val div 256) mod 256; +@z +%----------------------------------------------- +@x +begin if (e<>0)and((w-total_shrink[normal]+q<=z)or@| + (total_shrink[fil]<>0)or(total_shrink[fill]<>0)or + (total_shrink[filll]<>0)) then +@y +begin if (e<>0)and((w-total_shrink[normal]+q<=z)or@| + (total_shrink[sfi]<>0)or(total_shrink[fil]<>0)or + (total_shrink[fill]<>0)or(total_shrink[filll]<>0)) then +@z +%----------------------------------------------- +@x +@d word_define(#)==if global then geq_word_define(#)@+else eq_word_define(#) +@y +@d word_define(#)==if global then geq_word_define(#)@+else eq_word_define(#) +@d del_word_define(#)==if global + then del_geq_word_define(#)@+else del_eq_word_define(#) +@z +%----------------------------------------------- +@x +@d count_def_code=2 {|shorthand_def| for \.{\\countdef}} +@d dimen_def_code=3 {|shorthand_def| for \.{\\dimendef}} +@d skip_def_code=4 {|shorthand_def| for \.{\\skipdef}} +@d mu_skip_def_code=5 {|shorthand_def| for \.{\\muskipdef}} +@d toks_def_code=6 {|shorthand_def| for \.{\\toksdef}} +@d char_sub_def_code=7 {|shorthand_def| for \.{\\charsubdef}} +@y +@d omath_char_def_code=2 {|shorthand_def| for \.{\\omathchardef}} +@d count_def_code=3 {|shorthand_def| for \.{\\countdef}} +@d dimen_def_code=4 {|shorthand_def| for \.{\\dimendef}} +@d skip_def_code=5 {|shorthand_def| for \.{\\skipdef}} +@d mu_skip_def_code=6 {|shorthand_def| for \.{\\muskipdef}} +@d toks_def_code=7 {|shorthand_def| for \.{\\toksdef}} +@d char_sub_def_code=8 {|shorthand_def| for \.{\\charsubdef}} +@z +%----------------------------------------------- +@x +primitive("mathchardef",shorthand_def,math_char_def_code);@/ +@!@:math_char_def_}{\.{\\mathchardef} primitive@> +@y +primitive("mathchardef",shorthand_def,math_char_def_code);@/ +@!@:math_char_def_}{\.{\\mathchardef} primitive@> +primitive("omathchardef",shorthand_def,omath_char_def_code);@/ +@!@:math_char_def_}{\.{\\omathchardef} primitive@> +@z +%----------------------------------------------- +@x + math_char_def_code: print_esc("mathchardef"); +@y + math_char_def_code: print_esc("mathchardef"); + omath_char_def_code: print_esc("omathchardef"); +@z +%----------------------------------------------- +@x +math_given: begin print_esc("mathchar"); print_hex(chr_code); + end; +@y +math_given: begin print_esc("mathchar"); print_hex(chr_code); + end; +omath_given: begin print_esc("omathchar"); print_hex(chr_code); + end; +@z +%----------------------------------------------- +@x + math_char_def_code: begin scan_fifteen_bit_int; define(p,math_given,cur_val); +@y + math_char_def_code: begin scan_real_fifteen_bit_int; + define(p,math_given,cur_val); + end; + omath_char_def_code: begin scan_omega_fifteen_bit_int; + define(p,omath_given,cur_val); +@z +%----------------------------------------------- +@x +primitive("mathcode",def_code,math_code_base); +@!@:math_code_}{\.{\\mathcode} primitive@> +@y +primitive("mathcode",def_code,math_code_base); +@!@:math_code_}{\.{\\mathcode} primitive@> +primitive("omathcode",def_code,math_code_base+128); +@!@:math_code_}{\.{\\omathcode} primitive@> +@z +%----------------------------------------------- +@x +primitive("delcode",def_code,del_code_base); +@!@:del_code_}{\.{\\delcode} primitive@> +@y +primitive("delcode",def_code,del_code_base); +@!@:del_code_}{\.{\\delcode} primitive@> +primitive("odelcode",def_code,del_code_base+128); +@!@:del_code_}{\.{\\odelcode} primitive@> +@z +%----------------------------------------------- +@x + else if chr_code=lc_code_base then print_esc("lccode") + else if chr_code=uc_code_base then print_esc("uccode") + else if chr_code=sf_code_base then print_esc("sfcode") + else print_esc("delcode"); +@y + else if chr_code=math_code_base+128 then print_esc("omathcode") + else if chr_code=lc_code_base then print_esc("lccode") + else if chr_code=uc_code_base then print_esc("uccode") + else if chr_code=sf_code_base then print_esc("sfcode") + else if chr_code=del_code_base then print_esc("delcode") + else print_esc("odelcode"); +@z +%----------------------------------------------- +@x +@= +def_code: begin + @; + @; + p:=cur_chr; + if p=kcat_code_base then + begin scan_char_num; p:=p+kcatcodekey(cur_val) end + else begin scan_ascii_num; p:=p+cur_val; end; + scan_optional_equals; scan_int; + if ((cur_valn) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + if p= +def_code: begin + if cur_chr=(del_code_base+128) then begin + p:=cur_chr-128; scan_ascii_num; p:=p+cur_val; scan_optional_equals; + scan_int; cur_val1:=cur_val; scan_int; {backwards} + if (cur_val1>@"FFFFFF) or (cur_val>@"FFFFFF) then + begin print_err("Invalid code ("); print_int(cur_val1); print(" "); + print_int(cur_val); + print("), should be at most ""FFFFFF ""FFFFFF"); + help1("I'm going to use 0 instead of that illegal code value.");@/ + error; cur_val1:=0; cur_val:=0; + end; + cur_val1:=(cur_val1 div @"10000)*@"100+(cur_val1 mod @"100); + cur_val:=(cur_val div @"10000)*@"100+(cur_val mod @"100); + del_word_define(p,cur_val1,cur_val); + end + else begin + @; + @; + p:=cur_chr; cur_val1:=p; + if p=kcat_code_base then begin scan_char_num; p:=p+kcatcodekey(cur_val) end + else begin scan_ascii_num; p:=p+cur_val; end; + scan_optional_equals; scan_int; + if ((cur_valn) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + if p=0 then begin + cur_val1:=cur_val div @"1000; + cur_val1:=(cur_val1 div @"1000)*@"10000 + cur_val1 mod @"1000; + cur_val:=cur_val mod @"1000; + del_word_define(p,cur_val1,cur_val); end + else + del_word_define(p, -1, cur_val); + end + else define(p,data,cur_val); + end; + end; +@z +%----------------------------------------------- +@x +else if cur_chr=kcat_code_base then n:=max_char_code +else if cur_chr=math_code_base then n:=@'100000 +@y +else if cur_chr=kcat_code_base then n:=max_char_code +else if cur_chr=math_code_base then n:=@"8000 +else if cur_chr=(math_code_base+128) then n:=@"8000000 +@z +%----------------------------------------------- +@x +def_family: begin p:=cur_chr; scan_four_bit_int; p:=p+cur_val; +@y +def_family: begin p:=cur_chr; scan_big_four_bit_int; p:=p+cur_val; +@z +%----------------------------------------------- +@x +@ @= +repeat j:=k; +while jeqtb[j+1].int then goto done2; +@y +@ @= +repeat j:=k; +while jeqtb[j+1].int)or@| + (getintone(eqtb[j])<>getintone(eqtb[j+1])) then goto done2; +@z +%----------------------------------------------- +@x + else cur_val:=shrink_order(q); +@y + else cur_val:=shrink_order(q); + if cur_val>normal then cur_val:=cur_val-1; {compatible to \eTeX} +@z +%----------------------------------------------- +@x FAM256 65536 Registers +@ \eTeX\ (in extended mode) supports 32768 (i.e., $2^{15}$) count, +@y +@ \epTeX\ (in extended mode) supports 65536 (i.e., $2^{16}$) count, +@z +%----------------------------------------------- +@x +Similarly there are 32768 mark classes; the command \.{\\marks}|n| +creates a mark node for a given mark class |0<=n<=32767| (where +@y +Similarly there are 65536 mark classes; the command \.{\\marks}|n| +creates a mark node for a given mark class |0<=n<=65535| (where +@z +%----------------------------------------------- +@x +not exceed 255 in compatibility mode resp.\ 32767 in extended mode. +@y +not exceed 255 in compatibility mode resp.\ 65535 in extended mode. +@z +%----------------------------------------------- +@x +max_reg_num:=32767; +max_reg_help_line:="A register number must be between 0 and 32767."; +@y +max_reg_num:=65535; +max_reg_help_line:="A register number must be between 0 and 65535."; +@z +%----------------------------------------------- +@x +sparse array of the up to 32512 additional registers of each kind and +one for the sparse array of the up to 32767 additional mark classes. +The root of each such tree, if it exists, is an index node containing 16 +pointers to subtrees for 4096 consecutive array elements. Similar index +nodes are the starting points for all nonempty subtrees for 4096, 256, +and 16 consecutive array elements. These four levels of index nodes are +followed by a fifth level with nodes for the individual array elements. +@y +sparse array of the up to 65280 additional registers of each kind and +one for the sparse array of the up to 65535 additional mark classes. +The root of each such tree, if it exists, is an index node containing 16 +pointers to subtrees for 65536 consecutive array elements. Similar index +nodes are the starting points for all nonempty subtrees for 65536, 4096, +256, and 16 consecutive array elements. These five levels of index nodes +are followed by a sixth level with nodes for the individual array elements. +@z +%----------------------------------------------- +@x +@d hex_dig1(#)==# div 4096 {the fourth lowest hexadecimal digit} +@d hex_dig2(#)==(# div 256) mod 16 {the third lowest hexadecimal digit} +@d hex_dig3(#)==(# div 16) mod 16 {the second lowest hexadecimal digit} +@d hex_dig4(#)==# mod 16 {the lowest hexadecimal digit} +@y +@d hex_dig1(#)==# div 65536 {the fifth lowest hexadecimal digit} +@d hex_dig2(#)==(# div 4096) mod 16 {the fourth lowest hexadecimal digit} +@d hex_dig3(#)==(# div 256) mod 16 {the third lowest hexadecimal digit} +@d hex_dig4(#)==(# div 16) mod 16 {the second lowest hexadecimal digit} +@d hex_dig5(#)==# mod 16 {the lowest hexadecimal digit} +@z +%----------------------------------------------- +@x +procedure find_sa_element(@!t:small_number;@!n:halfword;@!w:boolean); + {sets |cur_val| to sparse array element location or |null|} +label not_found,not_found1,not_found2,not_found3,not_found4,exit; +var q:pointer; {for list manipulations} +@!i:small_number; {a four bit index} +begin cur_ptr:=sa_root[t]; +if_cur_ptr_is_null_then_return_or_goto(not_found);@/ +q:=cur_ptr; i:=hex_dig1(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found1);@/ +q:=cur_ptr; i:=hex_dig2(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found2);@/ +q:=cur_ptr; i:=hex_dig3(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found3);@/ +q:=cur_ptr; i:=hex_dig4(n); get_sa_ptr; +if (cur_ptr=null)and w then goto not_found4; +return; +not_found: new_index(t,null); {create first level index node} +sa_root[t]:=cur_ptr; q:=cur_ptr; i:=hex_dig1(n); +not_found1: new_index(i,q); {create second level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig2(n); +not_found2: new_index(i,q); {create third level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig3(n); +not_found3: new_index(i,q); {create fourth level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig4(n); +not_found4: @; +link(cur_ptr):=q; add_sa_ptr; +exit:end; +@y +procedure find_sa_element(@!t:small_number;@!n:halfword;@!w:boolean); + {sets |cur_val| to sparse array element location or |null|} +label not_found,not_found1,not_found2,not_found3,not_found4,not_found5,exit; +var q:pointer; {for list manipulations} +@!i:small_number; {a four bit index} +begin cur_ptr:=sa_root[t]; +if_cur_ptr_is_null_then_return_or_goto(not_found);@/ +q:=cur_ptr; i:=hex_dig1(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found1);@/ +q:=cur_ptr; i:=hex_dig2(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found2);@/ +q:=cur_ptr; i:=hex_dig3(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found3);@/ +q:=cur_ptr; i:=hex_dig4(n); get_sa_ptr; +if_cur_ptr_is_null_then_return_or_goto(not_found4);@/ +q:=cur_ptr; i:=hex_dig5(n); get_sa_ptr; +if (cur_ptr=null)and w then goto not_found5; +return; +not_found: new_index(t,null); {create first level index node} +sa_root[t]:=cur_ptr; q:=cur_ptr; i:=hex_dig1(n); +not_found1: new_index(i,q); {create second level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig2(n); +not_found2: new_index(i,q); {create third level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig3(n); +not_found3: new_index(i,q); {create fourth level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig4(n); +not_found4: new_index(i,q); {create fifth level index node} +add_sa_ptr; q:=cur_ptr; i:=hex_dig5(n); +not_found5: @; +link(cur_ptr):=q; add_sa_ptr; +exit:end; +@z +%----------------------------------------------- +@x +repeat i:=hex_dig4(sa_index(q)); p:=q; q:=link(p); free_node(p,s); +@y +repeat i:=hex_dig5(sa_index(q)); p:=q; q:=link(p); free_node(p,s); +@z +%----------------------------------------------- +@x +else begin n:=hex_dig4(sa_index(q)); q:=link(q); n:=n+16*sa_index(q); + q:=link(q); n:=n+256*(sa_index(q)+16*sa_index(link(q))); +@y +else begin n:=hex_dig5(sa_index(q)); q:=link(q); n:=n+16*sa_index(q); + q:=link(q); n:=n+256*(sa_index(q)+16*sa_index(link(q))); + q:=link(link(q)); n:=n+65536*sa_index(q); +@z +%----------------------------------------------- +@x +begin if l<4 then {|q| is an index node} +@y +begin if l<5 then {|q| is an index node} +@z +%----------------------------------------------- +@x +@!fill_width:array[0..2] of scaled; {infinite stretch components of +@y +@!fill_width:array[0..3] of scaled; {infinite stretch components of +@z +%----------------------------------------------- +@x + if (background[3]=0)and(background[4]=0)and(background[5]=0) then + begin do_last_line_fit:=true; + active_node_size:=active_node_size_extended; + fill_width[0]:=0; fill_width[1]:=0; fill_width[2]:=0; +@y + if (background[3]=0)and(background[4]=0)and@| + (background[5]=0)and(background[6]=0) then + begin do_last_line_fit:=true; + active_node_size:=active_node_size_extended; + fill_width[0]:=0; fill_width[1]:=0; fill_width[2]:=0; fill_width[3]:=0; +@z +%----------------------------------------------- +@x +if (cur_active_width[3]<>fill_width[0])or@| + (cur_active_width[4]<>fill_width[1])or@| + (cur_active_width[5]<>fill_width[2]) then goto not_found; + {infinite stretch of this line not entirely due to |par_fill_skip|} +if active_short(r)>0 then g:=cur_active_width[2] +else g:=cur_active_width[6]; +@y +if (cur_active_width[3]<>fill_width[0])or@| + (cur_active_width[4]<>fill_width[1])or@| + (cur_active_width[5]<>fill_width[2])or@| + (cur_active_width[6]<>fill_width[3]) then goto not_found; + {infinite stretch of this line not entirely due to |par_fill_skip|} +if active_short(r)>0 then g:=cur_active_width[2] +else g:=cur_active_width[7]; +@z +%--------------------------------------- +@x +begin if -g>cur_active_width[6] then g:=-cur_active_width[6]; +b:=badness(-g,cur_active_width[6]); +@y +begin if -g>cur_active_width[7] then g:=-cur_active_width[7]; +b:=badness(-g,cur_active_width[7]); +@z +%----------------------------------------------- +@x +if shortfall>0 then g:=cur_active_width[2] +else if shortfall<0 then g:=cur_active_width[6] +@y +if shortfall>0 then g:=cur_active_width[2] +else if shortfall<0 then g:=cur_active_width[7] +@z diff --git a/Build/source/texk/web2c/euptexdir/pdfutils.ch b/Build/source/texk/web2c/euptexdir/pdfutils.ch new file mode 100644 index 00000000000..73dfb8e3fe6 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/pdfutils.ch @@ -0,0 +1,2150 @@ +%% Support for some primitives defined in pdfTeX +%% +%% \pdfstrcmp: need for LaTeX3 +%% In comparison, Japanese characters will be always encoded in UTF-8. +%% +%% \pdffilemoddate and co.: for standalone package +%% (\pdfcreationdate, \pdffilemoddate, \pdffilesize) +%% +%% \pdfsavepos and co. +%% (\pdfsavepos, \pdfpage{width,height}, \pdflast{x,y}pos) +%% +%% \pdffiledump: for bmpsize package by Heiko Oberdiek +%% +%% \pdfshellescape: by doraTeX's request +%% +%% \pdfmdfivesum: by Akira's request +%% As \pdfstrcmp, Japanese characters will be always encoded in UTF-8 in +%% \pdfmdfivesum {...}. (no conversion for \pdfmdfivesum file ) +%% +%% \pdfprimitive and \ifpdfprimitive: for LaTeX3 (2015/07/15) +%% +%% \pdfuniformdeviate and co.: +%% (\pdfnormaldeviate, \pdfrandomseed, \pdfsetrandomseed) +%% +%% \pdfelapsedtime and \pdfresettimer +%% +%% \expanded +%% +%% \ifincsname +%% +%% \Uchar, \Ucharcat +%% +%% \vadjust pre (2021-07-01) + +@x +@* \[8] Packed data. +@y +@* \[7b] Random numbers. + +\font\tenlogo=logo10 % font used for the METAFONT logo +\def\MP{{\tenlogo META}\-{\tenlogo POST}} +\def\pdfTeX{pdf\TeX} + +This section is (almost) straight from MetaPost. I had to change +the types (use |integer| instead of |fraction|), but that should +not have any influence on the actual calculations (the original +comments refer to quantities like |fraction_four| ($2^{30}$), and +that is the same as the numeric representation of |maxdimen|). + +I've copied the low-level variables and routines that are needed, but +only those (e.g. |m_log|), not the accompanying ones like |m_exp|. Most +of the following low-level numeric routines are only needed within the +calculation of |norm_rand|. I've been forced to rename |make_fraction| +to |make_frac| because TeX already has a routine by that name with +a wholly different function (it creates a |fraction_noad| for math +typesetting) -- Taco + +And now let's complete our collection of numeric utility routines +by considering random number generation. +\MP\ generates pseudo-random numbers with the additive scheme recommended +in Section 3.6 of {\sl The Art of Computer Programming}; however, the +results are random fractions between 0 and |fraction_one-1|, inclusive. + +There's an auxiliary array |randoms| that contains 55 pseudo-random +fractions. Using the recurrence $x_n=(x_{n-55}-x_{n-31})\bmod 2^{28}$, +we generate batches of 55 new $x_n$'s at a time by calling |new_randoms|. +The global variable |j_random| tells which element has most recently +been consumed. + +@= +@!randoms:array[0..54] of integer; {the last 55 random values generated} +@!j_random:0..54; {the number of unused |randoms|} +@!random_seed:scaled; {the default random seed} + +@ A small bit of metafont is needed. + +@d fraction_half==@'1000000000 {$2^{27}$, represents 0.50000000} +@d fraction_one==@'2000000000 {$2^{28}$, represents 1.00000000} +@d fraction_four==@'10000000000 {$2^{30}$, represents 4.00000000} +@d el_gordo == @'17777777777 {$2^{31}-1$, the largest value that \MP\ likes} +@d halfp(#)==(#) div 2 +@d double(#) == #:=#+# {multiply a variable by two} + +@ The |make_frac| routine produces the |fraction| equivalent of +|p/q|, given integers |p| and~|q|; it computes the integer +$f=\lfloor2^{28}p/q+{1\over2}\rfloor$, when $p$ and $q$ are +positive. If |p| and |q| are both of the same scaled type |t|, +the ``type relation'' |make_frac(t,t)=fraction| is valid; +and it's also possible to use the subroutine ``backwards,'' using +the relation |make_frac(t,fraction)=t| between scaled types. + +If the result would have magnitude $2^{31}$ or more, |make_frac| +sets |arith_error:=true|. Most of \MP's internal computations have +been designed to avoid this sort of error. + +If this subroutine were programmed in assembly language on a typical +machine, we could simply compute |(@t$2^{28}$@>*p)div q|, since a +double-precision product can often be input to a fixed-point division +instruction. But when we are restricted to \PASCAL\ arithmetic it +is necessary either to resort to multiple-precision maneuvering +or to use a simple but slow iteration. The multiple-precision technique +would be about three times faster than the code adopted here, but it +would be comparatively long and tricky, involving about sixteen +additional multiplications and divisions. + +This operation is part of \MP's ``inner loop''; indeed, it will +consume nearly 10\pct! of the running time (exclusive of input and output) +if the code below is left unchanged. A machine-dependent recoding +will therefore make \MP\ run faster. The present implementation +is highly portable, but slow; it avoids multiplication and division +except in the initial stage. System wizards should be careful to +replace it with a routine that is guaranteed to produce identical +results in all cases. +@^system dependencies@> + +As noted below, a few more routines should also be replaced by machine-dependent +code, for efficiency. But when a procedure is not part of the ``inner loop,'' +such changes aren't advisable; simplicity and robustness are +preferable to trickery, unless the cost is too high. +@^inner loop@> + +@p function make_frac(@!p,@!q:integer):integer; +var @!f:integer; {the fraction bits, with a leading 1 bit} +@!n:integer; {the integer part of $\vert p/q\vert$} +@!negative:boolean; {should the result be negated?} +@!be_careful:integer; {disables certain compiler optimizations} +begin if p>=0 then negative:=false +else begin negate(p); negative:=true; + end; +if q<=0 then + begin debug if q=0 then confusion("/");@;@+gubed@;@/ +@:this can't happen /}{\quad \./@> + negate(q); negative:=not negative; + end; +n:=p div q; p:=p mod q; +if n>=8 then + begin arith_error:=true; + if negative then make_frac:=-el_gordo@+else make_frac:=el_gordo; + end +else begin n:=(n-1)*fraction_one; + @; + if negative then make_frac:=-(f+n)@+else make_frac:=f+n; + end; +end; + +@ The |repeat| loop here preserves the following invariant relations +between |f|, |p|, and~|q|: +(i)~|0<=p + +@= +f:=1; +repeat be_careful:=p-q; p:=be_careful+p; +if p>=0 then f:=f+f+1 +else begin double(f); p:=p+q; + end; +until f>=fraction_one; +be_careful:=p-q; +if be_careful+p>=0 then incr(f) + +@ + +@p function take_frac(@!q:integer;@!f:integer):integer; +var @!p:integer; {the fraction so far} +@!negative:boolean; {should the result be negated?} +@!n:integer; {additional multiple of $q$} +@!be_careful:integer; {disables certain compiler optimizations} +begin @=0| and |q>0|@>; +if f; +be_careful:=n-el_gordo; +if be_careful+p>0 then + begin arith_error:=true; n:=el_gordo-p; + end; +if negative then take_frac:=-(n+p) +else take_frac:=n+p; +end; + +@ @=0| and |q>0|@>= +if f>=0 then negative:=false +else begin negate(f); negative:=true; + end; +if q<0 then + begin negate(q); negative:=not negative; + end; + +@ The invariant relations in this case are (i)~$\lfloor(qf+p)/2^k\rfloor +=\lfloor qf_0/2^{28}+{1\over2}\rfloor$, where $k$ is an integer and +$f_0$ is the original value of~$f$; (ii)~$2^k\L f<2^{k+1}$. +@^inner loop@> + +@= +p:=fraction_half; {that's $2^{27}$; the invariants hold now with $k=28$} +if q= +@!two_to_the:array[0..30] of integer; {powers of two} +@!spec_log:array[1..28] of integer; {special logarithms} + + +@ @= +two_to_the[0]:=1; +for k:=1 to 30 do two_to_the[k]:=2*two_to_the[k-1]; +spec_log[1]:=93032640; +spec_log[2]:=38612034; +spec_log[3]:=17922280; +spec_log[4]:=8662214; +spec_log[5]:=4261238; +spec_log[6]:=2113709; +spec_log[7]:=1052693; +spec_log[8]:=525315; +spec_log[9]:=262400; +spec_log[10]:=131136; +spec_log[11]:=65552; +spec_log[12]:=32772; +spec_log[13]:=16385; +for k:=14 to 27 do spec_log[k]:=two_to_the[27-k]; +spec_log[28]:=1; + +@ + +@p function m_log(@!x:integer):integer; +var @!y,@!z:integer; {auxiliary registers} +@!k:integer; {iteration counter} +begin if x<=0 then @ +else begin y:=1302456956+4-100; {$14\times2^{27}\ln2\approx1302456956.421063$} + z:=27595+6553600; {and $2^{16}\times .421063\approx 27595$} + while xfraction_four+4 do + @; + m_log:=y div 8; + end; +end; + +@ @= +begin z:=((x-1) div two_to_the[k])+1; {$z=\lceil x/2^k\rceil$} +while x= +begin print_err("Logarithm of "); +@.Logarithm...replaced by 0@> +print_scaled(x); print(" has been replaced by 0"); +help2("Since I don't take logs of non-positive numbers,")@/ + ("I'm zeroing this one. Proceed, with fingers crossed."); +error; m_log:=0; +end + +@ The following somewhat different subroutine tests rigorously if $ab$ is +greater than, equal to, or less than~$cd$, +given integers $(a,b,c,d)$. In most cases a quick decision is reached. +The result is $+1$, 0, or~$-1$ in the three respective cases. + +@d return_sign(#)==begin ab_vs_cd:=#; return; + end + +@p function ab_vs_cd(@!a,b,c,d:integer):integer; +label exit; +var @!q,@!r:integer; {temporary registers} +begin @=0|, |b,d>0|@>; +loop@+ begin q := a div d; r := c div b; + if q<>r then + if q>r then return_sign(1)@+else return_sign(-1); + q := a mod d; r := c mod b; + if r=0 then + if q=0 then return_sign(0)@+else return_sign(1); + if q=0 then return_sign(-1); + a:=b; b:=q; c:=d; d:=r; + end; {now |a>d>0| and |c>b>0|} +exit:end; + +@ @= +if a<0 then + begin negate(a); negate(b); + end; +if c<0 then + begin negate(c); negate(d); + end; +if d<=0 then + begin if b>=0 then + if ((a=0)or(b=0))and((c=0)or(d=0)) then return_sign(0) + else return_sign(1); + if d=0 then + if a=0 then return_sign(0)@+else return_sign(-1); + q:=a; a:=c; c:=q; q:=-b; b:=-d; d:=q; + end +else if b<=0 then + begin if b<0 then if a>0 then return_sign(-1); + if c=0 then return_sign(0) else return_sign(-1); + end + +@ To consume a random integer, the program below will say `|next_random|' +and then it will fetch |randoms[j_random]|. + +@d next_random==if j_random=0 then new_randoms + else decr(j_random) + +@p procedure new_randoms; +var @!k:0..54; {index into |randoms|} +@!x:integer; {accumulator} +begin for k:=0 to 23 do + begin x:=randoms[k]-randoms[k+31]; + if x<0 then x:=x+fraction_one; + randoms[k]:=x; + end; +for k:=24 to 54 do + begin x:=randoms[k]-randoms[k-24]; + if x<0 then x:=x+fraction_one; + randoms[k]:=x; + end; +j_random:=54; +end; + +@ To initialize the |randoms| table, we call the following routine. + +@p procedure init_randoms(@!seed:integer); +var @!j,@!jj,@!k:integer; {more or less random integers} +@!i:0..54; {index into |randoms|} +begin j:=abs(seed); +while j>=fraction_one do j:=halfp(j); +k:=1; +for i:=0 to 54 do + begin jj:=k; k:=j-k; j:=jj; + if k<0 then k:=k+fraction_one; + randoms[(i*21)mod 55]:=j; + end; +new_randoms; new_randoms; new_randoms; {``warm up'' the array} +end; + +@ To produce a uniform random number in the range |0<=u=u>x| +or |0=u=x|, given a |scaled| value~|x|, we proceed as shown here. + +Note that the call of |take_frac| will produce the values 0 and~|x| +with about half the probability that it will produce any other particular +values between 0 and~|x|, because it rounds its answers. + +@p function unif_rand(@!x:integer):integer; +var @!y:integer; {trial value} +begin next_random; y:=take_frac(abs(x),randoms[j_random]); +if y=abs(x) then unif_rand:=0 +else if x>0 then unif_rand:=y +else unif_rand:=-y; +end; + +@ Finally, a normal deviate with mean zero and unit standard deviation +can readily be obtained with the ratio method (Algorithm 3.4.1R in +{\sl The Art of Computer Programming\/}). + +@p function norm_rand:integer; +var @!x,@!u,@!l:integer; {what the book would call $2^{16}X$, $2^{28}U$, + and $-2^{24}\ln U$} +begin repeat + repeat next_random; + x:=take_frac(112429,randoms[j_random]-fraction_half); + {$2^{16}\sqrt{8/e}\approx 112428.82793$} + next_random; u:=randoms[j_random]; + until abs(x)=0; +norm_rand:=x; +end; +@* \[8] Packed data. +@z + +% [10] \vadjust pre +@x +@d adjust_ptr(#)==mem[#+1].int + {vertical list to be moved out of horizontal list} +@y +@d adjust_pre == subtype {<>0 => pre-adjustment} +@#{|append_list| is used to append a list to |tail|} +@d append_list(#) == begin link(tail) := link(#); append_list_end +@d append_list_end(#) == tail := #; end + +@d adjust_ptr(#)==mem[#+1].int + {vertical list to be moved out of horizontal list} +@z + +% [11] \vadjust pre +@x +@d hi_mem_stat_min==mem_top-13 {smallest statically allocated word in + the one-word |mem|} +@d hi_mem_stat_usage=14 {the number of one-word nodes always present} +@y +@d pre_adjust_head==mem_top-14 {head of pre-adjustment list returned by |hpack|} +@d hi_mem_stat_min==mem_top-14 {smallest statically allocated word in + the one-word |mem|} +@d hi_mem_stat_usage=15 {the number of one-word nodes always present} +@z + +@x +@* \[12] Displaying boxes. +@y +@@; + +@* \[12] Displaying boxes. +@z + +% [12] \vadjust pre +@x +@ @= +begin print_esc("vadjust"); node_list_display(adjust_ptr(p)); {recursive call} +end +@y +@ @= +begin print_esc("vadjust"); if adjust_pre(p) <> 0 then print(" pre "); +node_list_display(adjust_ptr(p)); {recursive call} +end +@z + +@x \[if]pdfprimitive +@d frozen_special=frozen_control_sequence+10 + {permanent `\.{\\special}'} +@d frozen_null_font=frozen_control_sequence+11 + {permanent `\.{\\nullfont}'} +@y +@d frozen_special=frozen_control_sequence+10 + {permanent `\.{\\special}'} +@d frozen_primitive=frozen_control_sequence+11 + {permanent `\.{\\pdfprimitive}'} +@d prim_eqtb_base=frozen_primitive+1 +@d prim_size=2100 {maximum number of primitives } +@d frozen_null_font=prim_eqtb_base+prim_size+1 + {permanent `\.{\\nullfont}'} +@z + +@x +@d dimen_pars=23 {total number of dimension parameters} +@y +@d pdf_page_width_code=23 {page width} +@d pdf_page_height_code=24 {page height} +@d dimen_pars=25 {total number of dimension parameters} +@z + +@x \pdfpage{width,height} +@d emergency_stretch==dimen_par(emergency_stretch_code) +@y +@d emergency_stretch==dimen_par(emergency_stretch_code) +@d pdf_page_width==dimen_par(pdf_page_width_code) +@d pdf_page_height==dimen_par(pdf_page_height_code) +@z + +@x \pdfpage{width,height} +emergency_stretch_code:print_esc("emergencystretch"); +@y +emergency_stretch_code:print_esc("emergencystretch"); +pdf_page_width_code: print_esc("pdfpagewidth"); +pdf_page_height_code: print_esc("pdfpageheight"); +@z + +@x \[if]pdfprimitive +@!cs_count:integer; {total number of known identifiers} +@y +@!cs_count:integer; {total number of known identifiers} + +@ Primitive support needs a few extra variables and definitions + +@d prim_prime=1777 {about 85\pct! of |primitive_size|} +@d prim_base=1 +@d prim_next(#) == prim[#].lh {link for coalesced lists} +@d prim_text(#) == prim[#].rh {string number for control sequence name, plus one} +@d prim_is_full == (prim_used=prim_base) {test if all positions are occupied} +@d prim_eq_level_field(#)==#.hh.b1 +@d prim_eq_type_field(#)==#.hh.b0 +@d prim_equiv_field(#)==#.hh.rh +@d prim_eq_level(#)==prim_eq_level_field(eqtb[prim_eqtb_base+#]) {level of definition} +@d prim_eq_type(#)==prim_eq_type_field(eqtb[prim_eqtb_base+#]) {command code for equivalent} +@d prim_equiv(#)==prim_equiv_field(eqtb[prim_eqtb_base+#]) {equivalent value} +@d undefined_primitive=0 +@d biggest_char=255 { 65535 in XeTeX } + +@= +@!prim: array [0..prim_size] of two_halves; {the primitives table} +@!prim_used:pointer; {allocation pointer for |prim|} +@z + +@x \[if]pdfprimitive +@ @= +no_new_control_sequence:=true; {new identifiers are usually forbidden} +@y +@ @= +no_new_control_sequence:=true; {new identifiers are usually forbidden} +prim_next(0):=0; prim_text(0):=0; +for k:=1 to prim_size do prim[k]:=prim[0]; +@z + +@x \[if]pdfprimitive +text(frozen_dont_expand):="notexpanded:"; +@.notexpanded:@> +@y +prim_used:=prim_size; {nothing is used} +text(frozen_dont_expand):="notexpanded:"; +@.notexpanded:@> +eq_type(frozen_primitive):=ignore_spaces; +equiv(frozen_primitive):=1; +eq_level(frozen_primitive):=level_one; +text(frozen_primitive):="pdfprimitive"; +@z + +@x \[if]pdfprimitive +@ Single-character control sequences do not need to be looked up in a hash +table, since we can use the character code itself as a direct address. +@y +@ Here is the subroutine that searches the primitive table for an identifier + +@p function prim_lookup(@!s:str_number):pointer; {search the primitives table} +label found; {go here if you found it} +var h:integer; {hash code} +@!p:pointer; {index in |hash| array} +@!k:pointer; {index in string pool} +@!j,@!l:integer; +begin +if s<=biggest_char then begin + if s<0 then begin p:=undefined_primitive; goto found; end + else p:=(s mod prim_prime)+prim_base; {we start searching here} + l:=1 + end +else begin + j:=str_start[s]; + if s = str_ptr then l := cur_length else l := length(s); + @; + p:=h+prim_base; {we start searching here; note that |0<=h1+biggest_char then { |p| points a multi-letter primitive } + begin if length(prim_text(p)-1)=l then + if str_eq_str(prim_text(p)-1,s) then goto found; + end + else if prim_text(p)=1+s then goto found; { |p| points a single-letter primitive } + if prim_next(p)=0 then + begin if no_new_control_sequence then + p:=undefined_primitive + else @; + goto found; + end; + p:=prim_next(p); + end; +found: prim_lookup:=p; +end; + +@ @= +begin if prim_text(p)>0 then + begin repeat if prim_is_full then overflow("primitive size",prim_size); +@:TeX capacity exceeded primitive size}{\quad primitive size@> + decr(prim_used); + until prim_text(prim_used)=0; {search for an empty location in |prim|} + prim_next(p):=prim_used; p:=prim_used; + end; +prim_text(p):=s+1; +end + +@ The value of |prim_prime| should be roughly 85\pct! of +|prim_size|, and it should be a prime number. + +@= +h:=str_pool[j]; +for k:=j+1 to j+l-1 do + begin h:=h+h+str_pool[k]; + while h>=prim_prime do h:=h-prim_prime; + end + +@ Single-character control sequences do not need to be looked up in a hash +table, since we can use the character code itself as a direct address. +@z + +@x print_cs: \pdfprimitive +else begin l:=text(p); +@y +else begin + if (p>=prim_eqtb_base)and(p=prim_eqtb_base)and(p= +@y +@ @= +@!is_in_csname: boolean; + +@ @= +is_in_csname := false; + +@ @= +@z + +@x +no_expand:@; +@y +no_expand: if cur_chr=0 then @ + else @; +@z + +@x +@= +begin save_scanner_status:=scanner_status; scanner_status:=normal; +get_token; scanner_status:=save_scanner_status; t:=cur_tok; +back_input; {now |start| and |loc| point to the backed-up token |t|} +if (t>=cs_token_flag)and(t<>end_write_token) then + begin p:=get_avail; info(p):=cs_token_flag+frozen_dont_expand; + link(p):=loc; start:=p; loc:=p; + end; +end +@y +@= +begin save_scanner_status:=scanner_status; scanner_status:=normal; +get_token; scanner_status:=save_scanner_status; t:=cur_tok; +back_input; {now |start| and |loc| point to the backed-up token |t|} +if (t>=cs_token_flag)and(t<>end_write_token) then + begin p:=get_avail; info(p):=cs_token_flag+frozen_dont_expand; + link(p):=loc; start:=p; loc:=p; + end; +end + +@ The \.{\\pdfprimitive} handling. If the primitive meaning of the next +token is an expandable command, it suffices to replace the current +token with the primitive one and restart |expand|/ + +Otherwise, the token we just read has to be pushed back, as well +as a token matching the internal form of \.{\\pdfprimitive}, that is +sneaked in as an alternate form of |ignore_spaces|. +@!@:pdfprimitive_}{\.{\\pdfprimitive} primitive (internalized)@> + +Simply pushing back a token that matches the correct internal command +does not work, because approach would not survive roundtripping to a +temporary file. + +@= +begin save_scanner_status := scanner_status; scanner_status:=normal; +get_token; scanner_status:=save_scanner_status; +if cur_cs < hash_base then + cur_cs := prim_lookup(cur_cs-single_base) +else + cur_cs := prim_lookup(text(cur_cs)); +if cur_cs<>undefined_primitive then begin + t := prim_eq_type(cur_cs); + if t>max_command then begin + cur_cmd := t; + cur_chr := prim_equiv(cur_cs); + cur_tok := (cur_cmd*@'400)+cur_chr; + cur_cs := 0; + goto reswitch; + end + else begin + back_input; { now |loc| and |start| point to a one-item list } + p:=get_avail; info(p):=cs_token_flag+frozen_primitive; + link(p):=loc; loc:=p; start:=p; + end; + end; +end + +@ This block deals with unexpandable \.{\\primitive} appearing at a spot where +an integer or an internal values should have been found. It fetches the +next token then resets |cur_cmd|, |cur_cs|, and |cur_tok|, based on the +primitive value of that token. No expansion takes place, because the +next token may be all sorts of things. This could trigger further +expansion creating new errors. + +@= +begin +get_token; +if cur_cs < hash_base then + cur_cs := prim_lookup(cur_cs-single_base) +else + cur_cs := prim_lookup(text(cur_cs)); +if cur_cs<>undefined_primitive then begin + cur_cmd := prim_eq_type(cur_cs); + cur_chr := prim_equiv(cur_cs); + cur_cs := prim_eqtb_base+cur_cs; + cur_tok := cs_token_flag+cur_cs; + end +else begin + cur_cmd := relax; + cur_chr := 0; + cur_tok := cs_token_flag+frozen_relax; + cur_cs := frozen_relax; + end; +goto restart; +end +@z + +@x +begin r:=get_avail; p:=r; {head of the list of characters} +repeat get_x_token; +@y +begin r:=get_avail; p:=r; {head of the list of characters} +b := is_in_csname; is_in_csname := true; +repeat get_x_token; +@z + +@x +@; +@y +is_in_csname := b; +@; +@z + +@x scan_keyword +@!k:pool_pointer; {index into |str_pool|} +begin p:=backup_head; link(p):=null; k:=str_start[s]; +@y +@!k:pool_pointer; {index into |str_pool|} +@!save_cur_cs:pointer; {to save |cur_cs|} +begin p:=backup_head; link(p):=null; k:=str_start[s]; +save_cur_cs:=cur_cs; +@z + +@x scan_keyword + scan_keyword:=false; return; +@y + cur_cs:=save_cur_cs; + scan_keyword:=false; return; +@z + +@x \[if]pdfprimitive : scan_something_internal +procedure scan_something_internal(@!level:small_number;@!negative:boolean); + {fetch an internal parameter} +label exit; +@y +procedure scan_something_internal(@!level:small_number;@!negative:boolean); + {fetch an internal parameter} +label exit, restart; +@z + +@x \[if]pdfprimitive : scan_something_internal +begin m:=cur_chr; +@y +begin restart: m:=cur_chr; +@z + +@x \[if]pdfprimitive : scan_something_internal +last_item: @; +@y +last_item: @; +ignore_spaces: {trap unexpandable primitives} + if cur_chr=1 then @; +@z + +@x +@d ptex_minor_version_code=eptex_version_code+1 {code for \.{\\ptexminorversion}} +@y +@d ptex_minor_version_code=eptex_version_code+1 {code for \.{\\ptexminorversion}} +@d pdf_last_x_pos_code=ptex_minor_version_code+1 {code for \.{\\pdflastxpos}} +@d pdf_last_y_pos_code=pdf_last_x_pos_code+1 {code for \.{\\pdflastypos}} +@d pdf_shell_escape_code=pdf_last_y_pos_code+1 {code for \.{\\pdflastypos}} +@d elapsed_time_code=pdf_shell_escape_code+1 {code for \.{\\pdfelapsedtime}} +@d random_seed_code=elapsed_time_code+1 {code for \.{\\pdfrandomseed}} +@z + +@x +@d eTeX_int=ptex_minor_version_code+1 {first of \eTeX\ codes for integers} +@y +@d eTeX_int=random_seed_code+1 {first of \eTeX\ codes for integers} +@z + +@x \[if]pdfprimitive: scan_int +@p procedure scan_int; {sets |cur_val| to an integer} +label done; +@y +@p procedure scan_int; {sets |cur_val| to an integer} +label done, restart; +@z + +@x \[if]pdfprimitive: scan_int +if cur_tok=alpha_token then @ +@y +restart: +if cur_tok=alpha_token then @ +else if cur_tok=cs_token_flag+frozen_primitive then + @ +@z + +@x \Ucharcat: str_toks_cat +function str_toks(@!b:pool_pointer):pointer; +@y +function str_toks_cat(@!b:pool_pointer;@!cat:small_number):pointer; +@z + +@x \Ucharcat: str_toks_cat + else if t=" " then t:=space_token + else t:=other_token+t; +@y + else if (t=" ")and(cat=0) then t:=space_token + else if (cat=0)or(cat>=kanji) then t:=other_token+t + else if cat=active_char then t:= cs_token_flag + active_base + t + else t:=left_brace_token*cat+t; +@z + +@x \Ucharcat: str_toks_cat +pool_ptr:=b; str_toks:=p; +end; +@y +pool_ptr:=b; str_toks_cat:=p; +end; + +function str_toks(@!b:pool_pointer):pointer; +begin str_toks:=str_toks_cat(b,0); end; +@z + +@x +@d etex_convert_codes=etex_convert_base+1 {end of \eTeX's command codes} +@d job_name_code=etex_convert_codes {command code for \.{\\jobname}} +@y +@d etex_convert_codes=etex_convert_base+1 {end of \eTeX's command codes} +@d expanded_code = etex_convert_codes {command code for \.{\\expanded}} +@d pdf_first_expand_code = expanded_code + 1 {base for \pdfTeX-like command codes} +@d pdf_strcmp_code = pdf_first_expand_code+0 {command code for \.{\\pdfstrcmp}} +@d pdf_creation_date_code = pdf_first_expand_code+1 {command code for \.{\\pdfcreationdate}} +@d pdf_file_mod_date_code = pdf_first_expand_code+2 {command code for \.{\\pdffilemoddate}} +@d pdf_file_size_code = pdf_first_expand_code+3 {command code for \.{\\pdffilesize}} +@d pdf_mdfive_sum_code = pdf_first_expand_code+4 {command code for \.{\\pdfmdfivesum}} +@d pdf_file_dump_code = pdf_first_expand_code+5 {command code for \.{\\pdffiledump}} +@d uniform_deviate_code = pdf_first_expand_code+6 {command code for \.{\\pdfuniformdeviate}} +@d normal_deviate_code = pdf_first_expand_code+7 {command code for \.{\\pdfnormaldeviate}} +@d pdf_convert_codes = pdf_first_expand_code+8 {end of \pdfTeX-like command codes} +@d Uchar_convert_code = pdf_convert_codes {command code for \.{\\Uchar}} +@d Ucharcat_convert_code = pdf_convert_codes+1 {command code for \.{\\Ucharcat}} +@d eptex_convert_codes = pdf_convert_codes+2 {end of \epTeX's command codes} +@d job_name_code=eptex_convert_codes {command code for \.{\\jobname}} +@z + +@x +primitive("jobname",convert,job_name_code);@/ +@y +@# +primitive("expanded",convert,expanded_code);@/ +@!@:expanded_}{\.{\\expanded} primitive@> +@# +primitive("jobname",convert,job_name_code);@/ +@z + +@x + eTeX_revision_code: print_esc("eTeXrevision"); +@y + eTeX_revision_code: print_esc("eTeXrevision"); + expanded_code: print_esc("expanded"); + pdf_strcmp_code: print_esc("pdfstrcmp"); + pdf_creation_date_code: print_esc("pdfcreationdate"); + pdf_file_mod_date_code: print_esc("pdffilemoddate"); + pdf_file_size_code: print_esc("pdffilesize"); + pdf_mdfive_sum_code: print_esc("pdfmdfivesum"); + pdf_file_dump_code: print_esc("pdffiledump"); + uniform_deviate_code: print_esc("pdfuniformdeviate"); + normal_deviate_code: print_esc("pdfnormaldeviate"); + Uchar_convert_code: print_esc("Uchar"); + Ucharcat_convert_code: print_esc("Ucharcat"); +@z + +@x +@p procedure conv_toks; +@y + +The extra temp string |u| is needed because |pdf_scan_ext_toks| incorporates +any pending string in its output. In order to save such a pending string, +we have to create a temporary string that is destroyed immediately after. + +@d save_cur_string==if str_start[str_ptr]0 then decr(str_ptr) + +@ Not all catcode values are allowed by \.{\\Ucharcat}: +@d illegal_Ucharcat_ascii_catcode(#)==(#active_char)or(#=out_param)or(#=ignore) +@d illegal_Ucharcat_wchar_catcode(#)==(#other_kchar) + +@p procedure conv_toks; +@z + +@x +@!save_scanner_status:small_number; {|scanner_status| upon entry} +@y +@!save_scanner_status:small_number; {|scanner_status| upon entry} +@!save_def_ref: pointer; {|def_ref| upon entry, important if inside `\.{\\message}'} +@!save_warning_index: pointer; +@!bool: boolean; {temp boolean} +@!u: str_number; {saved current string string} +@!s: str_number; {first temp string} +@!i: integer; +@!j: integer; +@!cat:small_number; {desired catcode, or 0 for automatic |spacer|/|other_char| selection} +@z + +@x +begin c:=cur_chr; @; +@y +begin cat:=0; c:=cur_chr; @; +u:=0; { will become non-nil if a string is already being built} +@z + +@x +selector:=old_setting; link(garbage):=str_toks(b); ins_list(link(temp_head)); +@y +selector:=old_setting; link(garbage):=str_toks_cat(b,cat); ins_list(link(temp_head)); +@z + +@x +eTeX_revision_code: do_nothing; +@y +eTeX_revision_code: do_nothing; +expanded_code: + begin + save_scanner_status := scanner_status; + save_warning_index := warning_index; + save_def_ref := def_ref; + save_cur_string; + scan_pdf_ext_toks; + warning_index := save_warning_index; + scanner_status := save_scanner_status; + ins_list(link(def_ref)); + free_avail(def_ref); + def_ref := save_def_ref; + restore_cur_string; + return; + end; +pdf_strcmp_code: + begin + save_scanner_status := scanner_status; + save_warning_index := warning_index; + save_def_ref := def_ref; + save_cur_string; + compare_strings; + def_ref := save_def_ref; + warning_index := save_warning_index; + scanner_status := save_scanner_status; + restore_cur_string; + end; +pdf_creation_date_code: + begin + b := pool_ptr; + getcreationdate; + link(garbage) := str_toks(b); + ins_list(link(temp_head)); + return; + end; +pdf_file_mod_date_code: + begin + save_scanner_status := scanner_status; + save_warning_index := warning_index; + save_def_ref := def_ref; + save_cur_string; + scan_pdf_ext_toks; + s := tokens_to_string(def_ref); + delete_token_ref(def_ref); + def_ref := save_def_ref; + warning_index := save_warning_index; + scanner_status := save_scanner_status; + b := pool_ptr; + getfilemoddate(s); + link(garbage) := str_toks(b); + flush_str(s); + ins_list(link(temp_head)); + restore_cur_string; + return; + end; +pdf_file_size_code: + begin + save_scanner_status := scanner_status; + save_warning_index := warning_index; + save_def_ref := def_ref; + save_cur_string; + scan_pdf_ext_toks; + s := tokens_to_string(def_ref); + delete_token_ref(def_ref); + def_ref := save_def_ref; + warning_index := save_warning_index; + scanner_status := save_scanner_status; + b := pool_ptr; + getfilesize(s); + link(garbage) := str_toks(b); + flush_str(s); + ins_list(link(temp_head)); + restore_cur_string; + return; + end; +pdf_mdfive_sum_code: + begin + save_scanner_status := scanner_status; + save_warning_index := warning_index; + save_def_ref := def_ref; + save_cur_string; + bool := scan_keyword("file"); + scan_pdf_ext_toks; + if bool then s := tokens_to_string(def_ref) + else begin + isprint_utf8:=true; s := tokens_to_string(def_ref); isprint_utf8:=false; + end; + delete_token_ref(def_ref); + def_ref := save_def_ref; + warning_index := save_warning_index; + scanner_status := save_scanner_status; + b := pool_ptr; + getmd5sum(s, bool); + link(garbage) := str_toks(b); + flush_str(s); + ins_list(link(temp_head)); + restore_cur_string; + return; + end; +pdf_file_dump_code: + begin + save_scanner_status := scanner_status; + save_warning_index := warning_index; + save_def_ref := def_ref; + save_cur_string; + {scan offset} + cur_val := 0; + if (scan_keyword("offset")) then begin + scan_int; + if (cur_val < 0) then begin + print_err("Bad file offset"); +@.Bad file offset@> + help2("A file offset must be between 0 and 2^{31}-1,")@/ + ("I changed this one to zero."); + int_error(cur_val); + cur_val := 0; + end; + end; + i := cur_val; + {scan length} + cur_val := 0; + if (scan_keyword("length")) then begin + scan_int; + if (cur_val < 0) then begin + print_err("Bad dump length"); +@.Bad dump length@> + help2("A dump length must be between 0 and 2^{31}-1,")@/ + ("I changed this one to zero."); + int_error(cur_val); + cur_val := 0; + end; + end; + j := cur_val; + {scan file name} + scan_pdf_ext_toks; + s := tokens_to_string(def_ref); + delete_token_ref(def_ref); + def_ref := save_def_ref; + warning_index := save_warning_index; + scanner_status := save_scanner_status; + b := pool_ptr; + getfiledump(s, i, j); + link(garbage) := str_toks(b); + flush_str(s); + ins_list(link(temp_head)); + restore_cur_string; + return; + end; +uniform_deviate_code: scan_int; +normal_deviate_code: do_nothing; +Uchar_convert_code: scan_char_num; +Ucharcat_convert_code: + begin + scan_ascii_num; + i:=cur_val; + scan_int; + if illegal_Ucharcat_ascii_catcode(cur_val) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + print("), should be in the ranges 1..4, 6..8, 10..13"); + help1("I'm going to use 12 instead of that illegal code value.");@/ + error; cat:=12; + end else cat:=cur_val; + cur_val:=i; + end; +@z + +@x +eTeX_revision_code: print(eTeX_revision); +@y +eTeX_revision_code: print(eTeX_revision); +pdf_strcmp_code: print_int(cur_val); +uniform_deviate_code: print_int(unif_rand(cur_val)); +normal_deviate_code: print_int(norm_rand); +Uchar_convert_code: +if is_char_ascii(cur_val) then print_char(cur_val) else print_kanji(cur_val); +Ucharcat_convert_code: +if cat"; {relation to be evaluated} +@y +var b:boolean; {is the condition true?} +@!e:boolean; {keep track of nested csnames} +@!r:"<"..">"; {relation to be evaluated} +@z + +@x \[if]pdfprimitive +if_void_code, if_hbox_code, if_vbox_code: @; +@y +if_void_code, if_hbox_code, if_vbox_code: @; +if_pdfprimitive_code: begin + save_scanner_status:=scanner_status; + scanner_status:=normal; + get_next; + scanner_status:=save_scanner_status; + if cur_cs < hash_base then + m := prim_lookup(cur_cs-single_base) + else + m := prim_lookup(text(cur_cs)); + b :=((cur_cmd<>undefined_cs) and + (m<>undefined_primitive) and + (cur_cmd=prim_eq_type(m)) and + (cur_chr=prim_equiv(m))); + end; +@z + +@x +@ @= +@y +@ @= +@; +@z + +% [33] \vadjust pre +@x +if adjust_tail<>null then link(adjust_tail):=null; +@y +if adjust_tail<>null then link(adjust_tail):=null; +if pre_adjust_tail<>null then link(pre_adjust_tail):=null; +@z + +% [33] \vadjust pre +@x + ins_node,mark_node,adjust_node: if adjust_tail<>null then +@y + ins_node,mark_node,adjust_node: if (adjust_tail<>null) or (pre_adjust_tail<> null) then +@z + +% [33] \vadjust pre +@x +to make a deletion. +@^inner loop@> +@y +to make a deletion. +@^inner loop@> + +@= +@!pre_adjust_tail: pointer; + +@ @= +pre_adjust_tail := null; + +@ Materials in \.{\\vadjust} used with \.{pre} keyword will be appended to +|pre_adjust_tail| instead of |adjust_tail|. + +@d update_adjust_list(#) == begin + if # = null then + confusion("pre vadjust"); + link(#) := adjust_ptr(p); + while link(#) <> null do + # := link(#); +end +@z + +% [33] \vadjust pre +@x +@= +begin while link(q)<>p do q:=link(q); +if type(p)=adjust_node then + begin link(adjust_tail):=adjust_ptr(p); + while link(adjust_tail)<>null do adjust_tail:=link(adjust_tail); + p:=link(p); free_node(link(q),small_node_size); + end +else begin link(adjust_tail):=p; adjust_tail:=p; p:=link(p); + end; +link(q):=p; p:=q; +@y +@= +begin while link(q)<>p do q:=link(q); + if type(p) = adjust_node then begin + if adjust_pre(p) <> 0 then + update_adjust_list(pre_adjust_tail) + else + update_adjust_list(adjust_tail); + p := link(p); free_node(link(q), small_node_size); + end +else begin link(adjust_tail):=p; adjust_tail:=p; p:=link(p); + end; +link(q):=p; p:=q; +@z + +% [37] \vadjust pre +@x +@d align_stack_node_size=5 {number of |mem| words to save alignment states} +@y +@d align_stack_node_size=6 {number of |mem| words to save alignment states} +@z + +% [37] \vadjust pre +@x +@!cur_head,@!cur_tail:pointer; {adjustment list pointers} +@y +@!cur_head,@!cur_tail:pointer; {adjustment list pointers} +@!cur_pre_head,@!cur_pre_tail:pointer; {pre-adjustment list pointers} +@z + +% [37] \vadjust pre +@x +cur_head:=null; cur_tail:=null; +@y +cur_head:=null; cur_tail:=null; +cur_pre_head:=null; cur_pre_tail:=null; +@z + +% [37] procedure |push_alignment|: \vadjust pre +@x +info(p+4):=cur_head; link(p+4):=cur_tail; +align_ptr:=p; +cur_head:=get_avail; +@y +info(p+4):=cur_head; link(p+4):=cur_tail; +info(p+5):=cur_pre_head; link(p+5):=cur_pre_tail; +align_ptr:=p; +cur_head:=get_avail; +cur_pre_head:=get_avail; +@z + +% [37] procedure |pop_alignment|: \vadjust pre +@x +begin free_avail(cur_head); +p:=align_ptr; +cur_tail:=link(p+4); cur_head:=info(p+4); +@y +begin free_avail(cur_head); +free_avail(cur_pre_head); +p:=align_ptr; +cur_tail:=link(p+4); cur_head:=info(p+4); +cur_pre_tail:=link(p+5); cur_pre_head:=info(p+5); +@z + +% [37] \vadjust pre +@x +cur_align:=link(preamble); cur_tail:=cur_head; init_span(cur_align); +@y +cur_align:=link(preamble); cur_tail:=cur_head; cur_pre_tail:=cur_pre_head; +init_span(cur_align); +@z + +% [37] \vadjust pre + pTeX +@x + begin adjust_tail:=cur_tail; adjust_hlist(head,false); +@y + begin adjust_tail:=cur_tail; pre_adjust_tail:=cur_pre_tail; + adjust_hlist(head,false); +@z + +% [37] \vadjust pre +@x + cur_tail:=adjust_tail; adjust_tail:=null; +@y + cur_tail:=adjust_tail; adjust_tail:=null; + cur_pre_tail:=pre_adjust_tail; pre_adjust_tail:=null; +@z + +% [37] \vadjust pre +@x + pop_nest; append_to_vlist(p); + if cur_head<>cur_tail then + begin link(tail):=link(cur_head); tail:=cur_tail; + end; +@y + pop_nest; + if cur_pre_head <> cur_pre_tail then + append_list(cur_pre_head)(cur_pre_tail); + append_to_vlist(p); + if cur_head <> cur_tail then + append_list(cur_head)(cur_tail); +@z + +% [39] \vadjust pre +@x +@ @= +append_to_vlist(just_box); +if adjust_head<>adjust_tail then + begin link(tail):=link(adjust_head); tail:=adjust_tail; + end; +adjust_tail:=null +@y +@ @= +if pre_adjust_head <> pre_adjust_tail then + append_list(pre_adjust_head)(pre_adjust_tail); +pre_adjust_tail := null; +append_to_vlist(just_box); +if adjust_head <> adjust_tail then + append_list(adjust_head)(adjust_tail); +adjust_tail := null +@z + +% [39] \vadjust pre +@x +adjust_tail:=adjust_head; just_box:=hpack(q,cur_width,exactly); +@y +adjust_tail:=adjust_head; +pre_adjust_tail := pre_adjust_head; +just_box:=hpack(q,cur_width,exactly); +@z + +@x \[if]pdfprimitive: main_loop +any_mode(ignore_spaces): begin @; + goto reswitch; + end; +@y +any_mode(ignore_spaces): begin + if cur_chr = 0 then begin + @; + goto reswitch; + end + else begin + t:=scanner_status; + scanner_status:=normal; + get_next; + scanner_status:=t; + if cur_cs < hash_base then + cur_cs := prim_lookup(cur_cs-single_base) + else + cur_cs := prim_lookup(text(cur_cs)); + if cur_cs<>undefined_primitive then begin + cur_cmd := prim_eq_type(cur_cs); + cur_chr := prim_equiv(cur_cs); + cur_tok := cs_token_flag+prim_eqtb_base+cur_cs; + goto reswitch; + end; + end; + end; +@z + +% [47] \vadjust pre +@x + if abs(mode)=vmode then + begin append_to_vlist(cur_box); + if adjust_tail<>null then + begin if adjust_head<>adjust_tail then + begin link(tail):=link(adjust_head); tail:=adjust_tail; + end; + adjust_tail:=null; + end; + if mode>0 then build_page; + end +@y + if abs(mode)=vmode then + begin + if pre_adjust_tail <> null then begin + if pre_adjust_head <> pre_adjust_tail then + append_list(pre_adjust_head)(pre_adjust_tail); + pre_adjust_tail := null; + end; + append_to_vlist(cur_box); + if adjust_tail <> null then begin + if adjust_head <> adjust_tail then + append_list(adjust_head)(adjust_tail); + adjust_tail := null; + end; + if mode>0 then build_page; + end +@z + +% [47] \vadjust pre + pTeX +@x +adjusted_hbox_group: begin adjust_hlist(head,false); + adjust_tail:=adjust_head; package(0); +@y +adjusted_hbox_group: begin adjust_hlist(head,false); + adjust_tail:=adjust_head; + pre_adjust_tail:=pre_adjust_head; package(0); +@z + +% [47] \vadjust pre +@x +saved(0):=cur_val; incr(save_ptr); +@y +saved(0) := cur_val; +if (cur_cmd = vadjust) and scan_keyword("pre") then + saved(1) := 1 +else + saved(1) := 0; +save_ptr := save_ptr + 2; +@z + +% [47] \vadjust pre +@x + d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr); +@y + d:=split_max_depth; f:=floating_penalty; unsave; save_ptr := save_ptr - 2; +@z + +% [47] \vadjust pre + pTeX +@x + r:=get_node(small_node_size); type(r):=adjust_node;@/ + subtype(r):=0; {the |subtype| is not used} + adjust_ptr(r):=list_ptr(p); delete_glue_ref(q); +@y + r:=get_node(small_node_size); type(r):=adjust_node;@/ + adjust_pre(r) := saved(1); {the |subtype| is used for |adjust_pre|} + adjust_ptr(r):=list_ptr(p); delete_glue_ref(q); +@z + +% [48] \vadjust pre +@x +@!t:pointer; {tail of adjustment list} +@y +@!t:pointer; {tail of adjustment list} +@!pre_t:pointer; {tail of pre-adjustment list} +@z + +% [48] \vadjust pre +@x +adjust_tail:=adjust_head; b:=hpack(p,natural); p:=list_ptr(b); +t:=adjust_tail; adjust_tail:=null;@/ +@y +adjust_tail:=adjust_head; pre_adjust_tail:=pre_adjust_head; +b:=hpack(p,natural); p:=list_ptr(b); +t:=adjust_tail; adjust_tail:=null;@/ +pre_t:=pre_adjust_tail; pre_adjust_tail:=null;@/ +@z + +% [48] \vadjust pre +@x +if t<>adjust_head then {migrating material comes after equation number} + begin link(tail):=link(adjust_head); tail:=t; + end; +@y +if t<>adjust_head then {migrating material comes after equation number} + begin link(tail):=link(adjust_head); tail:=t; + end; +if pre_t<>pre_adjust_head then + begin link(tail):=link(pre_adjust_head); tail:=pre_t; + end; +@z + +@x \[if]pdfprimitive: dump prim table +@= +@y +@= +for p:=0 to prim_size do dump_hh(prim[p]); +@z + +@x \[if]pdfprimitive: undump prim table +@ @= +@y +@ @= +for p:=0 to prim_size do undump_hh(prim[p]); +@z + +@x +fix_date_and_time;@/ +@y +fix_date_and_time;@/ +isprint_utf8:=false; +random_seed:=(microseconds*1000)+(epochseconds mod 1000000);@/ +init_randoms(random_seed);@/ +@z + +@x +@d language_node=4 {|subtype| in whatsits that change the current language} +@y +@d latespecial_node=4 {|subtype| in whatsits that represent \.{\\special} things} +@d language_node=5 {|subtype| in whatsits that change the current language} +@z + +@x +@d immediate_code=4 {command modifier for \.{\\immediate}} +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@d epTeX_input_encoding_code=6 {command modifier for \.{\\epTeXinputencoding}} +@y +@d immediate_code=5 {command modifier for \.{\\immediate}} +@d set_language_code=6 {command modifier for \.{\\setlanguage}} +@d epTeX_input_encoding_code=7 {command modifier for \.{\\epTeXinputencoding}} +@d pdf_save_pos_node=epTeX_input_encoding_code+1 +@d set_random_seed_code=pdf_save_pos_node+1 +@d reset_timer_code=set_random_seed_code+1 +@z + +@x + set_language_code:print_esc("setlanguage"); +@y + set_language_code:print_esc("setlanguage"); + pdf_save_pos_node: print_esc("pdfsavepos"); + set_random_seed_code: print_esc("pdfsetrandomseed"); + reset_timer_code: print_esc("pdfresettimer"); +@z + +@x +set_language_code:@; +@y +set_language_code:@; +pdf_save_pos_node: @; +set_random_seed_code: @; +reset_timer_code: @; +@z + +@x +@= +begin new_whatsit(special_node,write_node_size); write_stream(tail):=null; +p:=scan_toks(false,true); write_tokens(tail):=def_ref; +inhibit_glue_flag:=false; +end +@y +@= +begin if scan_keyword("shipout") then +begin new_whatsit(latespecial_node,write_node_size); write_stream(tail):=null; +p:=scan_toks(false,false); write_tokens(tail):=def_ref; +end else +begin new_whatsit(special_node,write_node_size); write_stream(tail):=null; +p:=scan_toks(false,true); write_tokens(tail):=def_ref; +end; +inhibit_glue_flag:=false; +end +@z + +@x +special_node:begin print_esc("special"); + print_mark(write_tokens(p)); + end; +@y +special_node:begin print_esc("special"); + print_mark(write_tokens(p)); + end; +latespecial_node:begin print_esc("special"); print(" shipout"); + print_mark(write_tokens(p)); + end; +@z + +@x \pdfsavepos + print_int(what_lhm(p)); print_char(","); + print_int(what_rhm(p)); print_char(")"); + end; +@y + print_int(what_lhm(p)); print_char(","); + print_int(what_rhm(p)); print_char(")"); + end; +pdf_save_pos_node: print_esc("pdfsavepos"); +set_random_seed_code: print_esc("pdfsetrandomseed"); +reset_timer_code: print_esc("pdfresettimer"); +@z + +@x +write_node,special_node: begin r:=get_node(write_node_size); +@y +write_node,special_node,latespecial_node: begin r:=get_node(write_node_size); +@z + +@x \pdfsavepos +close_node,language_node: begin r:=get_node(small_node_size); + words:=small_node_size; + end; +@y +close_node,language_node: begin r:=get_node(small_node_size); + words:=small_node_size; + end; +pdf_save_pos_node: + r := get_node(small_node_size); +@z + +@x +write_node,special_node: begin delete_token_ref(write_tokens(p)); +@y +write_node,special_node,latespecial_node: begin delete_token_ref(write_tokens(p)); +@z + +@x \pdfsavepos +close_node,language_node: free_node(p,small_node_size); +@y +close_node,language_node: free_node(p,small_node_size); +pdf_save_pos_node: free_node(p, small_node_size); +@z + +@x +procedure special_out(@!p:pointer); +var old_setting:0..max_selector; {holds print |selector|} +@!k:pool_pointer; {index into |str_pool|} +begin synch_h; synch_v;@/ +old_setting:=selector; selector:=new_string; +show_token_list(link(write_tokens(p)),null,pool_size-pool_ptr); +@y +procedure special_out(@!p:pointer); +label done; +var old_setting:0..max_selector; {holds print |selector|} +@!h:halfword; +@!k:pool_pointer; {index into |str_pool|} +@!q,@!r:pointer; {temporary variables for list manipulation} +@!old_mode:integer; {saved |mode|} +@!s,@!t,@!cw, @!num, @!denom: scaled; +@!bl: boolean; +@!i: small_number; +begin synch_h; synch_v;@/ +old_setting:=selector; +if subtype(p)=latespecial_node then + begin @; + h:=def_ref; + end +else h:=write_tokens(p); +selector:=new_string; +show_token_list(link(h),null,pool_size-pool_ptr); +@z + +@x +pool_ptr:=str_start[str_ptr]; {erase the string} +@y +if read_papersize_special>0 then + @; +done: pool_ptr:=str_start[str_ptr]; {erase the string} +if subtype(p)=latespecial_node then + flush_list(def_ref); +@z + +@x +special_node:special_out(p); +language_node:do_nothing; +@y +special_node,latespecial_node:special_out(p); +language_node:do_nothing; +pdf_save_pos_node: + @; +@z + +@x +primitive("eTeXrevision",convert,eTeX_revision_code);@/ +@!@:eTeX_revision_}{\.{\\eTeXrevision} primitive@> +@y +primitive("eTeXrevision",convert,eTeX_revision_code);@/ +@!@:eTeX_revision_}{\.{\\eTeXrevision} primitive@> +primitive("pdfprimitive",no_expand,1);@/ +@!@:pdfprimitive_}{\.{\\pdfprimitive} primitive@> +primitive("pdfstrcmp",convert,pdf_strcmp_code);@/ +@!@:pdf_strcmp_}{\.{\\pdfstrcmp} primitive@> +primitive("pdfcreationdate",convert,pdf_creation_date_code);@/ +@!@:pdf_creation_date_}{\.{\\pdfcreationdate} primitive@> +primitive("pdffilemoddate",convert,pdf_file_mod_date_code);@/ +@!@:pdf_file_mod_date_}{\.{\\pdffilemoddate} primitive@> +primitive("pdffilesize",convert,pdf_file_size_code);@/ +@!@:pdf_file_size_}{\.{\\pdffilesize} primitive@> +primitive("pdfmdfivesum",convert,pdf_mdfive_sum_code);@/ +@!@:pdf_mdfive_sum_}{\.{\\pdfmdfivesum} primitive@> +primitive("pdffiledump",convert,pdf_file_dump_code);@/ +@!@:pdf_file_dump_}{\.{\\pdffiledump} primitive@> +primitive("pdfsavepos",extension,pdf_save_pos_node);@/ +@!@:pdf_save_pos_}{\.{\\pdfsavepos} primitive@> +primitive("pdfpagewidth",assign_dimen,dimen_base+pdf_page_width_code);@/ +@!@:pdf_page_width_}{\.{\\pdfpagewidth} primitive@> +primitive("pdfpageheight",assign_dimen,dimen_base+pdf_page_height_code);@/ +@!@:pdf_page_height_}{\.{\\pdfpageheight} primitive@> +primitive("pdflastxpos",last_item,pdf_last_x_pos_code);@/ +@!@:pdf_last_x_pos_}{\.{\\pdflastxpos} primitive@> +primitive("pdflastypos",last_item,pdf_last_y_pos_code);@/ +@!@:pdf_last_y_pos_}{\.{\\pdflastypos} primitive@> +primitive("pdfshellescape",last_item,pdf_shell_escape_code); +@!@:pdf_shell_escape_}{\.{\\pdfshellescape} primitive@> +primitive("ifpdfprimitive",if_test,if_pdfprimitive_code); +@!@:if_pdfprimitive_}{\.{\\ifpdfprimitive} primitive@> +primitive("pdfuniformdeviate",convert,uniform_deviate_code);@/ +@!@:uniform_deviate_}{\.{\\pdfuniformdeviate} primitive@> +primitive("pdfnormaldeviate",convert,normal_deviate_code);@/ +@!@:normal_deviate_}{\.{\\pdfnormaldeviate} primitive@> +primitive("pdfrandomseed",last_item,random_seed_code); +@!@:random_seed_}{\.{\\pdfrandomseed} primitive@> +primitive("pdfsetrandomseed",extension,set_random_seed_code);@/ +@!@:set_random_seed_code}{\.{\\pdfsetrandomseed} primitive@> +primitive("pdfelapsedtime",last_item,elapsed_time_code); +@!@:elapsed_time_}{\.{\\pdfelapsedtime} primitive@> +primitive("pdfresettimer",extension,reset_timer_code);@/ +@!@:reset_timer_}{\.{\\pdfresettimer} primitive@> +primitive("Uchar",convert,Uchar_convert_code);@/ +@!@:Uchar_}{\.{\\Uchar} primitive@> +primitive("Ucharcat",convert,Ucharcat_convert_code);@/ +@!@:Ucharcat_}{\.{\\Ucharcat} primitive@> +@z + +@x +eTeX_version_code: print_esc("eTeXversion"); +@y +eTeX_version_code: print_esc("eTeXversion"); +pdf_last_x_pos_code: print_esc("pdflastxpos"); +pdf_last_y_pos_code: print_esc("pdflastypos"); +elapsed_time_code: print_esc("pdfelapsedtime"); +pdf_shell_escape_code: print_esc("pdfshellescape"); +random_seed_code: print_esc("pdfrandomseed"); +@z + +@x +eTeX_version_code: cur_val:=eTeX_version; +@y +eTeX_version_code: cur_val:=eTeX_version; +pdf_last_x_pos_code: cur_val := pdf_last_x_pos; +pdf_last_y_pos_code: cur_val := pdf_last_y_pos; +pdf_shell_escape_code: + begin + if shellenabledp then begin + if restrictedshell then cur_val :=2 + else cur_val := 1; + end + else cur_val := 0; + end; +elapsed_time_code: cur_val := get_microinterval; +random_seed_code: cur_val := random_seed; +@z + +@x +primitive("iffontchar",if_test,if_font_char_code); +@!@:if_font_char_}{\.{\\iffontchar} primitive@> +@y +primitive("iffontchar",if_test,if_font_char_code); +@!@:if_font_char_}{\.{\\iffontchar} primitive@> +primitive("ifincsname",if_test,if_in_csname_code); +@!@:if_in_csname_}{\.{\\ifincsname} primitive@> +@z + +@x +if_font_char_code:print_esc("iffontchar"); +@y +if_font_char_code:print_esc("iffontchar"); +if_in_csname_code:print_esc("ifincsname"); +@z + +@x +if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters} + repeat get_x_token; +@y +if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters} + e := is_in_csname; is_in_csname := true; + repeat get_x_token; +@z + +@x + b:=(eq_type(cur_cs)<>undefined_cs); +@y + b:=(eq_type(cur_cs)<>undefined_cs); + is_in_csname := e; +@z + +@x +if_font_char_code:begin scan_font_ident; n:=cur_val; +@y +if_in_csname_code: b := is_in_csname; +if_font_char_code:begin scan_font_ident; n:=cur_val; +@z + +@x +procedure print_kanji(@!s:KANJI_code); {prints a single character} +begin +if s>@"FF then + begin print_char(@"100+Hi(s)); print_char(@"100+Lo(s)); + end else print_char(s); +end; +@y +procedure print_kanji(@!s:integer); {prints a single character} +begin +if s>@"FF then begin + if isprint_utf8 then begin + s:=UCStoUTF8(toUCS(s)); + if BYTE1(s)<>0 then print_char(@"100+BYTE1(s)); + if BYTE2(s)<>0 then print_char(@"100+BYTE2(s)); + if BYTE3(s)<>0 then print_char(@"100+BYTE3(s)); + print_char(@"100+BYTE4(s)); + end + else begin print_char(@"100+Hi(s)); print_char(@"100+Lo(s)); end; +end +else print_char(s); +end; + + +@z + +@x +@* \[54] System-dependent changes. +@y +@* \[54/pdf\TeX] System-dependent changes for {\tt\char"5Cpdfstrcmp}. +@d call_func(#) == begin if # <> 0 then do_nothing end +@d flushable(#) == (# = str_ptr - 1) + +@= +@!isprint_utf8: boolean; +@!epochseconds: integer; +@!microseconds: integer; + +@ +@d max_integer == @"7FFFFFFF {$2^{31}-1$} + +@= +procedure pdf_error(t, p: str_number); +begin + normalize_selector; + print_err("pdfTeX error"); + if t <> 0 then begin + print(" ("); + print(t); + print(")"); + end; + print(": "); print(p); + succumb; +end; + +function get_microinterval:integer; +var s,@!m:integer; {seconds and microseconds} +begin + seconds_and_micros(s,m); + if (s-epochseconds)>32767 then + get_microinterval := max_integer + else if (microseconds>m) then + get_microinterval := ((s-1-epochseconds)*65536)+ (((m+1000000-microseconds)/100)*65536)/10000 + else + get_microinterval := ((s-epochseconds)*65536) + (((m-microseconds)/100)*65536)/10000; +end; + +@ @= + +procedure compare_strings; {to implement \.{\\pdfstrcmp}} +label done; +var s1, s2: str_number; + i1, i2, j1, j2: pool_pointer; + c1, c2: integer; + save_cur_cs: pointer; +begin + save_cur_cs:=cur_cs; call_func(scan_toks(false, true)); + isprint_utf8:=true; s1 := tokens_to_string(def_ref); isprint_utf8:=false; + delete_token_ref(def_ref); + cur_cs:=save_cur_cs; call_func(scan_toks(false, true)); + isprint_utf8:=true; s2 := tokens_to_string(def_ref); isprint_utf8:=false; + delete_token_ref(def_ref); + i1 := str_start[s1]; + j1 := str_start[s1 + 1]; + i2 := str_start[s2]; + j2 := str_start[s2 + 1]; + while (i1 < j1) and (i2 < j2) do begin + if str_pool[i1]>=@"100 then c1:=str_pool[i1]-@"100 else c1:=str_pool[i1]; + if str_pool[i2]>=@"100 then c2:=str_pool[i2]-@"100 else c2:=str_pool[i2]; + if c1c2 then begin cur_val := 1; goto done; end; + incr(i1); + incr(i2); + end; + if (i1 = j1) and (i2 = j2) then + cur_val := 0 + else if i1 < j1 then + cur_val := 1 + else + cur_val := -1; +done: + flush_str(s2); + flush_str(s1); + cur_val_level := int_val; +end; + +@ Next, we implement \.{\\pdfsavepos} and related primitives. + +@= +@!cur_page_width: scaled; {"physical" width of page being shipped} +@!cur_page_height: scaled; {"physical" height of page being shipped} +@!pdf_last_x_pos: integer; +@!pdf_last_y_pos: integer; + +@ @= +begin + new_whatsit(pdf_save_pos_node, small_node_size); + inhibit_glue_flag:=false; +end + +@ @= +begin + case dvi_dir of + dir_yoko: begin pdf_last_x_pos := cur_h; pdf_last_y_pos := cur_v; end; + dir_tate: begin pdf_last_x_pos := -cur_v; pdf_last_y_pos := cur_h; end; + dir_dtou: begin pdf_last_x_pos := cur_v; pdf_last_y_pos := -cur_h; end; + endcases; + pdf_last_x_pos := pdf_last_x_pos + 4736286; + pdf_last_y_pos := cur_page_height - pdf_last_y_pos - 4736286; + {4736286 = 1in, the funny DVI origin offset} +end + +@ @= + if pdf_page_height <> 0 then + cur_page_height := pdf_page_height + else if (box_dir(p)=dir_tate)or(box_dir(p)=dir_dtou) then + cur_page_height := width(p) + 2*v_offset + 2*4736286 + else + cur_page_height := height(p) + depth(p) + 2*v_offset + 2*4736286; + {4736286 = 1in, the funny DVI origin offset} + if pdf_page_width <> 0 then + cur_page_width := pdf_page_width + else if (box_dir(p)=dir_tate)or(box_dir(p)=dir_dtou) then + cur_page_width := height(p) + depth(p) + 2*h_offset + 2*4736286 + else + cur_page_width := width(p) + 2*h_offset + 2*4736286 + {4736286 = 1in, the funny DVI origin offset} + + +@ Of course \epTeX\ can produce a \.{DVI} file only, not a PDF file. +A \.{DVI} file does not have the information of the page height, +which is needed to implement \.{\\pdflastypos} correctly. +To keep the information of the page height, I (H.~Kitagawa) +adopted \.{\\pdfpageheight} primitive from pdf\TeX. + +In \pTeX (and \hbox{\epTeX}), the papersize special +\.{\\special\{papersize=\,\\}} is commonly used +for specifying page width/height. +If \.{\\readpapersizespecial} is greater than~0, the papersize special also +changes the value of \.{\\pdfpagewidth} and \.{\\pdfpageheight}. +This process is done in the following routine. + +{\def\<#1>{\langle\hbox{#1\/}\rangle} +In present implementation, the papersize special $\$, +which can be interpreted by this routine, is defined as follows. +$$\eqalign{% + \ &\longrightarrow \.{papersize=}\\.{,}\\cr + \ &\longrightarrow \ + \\\cr + \ &\longrightarrow \.{.} \mid \\ \mid + \\\cr +}$$} +Note that any space, ``\.{,}'' as a decimal separator, minus~symbol +are neither permitted. + +@d ifps(#)==@+if k+(#)>pool_ptr then goto done @+ else @+ if +@d sop(#)==so(str_pool[#]) +@f ifps==if + +@= +begin k:=str_start[str_ptr];@/ +ifps(10) @, + (sop(k+0)<>'p')or(sop(k+1)<>'a')or(sop(k+2)<>'p')or + (sop(k+3)<>'e')@|or(sop(k+4)<>'r')or(sop(k+5)<>'s')or + (sop(k+6)<>'i')or(sop(k+7)<>'z')@|or(sop(k+8)<>'e')or + (sop(k+9)<>'=') then goto done; +k:=k+10; +@; +ifps(1) @, sop(k)=',' then begin + incr(k); cw:=s; + @; + if pool_ptr>k then goto done; + geq_word_define(dimen_base+pdf_page_width_code,cw); + geq_word_define(dimen_base+pdf_page_height_code,s);@| + cur_page_height := s; cur_page_width := cw; +end; +end; + +@ + +@d if_ps_unit(#)==if bl then @+ begin @+ ifps(2) sop(k)=(#) @, if_ps_unit_two +@d if_ps_unit_two(#)==and (sop(k+1)=(#)) then begin bl:=false; k:=k+2; if_ps_unit_end +@d if_ps_unit_end(#)==# @+ end @+ end; + +@d do_ps_conversion(#)==num:=#; do_ps_conversion_end +@d do_ps_conversion_end(#)== + s:=xn_over_d(s,num,#); s:=s*unity+((num*t+@'200000*remainder) div #) + +@= +s:=0; t:=0; bl:=true; +while (k='0')and (sop(k)<='9') then begin s:=10*s+sop(k)-'0'; incr(k); @+end + else bl:=false; +ifps(1) sop(k)='.' then + begin incr(k); bl:=true; i:=0; dig[0]:=0; + while (k='0')and (sop(k)<='9') then + begin if i<17 then begin dig[i]:=sop(k)-'0'; incr(i); @+end; + incr(k); end + else bl:=false; + end; + t:=round_decimals(i); + end; +if k+4>pool_ptr then + if (sop(k)='t')and(sop(k+1)='r')and(sop(k+2)='u')and(sop(k+3)='e') then + k:=k+4; +if mag<>1000 then + begin s:=xn_over_d(s,1000,mag); + t:=(1000*t+@'200000*remainder) div mag; + s:=s+(t div @'200000); t:=t mod @'200000; +end; +bl:=true;@/ +if_ps_unit('p')('t')(s:=s*unity+t)@/ +if_ps_unit('i')('n')(do_ps_conversion(7227)(100))@/ +if_ps_unit('p')('c')(do_ps_conversion(12)(1))@/ +if_ps_unit('c')('m')(do_ps_conversion(7227)(254))@/ +if_ps_unit('m')('m')(do_ps_conversion(7227)(2540))@/ +if_ps_unit('b')('p')(do_ps_conversion(7227)(7200))@/ +if_ps_unit('d')('d')(do_ps_conversion(1238)(1157))@/ +if_ps_unit('c')('c')(do_ps_conversion(14856)(1157))@/ +if_ps_unit('s')('p')(do_nothing) + +@ Finally, we declare some routine needed for \.{\\pdffilemoddate}. + +@= +@!isprint_utf8: boolean; +@!last_tokens_string: str_number; {the number of the most recently string +created by |tokens_to_string|} + +@ @= +procedure scan_pdf_ext_toks; +begin + call_func(scan_toks(false, true)); {like \.{\\special}} +end; + +@ @= +function tokens_to_string(p: pointer): str_number; {return a string from tokens +list} +begin + if selector = new_string then + pdf_error("tokens", "tokens_to_string() called while selector = new_string"); + old_setting:=selector; selector:=new_string; + show_token_list(link(p),null,pool_size-pool_ptr); + selector:=old_setting; + last_tokens_string := make_string; + tokens_to_string := last_tokens_string; +end; +procedure flush_str(s: str_number); {flush a string if possible} +begin + if flushable(s) then + flush_string; +end; + +@ @= + seconds_and_micros(epochseconds,microseconds); + init_start_time; + +@ Negative random seed values are silently converted to positive ones + +@= +begin + scan_int; + if cur_val<0 then negate(cur_val); + random_seed := cur_val; + init_randoms(random_seed); +end + +@ @= +begin + seconds_and_micros(epochseconds,microseconds); +end + +@* \[54] System-dependent changes. +@z diff --git a/Build/source/texk/web2c/euptexdir/suppresserrors.ch b/Build/source/texk/web2c/euptexdir/suppresserrors.ch new file mode 100644 index 00000000000..07049dd3533 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/suppresserrors.ch @@ -0,0 +1,138 @@ +%% suppresserrors.ch: support ``suppressing errors'' primitives in LuaTeX +%% +%% \suppresslongerror done +%% \suppressoutererror done +%% \suppressmathparerror done +%% The followings are not implemented to e-(u)pTeX: +%% % \suppressifcsnameerror +%% % \suppressfontnotfounderror -> we have an error from mktextfm etc. anyway +%% % \suppressprimitiveerror -> e-(u)pTeX does not produce errors in \pdfprimitive + +@x +@d eTeX_state_code=etex_int_base+10 {\eTeX\ state variables} +@y +@d suppress_long_error_code=etex_int_base+10 +@d suppress_outer_error_code=etex_int_base+11 +@d suppress_mathpar_error_code=etex_int_base+12 +@d eTeX_state_code=etex_int_base+13 {\eTeX\ state variables} +@z + +@x +@d read_papersize_special==int_par(read_papersize_special_code) +@y +@d read_papersize_special==int_par(read_papersize_special_code) +@d suppress_long_error==int_par(suppress_long_error_code) +@d suppress_outer_error==int_par(suppress_outer_error_code) +@d suppress_mathpar_error==int_par(suppress_mathpar_error_code) +@z + +@x {Perhaps this change hunk is not needed} +@p procedure check_outer_validity; +var p:pointer; {points to inserted token list} +@!q:pointer; {auxiliary pointer} +begin if scanner_status<>normal then +@y +@p procedure check_outer_validity; +var p:pointer; {points to inserted token list} +@!q:pointer; {auxiliary pointer} +begin if suppress_outer_error=0 then if scanner_status<>normal then +@z + +@x @ +if cur_cmd>=outer_call then check_outer_validity; +@y +if (suppress_outer_error=0)and(cur_cmd>=outer_call) then check_outer_validity; +@z + +@x @ +if cur_cmd>=outer_call then check_outer_validity; +@y +if (suppress_outer_error=0)and(cur_cmd>=outer_call) then check_outer_validity; +@z + +@x @ +if cur_cmd>=outer_call then check_outer_validity; +@y +if (suppress_outer_error=0)and(cur_cmd>=outer_call) then check_outer_validity; +@z + +@x @ + if cur_cmd=dont_expand then + @ + else check_outer_validity; +@y + if cur_cmd=dont_expand then + @ + else if suppress_outer_error=0 then check_outer_validity; +@z + +@x @ + end_file_reading; {resume previous level} + check_outer_validity; goto restart; +@y + end_file_reading; {resume previous level} + if suppress_outer_error=0 then check_outer_validity; goto restart; +@z + +@x +if cur_tok=par_token then if long_state<>long_call then + @; +@y +if cur_tok=par_token then if long_state<>long_call then + if suppress_long_error=0 then @; +@z + +@x + if cur_tok=par_token then if long_state<>long_call then + @; +@y + if cur_tok=par_token then if long_state<>long_call then + if suppress_long_error=0 then @; +@z + +@x +@: insert_dollar_sign; +@y +@: insert_dollar_sign; +mmode+par_end: if suppress_mathpar_error=0 then insert_dollar_sign; +@z + +@x +mmode+endv, mmode+par_end, mmode+stop, mmode+vskip, mmode+un_vbox, +mmode+valign, mmode+hrule +@y +mmode+endv, mmode+stop, mmode+vskip, mmode+un_vbox, +mmode+valign, mmode+hrule +@z + +@x after_math +@= +begin get_x_token; +@y +@= +begin repeat get_x_token; +until (suppress_mathpar_error=0)or(cur_cmd<>par_end); +@z + +@x +primitive("readpapersizespecial",assign_int,int_base+read_papersize_special_code);@/ +@!@:read_papersize_special_}{\.{\\readpapersizespecial} primitive@> +@y +primitive("readpapersizespecial",assign_int,int_base+read_papersize_special_code);@/ +@!@:read_papersize_special_}{\.{\\readpapersizespecial} primitive@> +primitive("suppresslongerror",assign_int,int_base+suppress_long_error_code);@/ +@!@:suppress_long_error_}{\.{\\suppresslongerror} primitive@> +primitive("suppressoutererror",assign_int,int_base+suppress_outer_error_code);@/ +@!@:suppress_outer_error_}{\.{\\suppressoutererror} primitive@> +primitive("suppressmathparerror",assign_int,int_base+suppress_mathpar_error_code);@/ +@!@:suppress_mathpar_error_}{\.{\\suppressmathparerror} primitive@> +@z + +@x +read_papersize_special_code:print_esc("readpapersizespecial"); +@y +read_papersize_special_code:print_esc("readpapersizespecial"); +suppress_long_error_code: print_esc("suppresslongerror"); +suppress_outer_error_code: print_esc("suppressoutererror"); +suppress_mathpar_error_code: print_esc("suppressmathparerror"); +@z diff --git a/Build/source/texk/web2c/euptexdir/tests/pdfprimitive-test.tex b/Build/source/texk/web2c/euptexdir/tests/pdfprimitive-test.tex new file mode 100644 index 00000000000..2f7211d26c7 --- /dev/null +++ b/Build/source/texk/web2c/euptexdir/tests/pdfprimitive-test.tex @@ -0,0 +1,47 @@ +%#!euptex pdfprimitive-test.tex +\catcode`\{=1\catcode`\}=2 +\scrollmode +\catcode`\Q=14 +\ifdefined\pdfprimitive\else\catcode`\Q=11 \fi + +Q\let\pdfprimitive\primitive\let\ifpdfprimitive\ifprimitive +\catcode`\Q=11 + +\def\relax{\message{RELAX}} +\def\fuga{\message{FUGA}} +\let\input=\halign + +\relax % ==> RELAX +\pdfprimitive\relax % ==> (no output) +\message{\meaning\relax} % ==> macro:->\message {RELAX} + +\fuga % ==> FUGA +\pdfprimitive\fuga % ==> ``! Missing primitive name.'' error + +\ifpdfprimitive\relax\message{T}\else\message{F}\fi % ==> F (macro) +\ifpdfprimitive\par\message{T}\else\message{F}\fi % ==> T +\ifpdfprimitive\input\message{T}\else\message{F}\fi % ==> F + % (This \input is not ``primitive \input''.) +\ifpdfprimitive\hoge\message{T}\else\message{F}\fi % ==> F (undefined) +\ifpdfprimitive\fuga\message{T}\else\message{F}\fi % ==> F (macro) + +\show\pdfstrcmp % ==> \pdfstrcmp + +% fix for overwriting entries (170924) +\ifpdfprimitive\ \message{T}\else\message{F}\fi % ==> T +\ifpdfprimitive\vrule\message{T}\else\message{F}\fi % ==> T + +% fix for back_input in vertical mode (170924) +\setbox0=\vbox{\pdfprimitive\ \undefined} +% ==> ``! Undefined control sequence.'' error +\setbox0=\vbox{\pdfprimitive\vrule\undefined} +% ==> ``! Undefined control sequence.'' error + +\setbox0=\hbox{% + \def\A{\message{<\the\count42>}\ignorespaces} + \count42=\pdfprimitive\X 1\A + \count42=\pdfprimitive\- 2\A + \count42=\pdfprimitive\vrule 3\A +} + +\end diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog index a4ade2e66df..65f76530d62 100644 --- a/Build/source/texk/web2c/uptexdir/ChangeLog +++ b/Build/source/texk/web2c/uptexdir/ChangeLog @@ -1,3 +1,10 @@ +2024-02-10 TANAKA Takuji + + * ptex_version.h, ptex-base.ch, zfmtcompress.test, + am/uptex.am: Copy ptex source files from ../ptexdir + to cleaning up building environment. + https://github.com/texjporg/tex-jp-build/issues/32 + 2023-12-24 TANAKA Takuji * wcfname{,0}.test: diff --git a/Build/source/texk/web2c/uptexdir/am/uptex.am b/Build/source/texk/web2c/uptexdir/am/uptex.am index 672f0677345..ddb486edd4b 100644 --- a/Build/source/texk/web2c/uptexdir/am/uptex.am +++ b/Build/source/texk/web2c/uptexdir/am/uptex.am @@ -40,7 +40,7 @@ nodist_uptex_SOURCES = $(uptex_c_h) uptex-pool.c dist_uptex_SOURCES = uptexdir/uptexextra.c uptexdir/uptexextra.h uptexdir/uptex_version.h # We must create uptexd.h and uptexdir/uptex_version.h before building the uptex_OBJECTS. -uptex_prereq = uptexd.h ptexdir/ptex_version.h uptexdir/uptex_version.h +uptex_prereq = uptexd.h uptexdir/ptex_version.h uptexdir/uptex_version.h $(uptex_OBJECTS): $(uptex_prereq) $(uptex_c_h): uptex-web2c @@ -76,7 +76,7 @@ uptex_web_srcs = \ uptex.ch: tie$(EXEEXT) uptex.web $(uptex_ch_srcs) $(tie_c) uptex.web $(uptex_ch_srcs) uptex_ch_srcs = \ - ptexdir/ptex-base.ch \ + uptexdir/ptex-base.ch \ uptexdir/uptex-m.ch \ $(uptex_ch_synctex) \ tex-binpool.ch @@ -236,7 +236,7 @@ DISTCLEANFILES += uptests/xstory.dvityp uptests/xpagenum.typ uptests/x*ptex[34]* DISTCLEANFILES += uptests/xcmr10.tfm ## uptexdir/uptftopl.test DISTCLEANFILES += uptests/xcmr10.pl -## ptexdir/sample.test +## uptexdir/sample.test DISTCLEANFILES += uptests/xsample*.typ ## uptexdir/yokotate.test EXTRA_DIST += uptexdir/tests/umin10.pl uptexdir/tests/umin10.tfm diff --git a/Build/source/texk/web2c/uptexdir/ptex-base.ch b/Build/source/texk/web2c/uptexdir/ptex-base.ch new file mode 100644 index 00000000000..3ed7b821e7b --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/ptex-base.ch @@ -0,0 +1,8175 @@ +% $Id$ +% This is a change file for pTeX +% By Sadayuki Tanaka and ASCII MEDIA WORKS. +% +% Thanks for : +% Ryoichi Kurasawa (us009185@interramp.com), +% Hisato Hamano, +% Hiroto Kagotani (kagotani@in.it.okayama-u.ac.jp), +% Takashi Kakiuchi (kakiuchi@sy6.isl.mei.co.jp), +% Yoichi Kawabata (kawabata@canon.co.jp), +% Makoto Kobayashi (makoto@lloem.fujidenki.co.jp), +% Yoshihiro Aoki (aoki@tokyo-shoseki-ptg.co.jp), +% Akira Kakuto (kakuto@fuk.kindai.ac.jp). +% Koich Inoue (inoue@ma.ns.musashi-tech.ac.jp). +% +% (??/??/87) RKS jTeX 2.9 -- j1.0 +% (??/??/89) RKS jTeX 2.93 -- j1.3 +% (12/ 9/89) H_2 pTeX 2.93 j1.3 p1.0.1 +% (12/??/89) RKS jTeX 2.95 -- j1.5 +% (12/??/89) RKS jTeX 2.99 -- j1.5 +% (02/02/90) RKS jTeX 2.99 -- j1.6 +% (04/16/90) H_2 pTeX 2.99 j1.6 p1.0.3 +% (09/14/90) H_2 pTeX 2.99 j1.6 p1.0.9 -- pre-release +% (10/29/90) H_2 Bug fix (p1.0.9a) +% (01/21/92) H_2 jTeX 2.99 - j1.7 +% (01/21/92) H_2 pTeX 2.99 j1.7 p1.0.9F +% (03/09/92) H_2 pTeX 2.99 j1.7 p1.0.9G jflag BUG +% (03/20/95) KN pTeX p2.0 (based on 3.1415) +% (09/08/95) KN pTeX p2.1 +% (09/20/95) KN pTeX p2.1.1 +% (11/21/95) KN pTeX p2.1.4 +% (08/27/97) KN pTeX p2.1.5 (based on 3.14159) +% (02/26/98) KN pTeX p2.1.6 +% (03/19/98) KN pTeX p2.1.7 +% (03/26/98) KN pTeX p2.1.8 (Web2c 7.2) +% (02/21/2000) KN pTeX p2.1.9 (Web2c 7.3.1) +% (11/13/2000) KN pTeX p2.1.10 +% (05/22/2001) KN pTeX p2.1.11 +% (03/10/2001) KN pTeX p3.0 (modified BSD licence) +% (09/02/2004) ST pTeX p3.1.4 +% (11/29/2004) KN pTeX p3.1.5 +% (12/13/2004) KN pTeX p3.1.8 +% (10/17/2005) ST pTeX p3.1.9 +% (07/18/2006) ST pTeX p3.1.10 +% (08/17/2009) ST pTeX p3.1.11 +% (05/23/2010) AK Bug fix by Hironori Kitagawa. +% (31/12/2010) AK Bug fix and accent Kanji by Hironori Kitagawa. +% (19/01/2011) PB Let \lastkern etc act through disp node. +% (15/04/2011) PB pTeX p3.2 Add \ifdbox and \ifddir +% (2011-08-18) PB Bug fix by Hironori Kitagawa. +% (2012-05-11) PB pTeX p3.3 +% (2013-04-09) PB pTeX p3.4 (TL 2013) +% (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. +% (2016-06-06) AK Hironori Kitagawa fixed a bug in check_box(box_p:pointer). +% pTeX p3.7.1. +% (2017-09-07) HK pTeX p3.7.2 More restrictions on direction change commands. +% (2018-01-21) HK Added \ptexversion primitive and co. pTeX p3.8. +% (2018-04-14) HK pTeX p3.8.1 Bug fix for discontinuous KINSOKU table. +% (2019-02-03) HK pTeX p3.8.2 Change \inhibitglue, add \disinhibitglue. +% (2019-10-14) HY pTeX p3.8.3 Allow getting \kansujichar. +% (2021-02-18) HK pTeX p3.9.0 Add \ifjfont and \iftfont (in 2020-02-06, by HY), +% Bug fix for getting \kansujichar (in 2020-02-09 = TL20), +% based on TeX 3.141592653 (for TL21). +% (2021-06-25) HY pTeX p3.9.1 Various fixes. +% (2021-06-20) HK pTeX p3.10.0 Add \ucs and \toucs. +% (2022-01-22) HK pTeX p4.0.0 Distinguish 8-bit characters and Japanese characters +% for better support of LaTeX3 (expl3). +% Requires ptexenc version 1.4.0. +% More details in TUGboat 41(2):329--334, 2020. +% (2022-10-24) HY pTeX p4.1.0 Add new syntax \font [in jis/ucs]. +% New primitives: \tojis, \ptextracingfonts and \ptexfontname. +% (2023-09-17) HY pTeX p4.1.1 Support more than 256 different glue/kern. + +@x +% Here is TeX material that gets inserted after \input webmac +@y +% Here is TeX material that gets inserted after \input webmac +\def\pTeX{p\kern-.15em\TeX} +@z + +@x [1.2] l.200 - pTeX: +@d banner==TeX_banner +@d banner_k==TeX_banner_k +@y +@d pTeX_version=4 +@d pTeX_minor_version=1 +@d pTeX_revision==".1" +@d pTeX_version_string=='-p4.1.1' {current \pTeX\ version} +@# +@d pTeX_banner=='This is pTeX, Version 3.141592653',pTeX_version_string +@d pTeX_banner_k==pTeX_banner + {printed when \pTeX\ starts} +@# +@d banner==pTeX_banner +@d banner_k==pTeX_banner_k +@z + +@x [2.??] l.586 - pTeX: +@!ASCII_code=0..255; {eight-bit numbers} +@y +@!ASCII_code=0..255; {eight-bit numbers} +@!KANJI_code=0..65535; {sixteen-bit numbers} +@!ext_ASCII_code=0..32768; { only use 0--511 } +@z + +@x pTeX: xchr +xchr: array [ASCII_code] of text_char; + { specifies conversion of output characters } +@y +xchr: array [ext_ASCII_code] of ext_ASCII_code; + { specifies conversion of output characters } +@z + +@x pTeX: xchr +for i:=@'177 to @'377 do xchr[i]:=i; +@y +for i:=@'177 to @'777 do xchr[i]:=i; +@z + +@x [3.??] l.870 - pTeX: +@!eight_bits=0..255; {unsigned one-byte quantity} +@y +@!eight_bits=0..255; {unsigned one-byte quantity} +@!sixteen_bits=0..65535; {unsigned two-bytes quantity} +@z + +@x [3.??] l.891 - pTeX: +@ All of the file opening functions are defined in C. +@y +@ All of the file opening functions are defined in C. + +@ Kanji code handling. +@z + +@x [3.??] pTeX +@= +@!buffer:^ASCII_code; {lines of characters being read} +@y +In \pTeX, we use another array |buffer2[]| to indicate which byte +is a part of a Japanese character. +|buffer2[]| is initialized to zero in reading one line from a file +(|input_ln|). |buffer2[i]| is set to one when |buffer[i]| is known +to be a part of a Japanese character, in |get_next| routine. + +@= +@!buffer:^ASCII_code; {lines of characters being read} +@!buffer2:^ASCII_code; +@z + +@x [4] +@!packed_ASCII_code = 0..255; {elements of |str_pool| array} +@y +@!packed_ASCII_code = 0..32768; {elements of |str_pool| array} + { 256..511 are used by Japanese characters } +@z + +@x [4] pTeX: str_eq_buf +while jbuffer[k] then +@y +while jbuffer2[k]*@"100+buffer[k] then +@z + +@x [4.47] l.1325 - pTeX: +@!init function get_strings_started:boolean; {initializes the string pool, + but returns |false| if something goes wrong} +label done,exit; +var k,@!l:0..255; {small indices or counters} +@y +@!init function get_strings_started:boolean; {initializes the string pool, + but returns |false| if something goes wrong} +label done,exit; +var k,@!l:KANJI_code; {small indices or counters} +@z + +@x [5.54] l.1514 - pTeX: Global variables +@!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for + pseudoprinting} +@y +@!trick_buf:array[0..ssup_error_line] of ext_ASCII_code; {circular buffer for + pseudoprinting} +@!trick_buf2:array[0..ssup_error_line] of 0..2; {pTeX: buffer for KANJI} +@!kcode_pos: 0..2; {pTeX: denotes whether first byte or second byte of KANJI} +@!prev_char: ASCII_code; +@z + +@x [5.55] l.1519 - pTeX: Initialize the kcode_pos +@ @= +selector:=term_only; tally:=0; term_offset:=0; file_offset:=0; +@y +@ @= +selector:=term_only; tally:=0; term_offset:=0; file_offset:=0; +kcode_pos:=0; +@z + +@x [5.57] l.1538 - pTeX: kcode_pos +procedure print_ln; {prints an end-of-line} +begin case selector of +term_and_log: begin wterm_cr; wlog_cr; + term_offset:=0; file_offset:=0; + end; +log_only: begin wlog_cr; file_offset:=0; + end; +term_only: begin wterm_cr; term_offset:=0; + end; +no_print,pseudo,new_string: do_nothing; +othercases write_ln(write_file[selector]) +endcases;@/ +@y +procedure print_ln; {prints an end-of-line} +begin case selector of +term_and_log: begin + if kcode_pos=1 then begin wterm(' '); wlog(' '); end; + wterm_cr; wlog_cr; term_offset:=0; file_offset:=0; + end; +log_only: begin if kcode_pos=1 then wlog(' '); + wlog_cr; file_offset:=0; + end; +term_only: begin if kcode_pos=1 then wterm(' '); + wterm_cr; term_offset:=0; + end; +no_print,pseudo,new_string: do_nothing; +othercases write_ln(write_file[selector]) +endcases;@/ +kcode_pos:=0; +@z + +@x [5.58] l.1557 - pTeX: kcode_pos, trick_buf2 +procedure print_char(@!s:ASCII_code); {prints a single character} +label exit; +begin if @ then + if selector then + if selector@"1FF then s:=s mod 256; +if s<256 then kcode_pos:=0 +else if kcode_pos=1 then kcode_pos:=2 +else if iskanji1(xchr[s-256]) then + begin kcode_pos:=1; + if (selector=term_and_log)or(selector=log_only) then + if file_offset>=max_print_line-1 then + begin wlog_cr; file_offset:=0; + end; + if (selector=term_and_log)or(selector=term_only) then + if term_offset>=max_print_line-1 then + begin wterm_cr; term_offset:=0; + end; + end +else kcode_pos:=0; +case selector of +term_and_log: begin wterm(xchr[s]); incr(term_offset); + if term_offset=max_print_line then + begin wterm_cr; term_offset:=0; + end; + wlog(xchr[s]); incr(file_offset); + if file_offset=max_print_line then + begin wlog_cr; file_offset:=0; + end; + end; +log_only: begin wlog(xchr[s]); incr(file_offset); + if file_offset=max_print_line then print_ln; + end; +term_only: begin wterm(xchr[s]); incr(term_offset); + if term_offset=max_print_line then print_ln; + end; +no_print: do_nothing; +pseudo: if tally=str_ptr then s:="???" {this can't happen} +@.???@> +else if s<256 then + if s<0 then s:="???" {can't happen} + else begin if selector>pseudo then + begin print_char(s); return; {internal strings are not expanded} + end; + if (@) then + if selector=str_ptr then s:="???" {this can't happen} +@.???@> +else if s<256 then + if s<0 then s:="???" {can't happen} + else begin if selector>pseudo then + begin print_char(s); return; {internal strings are not expanded} + end; + if (@) then + if selector=str_ptr) or (s<256) then print(s) +else begin j:=str_start[s]; + while j=str_ptr) or (s<256) then print(s) +else begin j:=str_start[s]; + while j=@"100 then print_char(c) else print(c); incr(j); + end; + end; +end; + +procedure slow_print_filename(@!s:integer); + {prints string |s| which represents filename, without code conversion} +var i,j,l:pool_pointer; p:integer; +begin if (s>=str_ptr) or (s<256) then print(s) +else begin i:=str_start[s]; l:=str_start[s+1]; + while i1 then + begin for j:=i to i+p-1 do print_char(@"100+(so(str_pool[j]) mod @"100)); + i:=i+p; end + else begin print(so(str_pool[i]) mod @"100); incr(i); end; + end; + end; +end; + +procedure print_quoted(@!s:integer); + {prints string |s| which represents filename, + omitting quotes and with code conversion} +var i,l:pool_pointer; j,p:integer; +begin if s<>0 then begin + i:=str_start[s]; l:=str_start[s+1]; + while i1 then begin + for j:=i to i+p-1 do print_char(@"100+(so(str_pool[j]) mod @"100)); + i:=i+p; end + else begin + if so(str_pool[i])<>"""" then print(so(str_pool[i]) mod @"100); + incr(i); end; + end; + end; +end; + +@z + +@x [5.61] l.1656 - pTeX: +@= +if src_specials_p or file_line_error_style_p or parse_first_line_p then + wterm(banner_k) +else + wterm(banner); +@y +@= +if src_specials_p or file_line_error_style_p or parse_first_line_p then + wterm(banner_k) +else + wterm(banner); + wterm(' ('); + wterm(conststringcast(get_enc_string)); + wterm(')'); +@z + +@x pTeX: print_hex for "Invalid KANJI code" or "Invalid KANSUJI char" errors +@ Old versions of \TeX\ needed a procedure called |print_ASCII| whose function +@y +@ Hexadecimal printing. + +@d print_hex_safe(#)==if #<0 then print_int(#) else print_hex(#) + +@ Old versions of \TeX\ needed a procedure called |print_ASCII| whose function +@z + +@x [5.??] - pTeX: term_input +@p procedure term_input; {gets a line from the terminal} +@y +@p procedure@?print_unread_buffer_with_ptenc; forward;@t\2@>@/ +procedure term_input; {gets a line from the terminal} +@z +@x [5.??] - pTeX: term_input +if last<>first then for k:=first to last-1 do print(buffer[k]); +@y +if last<>first then print_unread_buffer_with_ptenc(first,last); +@z + +@x +@d max_quarterword=255 {largest allowable value in a |quarterword|} +@y +@d max_quarterword=@"FFFF {largest allowable value in a |quarterword|} +@z + +@x +@d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|} +@y +@d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|} +@d max_cjk_val=@"10000 +@z + +@x [8.111] l.2436 - pTeX: check hi/ho + (mem_top+sup_main_memory>=max_halfword) then bad:=14; +@y + (mem_top+sup_main_memory>=max_halfword)or@| + (hi(0)<>0) then bad:=14; +@z + +@x [8.112] l.2450 - pTeX: hi/ho +sufficiently large. +@y +sufficiently large and this is required for \pTeX. +@z + +@x [8.112] l.2588 - pTeX: +@d ho(#)==# {to take a sixteen-bit item from a halfword} +@y +@d ho(#)==# {to take a sixteen-bit item from a halfword} +@d KANJI(#)==# {pTeX: to output a KANJI code} +@d tokanji(#)==# {pTeX: to take a KANJI code from a halfword} +@d tonum(#)==# {pTeX: to put a KANJI code into a halfword} +@z + +@x [10.135] l.2895 - pTeX: box_dir +|fil|, |fill|, or |filll|). The |subtype| field is not used. +@y +|fil|, |fill|, or |filll|). The |subtype| field is not used in \TeX. +In \pTeX\ the |subtype| field records the box direction |box_dir|. +@z + +@x [10.135] l.2897 - pTeX: box_dir +@d hlist_node=0 {|type| of hlist nodes} +@d box_node_size=7 {number of words to allocate for a box node} +@y +@d hlist_node=0 {|type| of hlist nodes} +@d box_node_size=8 {number of words to allocate for a box node} +@# +@d dir_max = 5 {the maximal absolute value of direction} +@d box_dir(#) == (qo(subtype(#))-dir_max) {direction of a box} +@d set_box_dir(#) == subtype(#):=set_box_dir_end +@d set_box_dir_end(#) == qi(#)+dir_max +@# +@d dir_default = 0 {direction of the box, default Left to Right} +@d dir_dtou = 1 {direction of the box, Bottom to Top} +@d dir_tate = 3 {direction of the box, Top to Bottom} +@d dir_yoko = 4 {direction of the box, equal default} +@d any_dir == dir_yoko,dir_tate,dir_dtou +@# +@z + +@x [10.135] l.2897 - pTeX: space_ptr, xspace_ptr +@d glue_offset = 6 {position of |glue_set| in a box node} +@d glue_set(#) == mem[#+glue_offset].gr + {a word of type |glue_ratio| for glue setting} +@y +@d glue_offset = 6 {position of |glue_set| in a box node} +@d glue_set(#) == mem[#+glue_offset].gr + {a word of type |glue_ratio| for glue setting} +@d space_offset = 7 {position of |glue_set| in a box node} +@d space_ptr(#) == link(#+space_offset) +@d xspace_ptr(#) == info(#+space_offset) +@z + +@x [10.136] l.3037 - pTeX: space_ptr, xspace_ptr +width(p):=0; depth(p):=0; height(p):=0; shift_amount(p):=0; list_ptr(p):=null; +glue_sign(p):=normal; glue_order(p):=normal; set_glue_ratio_zero(glue_set(p)); +@y +width(p):=0; depth(p):=0; height(p):=0; shift_amount(p):=0; list_ptr(p):=null; +glue_sign(p):=normal; glue_order(p):=normal; set_glue_ratio_zero(glue_set(p)); +space_ptr(p):=zero_glue; xspace_ptr(p):=zero_glue; set_box_dir(p)(dir_default); +add_glue_ref(zero_glue); add_glue_ref(zero_glue); +@z + +@x [10.137] l.3045 - pTeX: direction change node +@d vlist_node=1 {|type| of vlist nodes} +@y +@d vlist_node=1 {|type| of vlist nodes} + +@ A |dir_node| stands for direction change. + +@d dir_node=2 {|type| of dir nodes} + +@p function new_dir_node(b:pointer; dir:eight_bits):pointer; +var p:pointer; {the new node} +begin if type(b)>vlist_node then confusion("new_dir_node:not box"); +p:=new_null_box; type(p):=dir_node; set_box_dir(p)(dir); +case abs(box_dir(b)) of + dir_yoko: @; + dir_tate: @; + dir_dtou: @; + othercases confusion("new_dir_node:illegal dir"); +endcases; +link(b):=null; list_ptr(p):=b; +new_dir_node:=p; +end; + +@ @= + case dir of + dir_tate: begin width(p):=height(b)+depth(b); + depth(p):=width(b)/2; height(p):=width(b)-depth(p); + end; + dir_dtou: begin width(p):=height(b)+depth(b); + depth(p):=0; height(p):=width(b); + end; + othercases confusion("new_dir_node:y->?"); + endcases + +@ @= + case dir of + dir_yoko: begin width(p):=height(b)+depth(b); + depth(p):=0; height(p):=width(b); + end; + dir_dtou: begin width(p):=width(b); + depth(p):=height(b); height(p):=depth(b); + end; + othercases confusion("new_dir_node:t->?"); + endcases + +@ @= + case dir of + dir_yoko: begin width(p):=height(b)+depth(b); + depth(p):=0; height(p):=width(b); + end; + dir_tate: begin width(p):=width(b); + depth(p):=height(b); height(p):=depth(b); + end; + othercases confusion("new_dir_node:d->?"); + endcases +@z + +@x [10.138] l.3054 - pTeX: renumber rule_node +@d rule_node=2 {|type| of rule nodes} +@y +@d rule_node=3 {|type| of rule nodes} +@z + +@x [10.140] l.3083 - pTeX: renumber ins_node, add ins_dir field +@d ins_node=3 {|type| of insertion nodes} +@d ins_node_size=5 {number of words to allocate for an insertion} +@d float_cost(#)==mem[#+1].int {the |floating_penalty| to be used} +@d ins_ptr(#)==info(#+4) {the vertical list to be inserted} +@d split_top_ptr(#)==link(#+4) {the |split_top_skip| to be used} +@y +@d ins_node=4 {|type| of insertion nodes} +@d ins_node_size=6 {number of words to allocate for an insertion} +@d float_cost(#)==mem[#+1].int {the |floating_penalty| to be used} +@d ins_ptr(#)==info(#+4) {the vertical list to be inserted} +@d split_top_ptr(#)==link(#+4) {the |split_top_skip| to be used} +@d ins_dir(#)==(subtype(#+5)-dir_max) {direction of |ins_node|} +@d set_ins_dir(#) == subtype(#+5):=set_box_dir_end +@z + +@x [10.141] l.3089 - pTeX: disp_node +@ A |mark_node| has a |mark_ptr| field that points to the reference count +@y +@ A |disp_node| has a |disp_dimen| field that points to the displacement +distance of the baselineshift between Latin characters and Kanji chatacters. + +@d disp_node=5 {|type| of a displace node} +@d disp_dimen(#)==mem[#+1].sc + +@ A |mark_node| has a |mark_ptr| field that points to the reference count +@z + +@x [10.140] l.3095 - pTeX: renumber nodes +@d mark_node=4 {|type| of a mark node} +@y +@d mark_node=6 {|type| of a mark node} +@z + +@x [10.141] l.3105 - pTeX: renumber nodes +@d adjust_node=5 {|type| of an adjust node} +@y +@d adjust_node=7 {|type| of an adjust node} +@z + +@x [10.142] l.3122 - pTeX: renumber nodes +@d ligature_node=6 {|type| of a ligature node} +@y +@d ligature_node=8 {|type| of a ligature node} +@z + +@x [10.145] l.3163 - pTeX: renumber nodes +@d disc_node=7 {|type| of a discretionary node} +@y +@d disc_node=9 {|type| of a discretionary node} +@z + +@x [10.146] l.3191 - pTeX: renumber nodes +@d whatsit_node=8 {|type| of special extension nodes} +@y +@d whatsit_node=10 {|type| of special extension nodes} +@z + +@x [10.147] l.3198 - pTeX: renumber nodes +@d math_node=9 {|type| of a math node} +@y +@d math_node=11 {|type| of a math node} +@z + +@x [10.150] l.3244 - pTeX: renumber nodes +@d glue_node=10 {|type| of node that points to a glue specification} +@y +@d glue_node=12 {|type| of node that points to a glue specification} +@z + +@x [10.155] l.3342 - pTeX: renumber nodes +@d kern_node=11 {|type| of a kern node} +@d explicit=1 {|subtype| of kern nodes from \.{\\kern} and \.{\\/}} +@d acc_kern=2 {|subtype| of kern nodes from accents} +@y +@d kern_node=13 {|type| of a kern node} +@d explicit=1 {|subtype| of kern nodes from \.{\\kern}} +@d acc_kern=2 {|subtype| of kern nodes from accents} +@d ita_kern=3 {|subtype| of kern nodes from \.{\\/}} +@z + +@x [10.157] l.3363 - pTeX: renumber nodes +@d penalty_node=12 {|type| of a penalty node} +@y +@d penalty_node=14 {|type| of a penalty node} +@d widow_pena=1 {|subtype| of penalty nodes from \.{\\jcharwidowpenalty}} +@d kinsoku_pena=2 {|subtype| of penalty nodes from kinsoku} +@z + +@x [10.159] l.3392 - pTeX: renumber nodes +@d unset_node=13 {|type| for an unset node} +@y +@d unset_node=15 {|type| for an unset node} +@z + +@x [10.160] l.3397 - pTeX: renumber nodes +@ In fact, there are still more types coming. When we get to math formula +processing we will see that a |style_node| has |type=14|; and a number +of larger type codes will also be defined, for use in math mode only. +@y +@ In fact, there are still more types coming. When we get to math formula +processing we will see that a |style_node| has |type=16|; and a number +of larger type codes will also be defined, for use in math mode only. +@z + +@x [12.???] pTeX: \ptexfontname, \ptextracingfonts +@p procedure short_display(@!p:integer); {prints highlights of list |p|} +@y +@p@t\4@>@@;@/ +procedure short_display(@!p:integer); {prints highlights of list |p|} +@z + +@x [12.174] l.3662 - pTeX: print KANJI + print_ASCII(qo(character(p))); +@y + if font_dir[font(p)]<>dir_default then + begin p:=link(p); print_kanji(info(p)); + end + else print_ASCII(qo(character(p))); +@z + +@x [12.175] l.3672 - pTeX: Print a short indication of dir_nodes. +hlist_node,vlist_node,ins_node,whatsit_node,mark_node,adjust_node, + unset_node: print("[]"); +@y +hlist_node,vlist_node,dir_node,ins_node,whatsit_node,mark_node,adjust_node, + unset_node: print("[]"); +@z + +@x [12.176] l.3698 - pTeX: print KANJI. + print_char(" "); print_ASCII(qo(character(p))); +@y + print_char(" "); + if font_dir[font(p)]<>dir_default then + begin p:=link(p); print_kanji(info(p)); + end + else print_ASCII(qo(character(p))); +@z + +@x [12.183] l.3815 - pTeX: display char_node and disp_node. +if is_char_node(p) then print_font_and_char(p) +else case type(p) of + hlist_node,vlist_node,unset_node: @; + rule_node: @; + ins_node: @; + whatsit_node: @; +@y +if is_char_node(p) then + begin print_font_and_char(p); + if font_dir[font(p)]<>dir_default then p:=link(p) + end +else case type(p) of + hlist_node,vlist_node,dir_node,unset_node: @; + rule_node: @; + ins_node: @; + whatsit_node: @; + disp_node: begin print_esc("displace "); print_scaled(disp_dimen(p)); + end; +@z + +@x [12.184] l.3833 - pTeX: display dir_node. +@ @= +begin if type(p)=hlist_node then print_esc("h") +else if type(p)=vlist_node then print_esc("v") +else print_esc("unset"); +@y +@ @= +begin case type(p) of + hlist_node: print_esc("h"); + vlist_node: print_esc("v"); + dir_node: print_esc("dir"); + othercases print_esc("unset") + endcases@/; +@z +@x [12.184] l.3842 - pTeX: display dir_node. + if shift_amount(p)<>0 then + begin print(", shifted "); print_scaled(shift_amount(p)); + end; +@y + if shift_amount(p)<>0 then + begin print(", shifted "); print_scaled(shift_amount(p)); + end; +@z +@x [12.184] l.3845 - pTeX: display dir_node. + end; +@y + if box_dir(p)<>dir_default then + begin print(", "); print_direction(box_dir(p)); + end; + end; +@z + +@x [12.188] l.3896 - pTeX: Display insertion and ins_dir. +@ @= +begin print_esc("insert"); print_int(qo(subtype(p))); +print(", natural size "); print_scaled(height(p)); +@y +@ @= +begin print_esc("insert"); print_int(qo(subtype(p))); +print_dir(abs(ins_dir(p))); +print(", natural size "); print_scaled(height(p)); +@z + +@x [12.194] l.3961 - pTeX: Display penalty usage +@ @= +begin print_esc("penalty "); print_int(penalty(p)); +end +@y +@ @= +begin print_esc("penalty "); print_int(penalty(p)); +if subtype(p)=widow_pena then print("(for \jcharwidowpenalty)") +else if subtype(p)=kinsoku_pena then print("(for kinsoku)"); +end +@z + +@x [13.202] l.4043 - pTeX: dir_node, disp_node + hlist_node,vlist_node,unset_node: begin flush_node_list(list_ptr(p)); + free_node(p,box_node_size); goto done; + end; +@y + hlist_node,vlist_node,dir_node,unset_node: + begin flush_node_list(list_ptr(p)); + fast_delete_glue_ref(space_ptr(p)); + fast_delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); goto done; + end; +@z + +@x [13.202] l.4056 - pTeX: + kern_node,math_node,penalty_node: do_nothing; +@y + disp_node, + kern_node,math_node,penalty_node: do_nothing; +@z + +@x [14.206] l.4121 - pTeX: space_ptr, xspace_ptr, dir_node, disp_node +@ @= +@y +@ @= +@z +@x [14.206] l.4123 +hlist_node,vlist_node,unset_node: begin r:=get_node(box_node_size); + mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last two words} +@y +dir_node, +hlist_node,vlist_node,unset_node: begin r:=get_node(box_node_size); + mem[r+7]:=mem[p+7]; + mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last three words} + add_glue_ref(space_ptr(r)); add_glue_ref(xspace_ptr(r)); +@z +@x [14.206] l.4130 +ins_node: begin r:=get_node(ins_node_size); mem[r+4]:=mem[p+4]; + add_glue_ref(split_top_ptr(p)); + ins_ptr(r):=copy_node_list(ins_ptr(p)); {this affects |mem[r+4]|} + words:=ins_node_size-1; + end; +@y +ins_node: begin r:=get_node(ins_node_size); + mem[r+5]:=mem[p+5]; mem[r+4]:=mem[p+4]; + add_glue_ref(split_top_ptr(p)); + ins_ptr(r):=copy_node_list(ins_ptr(p)); {this affects |mem[r+4]|} + words:=ins_node_size-2; + end; +@z + +@x [14.206] l.4140 - pTeX: disp_node +kern_node,math_node,penalty_node: begin r:=get_node(small_node_size); +@y +disp_node, +kern_node,math_node,penalty_node: begin r:=get_node(small_node_size); +@z + +@x [15.207] l.4201 - pTeX: Add kanji, kana, other_kchar category codes. +@d max_char_code=15 {largest catcode for individual characters} +@y +@d kanji=16 {kanji} +@d kana=17 {hiragana, katakana, alphabet} +@d other_kchar=18 {kanji codes} +@d max_char_code=18 {largest catcode for individual characters} +@z + +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d char_num=16 {character specified numerically ( \.{\\char} )} +@d math_char_num=17 {explicit math code ( \.{\\mathchar} )} +@d mark=18 {mark definition ( \.{\\mark} )} +@d xray=19 {peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~)} +@d make_box=20 {make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~)} +@d hmove=21 {horizontal motion ( \.{\\moveleft}, \.{\\moveright} )} +@d vmove=22 {vertical motion ( \.{\\raise}, \.{\\lower} )} +@d un_hbox=23 {unglue a box ( \.{\\unhbox}, \.{\\unhcopy} )} +@d un_vbox=24 {unglue a box ( \.{\\unvbox}, \.{\\unvcopy} )} +@y +@d char_num=max_char_code+1 {character specified numerically ( \.{\\char} )} +@d math_char_num=char_num+1 {explicit math code ( \.{\\mathchar} )} +@d mark=math_char_num+1 {mark definition ( \.{\\mark} )} +@d xray=mark+1 {peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~)} +@d make_box=xray+1 {make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~)} +@d hmove=make_box+1 {horizontal motion ( \.{\\moveleft}, \.{\\moveright} )} +@d vmove=hmove+1 {vertical motion ( \.{\\raise}, \.{\\lower} )} +@d un_hbox=vmove+1 {unglue a box ( \.{\\unhbox}, \.{\\unhcopy} )} +@d un_vbox=un_hbox+1 {unglue a box ( \.{\\unvbox}, \.{\\unvcopy} )} +@z +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d remove_item=25 {nullify last item ( \.{\\unpenalty}, + \.{\\unkern}, \.{\\unskip} )} +@d hskip=26 {horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~)} +@d vskip=27 {vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~)} +@d mskip=28 {math glue ( \.{\\mskip} )} +@d kern=29 {fixed space ( \.{\\kern} )} +@d mkern=30 {math kern ( \.{\\mkern} )} +@d leader_ship=31 {use a box ( \.{\\shipout}, \.{\\leaders}, etc.~)} +@d halign=32 {horizontal table alignment ( \.{\\halign} )} +@d valign=33 {vertical table alignment ( \.{\\valign} )} +@y +@d remove_item=un_vbox+1 {nullify last item ( \.{\\unpenalty}, + \.{\\unkern}, \.{\\unskip} )} +@d hskip=remove_item+1 {horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~)} +@d vskip=hskip+1 {vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~)} +@d mskip=vskip+1 {math glue ( \.{\\mskip} )} +@d kern=mskip+1 {fixed space ( \.{\\kern} )} +@d mkern=kern+1 {math kern ( \.{\\mkern} )} +@d leader_ship=mkern+1 {use a box ( \.{\\shipout}, \.{\\leaders}, etc.~)} +@d halign=leader_ship+1 {horizontal table alignment ( \.{\\halign} )} +@d valign=halign+1 {vertical table alignment ( \.{\\valign} )} +@z +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d no_align=34 {temporary escape from alignment ( \.{\\noalign} )} +@d vrule=35 {vertical rule ( \.{\\vrule} )} +@d hrule=36 {horizontal rule ( \.{\\hrule} )} +@d insert=37 {vlist inserted in box ( \.{\\insert} )} +@d vadjust=38 {vlist inserted in enclosing paragraph ( \.{\\vadjust} )} +@d ignore_spaces=39 {gobble |spacer| tokens ( \.{\\ignorespaces} )} +@d after_assignment=40 {save till assignment is done ( \.{\\afterassignment} )} +@d after_group=41 {save till group is done ( \.{\\aftergroup} )} +@d break_penalty=42 {additional badness ( \.{\\penalty} )} +@d start_par=43 {begin paragraph ( \.{\\indent}, \.{\\noindent} )} +@d ital_corr=44 {italic correction ( \.{\\/} )} +@d accent=45 {attach accent in text ( \.{\\accent} )} +@d math_accent=46 {attach accent in math ( \.{\\mathaccent} )} +@d discretionary=47 {discretionary texts ( \.{\\-}, \.{\\discretionary} )} +@d eq_no=48 {equation number ( \.{\\eqno}, \.{\\leqno} )} +@d left_right=49 {variable delimiter ( \.{\\left}, \.{\\right} )} +@y +@d no_align=valign+1 {temporary escape from alignment ( \.{\\noalign} )} +@d vrule=no_align+1 {vertical rule ( \.{\\vrule} )} +@d hrule=vrule+1 {horizontal rule ( \.{\\hrule} )} +@d insert=hrule+1 {vlist inserted in box ( \.{\\insert} )} +@d vadjust=insert+1 {vlist inserted in enclosing paragraph ( \.{\\vadjust} )} +@d ignore_spaces=vadjust+1 {gobble |spacer| tokens ( \.{\\ignorespaces} )} +@d after_assignment=ignore_spaces+1 {save till assignment is done ( \.{\\afterassignment} )} +@d after_group=after_assignment+1 {save till group is done ( \.{\\aftergroup} )} +@d break_penalty=after_group+1 {additional badness ( \.{\\penalty} )} +@d start_par=break_penalty+1 {begin paragraph ( \.{\\indent}, \.{\\noindent} )} +@d ital_corr=start_par+1 {italic correction ( \.{\\/} )} +@d accent=ital_corr+1 {attach accent in text ( \.{\\accent} )} +@d math_accent=accent+1 {attach accent in math ( \.{\\mathaccent} )} +@d discretionary=math_accent+1 {discretionary texts ( \.{\\-}, \.{\\discretionary} )} +@d eq_no=discretionary+1 {equation number ( \.{\\eqno}, \.{\\leqno} )} +@d left_right=eq_no+1 {variable delimiter ( \.{\\left}, \.{\\right} )} +@z +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d math_comp=50 {component of formula ( \.{\\mathbin}, etc.~)} +@d limit_switch=51 {diddle limit conventions ( \.{\\displaylimits}, etc.~)} +@d above=52 {generalized fraction ( \.{\\above}, \.{\\atop}, etc.~)} +@d math_style=53 {style specification ( \.{\\displaystyle}, etc.~)} +@d math_choice=54 {choice specification ( \.{\\mathchoice} )} +@d non_script=55 {conditional math glue ( \.{\\nonscript} )} +@d vcenter=56 {vertically center a vbox ( \.{\\vcenter} )} +@d case_shift=57 {force specific case ( \.{\\lowercase}, \.{\\uppercase}~)} +@d message=58 {send to user ( \.{\\message}, \.{\\errmessage} )} +@d extension=59 {extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~)} +@d in_stream=60 {files for reading ( \.{\\openin}, \.{\\closein} )} +@d begin_group=61 {begin local grouping ( \.{\\begingroup} )} +@d end_group=62 {end local grouping ( \.{\\endgroup} )} +@d omit=63 {omit alignment template ( \.{\\omit} )} +@d ex_space=64 {explicit space ( \.{\\\ } )} +@d no_boundary=65 {suppress boundary ligatures ( \.{\\noboundary} )} +@d radical=66 {square root and similar signs ( \.{\\radical} )} +@d end_cs_name=67 {end control sequence ( \.{\\endcsname} )} +@d min_internal=68 {the smallest code that can follow \.{\\the}} +@d char_given=68 {character code defined by \.{\\chardef}} +@d math_given=69 {math code defined by \.{\\mathchardef}} +@d last_item=70 {most recent item ( \.{\\lastpenalty}, + \.{\\lastkern}, \.{\\lastskip} )} +@d max_non_prefixed_command=70 {largest command code that can't be \.{\\global}} +@y +@d math_comp=left_right+1 {component of formula ( \.{\\mathbin}, etc.~)} +@d limit_switch=math_comp+1 {diddle limit conventions ( \.{\\displaylimits}, etc.~)} +@d above=limit_switch+1 {generalized fraction ( \.{\\above}, \.{\\atop}, etc.~)} +@d math_style=above+1 {style specification ( \.{\\displaystyle}, etc.~)} +@d math_choice=math_style+1 {choice specification ( \.{\\mathchoice} )} +@d non_script=math_choice+1 {conditional math glue ( \.{\\nonscript} )} +@d vcenter=non_script+1 {vertically center a vbox ( \.{\\vcenter} )} +@d case_shift=vcenter+1 {force specific case ( \.{\\lowercase}, \.{\\uppercase}~)} +@d message=case_shift+1 {send to user ( \.{\\message}, \.{\\errmessage} )} +@d extension=message+1 {extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~)} +@d in_stream=extension+1 {files for reading ( \.{\\openin}, \.{\\closein} )} +@d begin_group=in_stream+1 {begin local grouping ( \.{\\begingroup} )} +@d end_group=begin_group+1 {end local grouping ( \.{\\endgroup} )} +@d omit=end_group+1 {omit alignment template ( \.{\\omit} )} +@d ex_space=omit+1 {explicit space ( \.{\\\ } )} +@d no_boundary=ex_space+1 {suppress boundary ligatures ( \.{\\noboundary} )} +@d radical=no_boundary+1 {square root and similar signs ( \.{\\radical} )} +@d end_cs_name=radical+1 {end control sequence ( \.{\\endcsname} )} +@d min_internal=end_cs_name+1 {the smallest code that can follow \.{\\the}} +@d char_given=min_internal {character code defined by \.{\\chardef}} +@d math_given=char_given+1 {math code defined by \.{\\mathchardef}} +@d last_item=math_given+1 {most recent item ( \.{\\lastpenalty}, + \.{\\lastkern}, \.{\\lastskip} )} +@d inhibit_glue=last_item+1 {inhibit adjust glue ( \.{\\inhibitglue} )} +@d chg_dir=inhibit_glue+1 {change dir mode by \.{\\tate}, \.{\\yoko}} +@d max_non_prefixed_command=chg_dir {largest command code that can't be \.{\\global}} +@z + +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d toks_register=71 {token list register ( \.{\\toks} )} +@d assign_toks=72 {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} +@d assign_int=73 {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} +@d assign_dimen=74 {user-defined length ( \.{\\hsize}, etc.~)} +@d assign_glue=75 {user-defined glue ( \.{\\baselineskip}, etc.~)} +@d assign_mu_glue=76 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} +@d assign_font_dimen=77 {user-defined font dimension ( \.{\\fontdimen} )} +@d assign_font_int=78 {user-defined font integer ( \.{\\hyphenchar}, + \.{\\skewchar} )} +@d set_aux=79 {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} +@d set_prev_graf=80 {specify state info ( \.{\\prevgraf} )} +@d set_page_dimen=81 {specify state info ( \.{\\pagegoal}, etc.~)} +@d set_page_int=82 {specify state info ( \.{\\deadcycles}, +@y +@d toks_register=max_non_prefixed_command+1 {token list register ( \.{\\toks} )} +@d assign_toks=toks_register+1 + {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} +@d assign_int=assign_toks+1 + {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} +@d assign_dimen=assign_int+1 {user-defined length ( \.{\\hsize}, etc.~)} +@d assign_glue=assign_dimen+1 {user-defined glue ( \.{\\baselineskip}, etc.~)} +@d assign_mu_glue=assign_glue+1 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} +@d assign_font_dimen=assign_mu_glue+1 + {user-defined font dimension ( \.{\\fontdimen} )} +@d assign_font_int=assign_font_dimen+1 + {user-defined font integer ( \.{\\hyphenchar}, \.{\\skewchar} )} +@d assign_kinsoku=assign_font_int+1 + {user-defined kinsoku character ( \.{\\prebreakpenalty}, + \.{\\postbreakpenalty} )} +@d assign_inhibit_xsp_code=assign_kinsoku+1 + {user-defined inhibit xsp character ( \.{\\inhibitxspcode} )} +@d set_kansuji_char=assign_inhibit_xsp_code+1 + {user-defined kansuji character ( \.{\\kansujichar} )} +@d set_aux=set_kansuji_char+1 + {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} +@d set_prev_graf=set_aux+1 {specify state info ( \.{\\prevgraf} )} +@d set_page_dimen=set_prev_graf+1 {specify state info ( \.{\\pagegoal}, etc.~)} +@d set_page_int=set_page_dimen+1 {specify state info ( \.{\\deadcycles}, +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d set_box_dimen=83 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} +@d set_shape=84 {specify fancy paragraph shape ( \.{\\parshape} )} +@y +@d set_box_dimen=set_page_int+1 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} +@d set_shape=set_box_dimen+1 {specify fancy paragraph shape ( \.{\\parshape} )} +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d def_code=85 {define a character code ( \.{\\catcode}, etc.~)} +@d def_family=86 {declare math fonts ( \.{\\textfont}, etc.~)} +@d set_font=87 {set current font ( font identifiers )} +@d def_font=88 {define a font file ( \.{\\font} )} +@d register=89 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} +@d max_internal=89 {the largest code that can follow \.{\\the}} +@d advance=90 {advance a register or parameter ( \.{\\advance} )} +@d multiply=91 {multiply a register or parameter ( \.{\\multiply} )} +@d divide=92 {divide a register or parameter ( \.{\\divide} )} +@d prefix=93 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} +@y +@d def_code=set_shape+1 {define a character code ( \.{\\catcode}, etc.~)} +@d def_family=def_code+1 {declare math fonts ( \.{\\textfont}, etc.~)} +@d set_font=def_family+1 {set current font ( font identifiers )} +@d def_font=set_font+1 {define a font file ( \.{\\font} )} +@d def_jfont=def_font+1 {define a font file ( \.{\\jfont} )} +@d def_tfont=def_jfont+1 {define a font file ( \.{\\tfont} )} +@d register=def_tfont+1 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} +@d max_internal=register {the largest code that can follow \.{\\the}} +@d advance=max_internal+1 {advance a register or parameter ( \.{\\advance} )} +@d multiply=advance+1 {multiply a register or parameter ( \.{\\multiply} )} +@d divide=multiply+1 {divide a register or parameter ( \.{\\divide} )} +@d prefix=divide+1 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d let=94 {assign a command code ( \.{\\let}, \.{\\futurelet} )} +@d shorthand_def=95 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} + {or \.{\\charsubdef}} +@d read_to_cs=96 {read into a control sequence ( \.{\\read} )} +@y +@d let=prefix+1 {assign a command code ( \.{\\let}, \.{\\futurelet} )} +@d shorthand_def=let+1 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} + {or \.{\\charsubdef}} +@d read_to_cs=shorthand_def+1 {read into a control sequence ( \.{\\read} )} +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d def=97 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} +@d set_box=98 {set a box ( \.{\\setbox} )} +@d hyph_data=99 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} +@d set_interaction=100 {define level of interaction ( \.{\\batchmode}, etc.~)} +@d max_command=100 {the largest command code seen at |big_switch|} +@y +@d def=read_to_cs+1 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} +@d set_box=def+1 {set a box ( \.{\\setbox} )} +@d hyph_data=set_box+1 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} +@d set_interaction=hyph_data+1 {define level of interaction ( \.{\\batchmode}, etc.~)} +@d set_auto_spacing=set_interaction+1 {set auto spacing mode + ( \.{\\autospacing}, \.{\\noautospacing}, \.{\\autoxspacing}, \.{\\noautoxspacing} )} +@d partoken_name=set_auto_spacing+1 {set |par_token| name} +@d max_command=partoken_name {the largest command code seen at |big_switch|} +@z + +@x [16.212] l.4437 - pTeX: last_jchr, direction, adjust direction +@= +@!list_state_record=record@!mode_field:-mmode..mmode;@+ + @!head_field,@!tail_field: pointer; +@y +@= +@!list_state_record=record@!mode_field:-mmode..mmode;@+ + @!dir_field,@!adj_dir_field: -dir_yoko..dir_yoko; + @!pdisp_field: scaled; + @!head_field,@!tail_field,@!pnode_field,@!last_jchr_field: pointer; + @!disp_called_field: boolean; + @!inhibit_glue_flag_field: integer; +@z + +@x [16.213] l.4445 - pTeX: last_jchr, direction, adjust_dir, prev_{node,disp} +@d head==cur_list.head_field {header node of current list} +@d tail==cur_list.tail_field {final node on current list} +@y +@d direction==cur_list.dir_field {current direction} +@d adjust_dir==cur_list.adj_dir_field {current adjust direction} +@d head==cur_list.head_field {header node of current list} +@d tail==cur_list.tail_field {final node on current list} +@d prev_node==cur_list.pnode_field {previous to last |disp_node|} +@d prev_disp==cur_list.pdisp_field {displacemant at |prev_node|} +@d last_jchr==cur_list.last_jchr_field {final jchar node on current list} +@d disp_called==cur_list.disp_called_field {is a |disp_node| present in the current list?} +@d inhibit_glue_flag==cur_list.inhibit_glue_flag_field {is \.{\\inhibitglue} specified at the current list?} +@z + +@x [16.214] l.4464 - pTeX: prev_append: disp_node +@d tail_append(#)==begin link(tail):=#; tail:=link(tail); + end +@y +@d tail_append(#)==begin link(tail):=#; tail:=link(tail); + end +@d prev_append(#)==begin link(prev_node):=#; + link(link(prev_node)):=tail; prev_node:=link(prev_node); + end +@z + +@x [16.215] l.4477 - pTeX: last_jchr, direction, adjust_dir, prev_node +mode:=vmode; head:=contrib_head; tail:=contrib_head; +@y +mode:=vmode; head:=contrib_head; tail:=contrib_head; prev_node:=tail; +direction:=dir_yoko; adjust_dir:=direction; prev_disp:=0; last_jchr:=null; +disp_called:=false; +@z + +@x [16.216] l.4496 - pTeX: last_jchr, displacement. +incr(nest_ptr); head:=get_avail; tail:=head; prev_graf:=0; mode_line:=line; +@y +incr(nest_ptr); head:=new_null_box; tail:=head; prev_node:=tail; +prev_graf:=0; prev_disp:=0; disp_called:=false; last_jchr:=null; mode_line:=line; +@z + +@x [16.217] l.4504 - pTeX: pop_nest last_jchr +@p procedure pop_nest; {leave a semantic level, re-enter the old} +begin free_avail(head); decr(nest_ptr); cur_list:=nest[nest_ptr]; +end; +@y +@p procedure pop_nest; {leave a semantic level, re-enter the old} +begin +fast_delete_glue_ref(space_ptr(head)); fast_delete_glue_ref(xspace_ptr(head)); +free_node(head,box_node_size); decr(nest_ptr); cur_list:=nest[nest_ptr]; +end; +@z + +@x [16.218] l.4521 - pTeX: show_activities : direction + print_nl("### "); print_mode(m); +@y + print_nl("### "); print_direction(nest[p].dir_field); + print(", "); print_mode(m); +@z + +@x [17.224] l.4711 - pTeX: kanji_skip_code xkanji_skip_code, jfm_skip +@d thin_mu_skip_code=15 {thin space in math formula} +@d med_mu_skip_code=16 {medium space in math formula} +@d thick_mu_skip_code=17 {thick space in math formula} +@d glue_pars=18 {total number of glue parameters} +@y +@d kanji_skip_code=15 {between kanji-kanji space} +@d xkanji_skip_code=16 {between latin-kanji or kanji-latin space} +@d thin_mu_skip_code=17 {thin space in math formula} +@d med_mu_skip_code=18 {medium space in math formula} +@d thick_mu_skip_code=19 {thick space in math formula} +@d jfm_skip=20 {space refer from JFM} +@d glue_pars=21 {total number of glue parameters} +@z + +@x [17.224] l.4739 - kanji_skip, xkanji_skip +@d thick_mu_skip==glue_par(thick_mu_skip_code) +@y +@d thick_mu_skip==glue_par(thick_mu_skip_code) +@d kanji_skip==glue_par(kanji_skip_code) +@d xkanji_skip==glue_par(xkanji_skip_code) +@z + +@x [17.225] l.4767 - pTeX: kanji_skip_code xkanji_skip_code +thick_mu_skip_code: print_esc("thickmuskip"); +othercases print("[unknown glue parameter!]") +@y +thick_mu_skip_code: print_esc("thickmuskip"); +kanji_skip_code: print_esc("kanjiskip"); +xkanji_skip_code: print_esc("xkanjiskip"); +jfm_skip: print("refer from jfm"); +othercases print("[unknown glue parameter!]") +@z + +@x [17.226] l.4813 - pTeX: kanji_skip_code xkanji_skip_code +primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/ +@!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@> +@y +primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/ +@!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@> +primitive("kanjiskip",assign_glue,glue_base+kanji_skip_code);@/ +@!@:kanji_skip_}{\.{\\kanjiskip} primitive@> +primitive("xkanjiskip",assign_glue,glue_base+xkanji_skip_code);@/ +@!@:xkanji_skip_}{\.{\\xkanjiskip} primitive@> +@z + +@x [17.230] l.4867 - pTeX: cat_code_size, cur_jfont_loc, auto_spacing, auto_xspacing, inhibit_xsp_code, cur_tfont_loc +@d math_font_base=cur_font_loc+1 {table of 48 math font numbers} +@d cat_code_base=math_font_base+48 + {table of 256 command codes (the ``catcodes'')} +@d lc_code_base=cat_code_base+256 {table of 256 lowercase mappings} +@y +@d math_font_base=cur_font_loc+1 {table of 48 math font numbers} +@d cur_jfont_loc=math_font_base+48 +@d cur_tfont_loc=cur_jfont_loc+1 +@d auto_spacing_code=cur_tfont_loc+1 +@d auto_xspacing_code=auto_spacing_code+1 +@d cat_code_base=auto_xspacing_code+1 + {table of 256 command codes (the ``catcodes'')} +@d kcat_code_base=cat_code_base+256 + {table of 256 command codes for the wchar's catcodes } +@d auto_xsp_code_base=kcat_code_base+256 {table of 256 auto spacer flag} +@d inhibit_xsp_code_base=auto_xsp_code_base+256 +@d kinsoku_base=inhibit_xsp_code_base+1024 {table of 1024 kinsoku mappings} +@d kansuji_base=kinsoku_base+1024 {table of 10 kansuji mappings} +@d lc_code_base=kansuji_base+10 {table of 256 lowercase mappings} +@z + +@x [17.230] l.4900 - pTeX: +@d char_sub_code(#)==equiv(char_sub_code_base+#) + {Note: |char_sub_code(c)| is the true substitution info plus |min_halfword|} +@y +@d char_sub_code(#)==equiv(char_sub_code_base+#) + {Note: |char_sub_code(c)| is the true substitution info plus |min_halfword|} +@# +@d cur_jfont==equiv(cur_jfont_loc) { \pTeX } +@d cur_tfont==equiv(cur_tfont_loc) { \pTeX } +@d auto_spacing==equiv(auto_spacing_code) +@d auto_xspacing==equiv(auto_xspacing_code) +@d kcat_code(#)==equiv(kcat_code_base+#) +@d auto_xsp_code(#)==equiv(auto_xsp_code_base+#) +@d inhibit_xsp_type(#)==eq_type(inhibit_xsp_code_base+#) +@d inhibit_xsp_code(#)==equiv(inhibit_xsp_code_base+#) +@d kinsoku_type(#)==eq_type(kinsoku_base+#) +@d kinsoku_code(#)==equiv(kinsoku_base+#) +@d kansuji_char(#)==equiv(kansuji_base+#) +@z + +@x [17.232] l.4959 - pTeX: initialize cat_code, cur_jfont, cur_tfont +cur_font:=null_font; eq_type(cur_font_loc):=data; +eq_level(cur_font_loc):=level_one;@/ +@y +cur_font:=null_font; eq_type(cur_font_loc):=data; +eq_level(cur_font_loc):=level_one;@/ +cur_jfont:=null_font; eq_type(cur_jfont_loc):=data; +eq_level(cur_jfont_loc):=level_one;@/ +cur_tfont:=null_font; eq_type(cur_tfont_loc):=data; +eq_level(cur_tfont_loc):=level_one;@/ +@z + +@x [17.232] l.4965 - pTeX: initialize cat_code, cur_jfont, cur_tfont +for k:=0 to 255 do + begin cat_code(k):=other_char; math_code(k):=hi(k); sf_code(k):=1000; + end; +@y +eqtb[auto_spacing_code]:=eqtb[cat_code_base]; +eqtb[auto_xspacing_code]:=eqtb[cat_code_base]; +for k:=0 to 255 do + begin cat_code(k):=other_char; kcat_code(k):=other_kchar; + math_code(k):=hi(k); sf_code(k):=1000; + auto_xsp_code(k):=0; + end; +for k:=0 to 1023 do + begin inhibit_xsp_code(k):=0; inhibit_xsp_type(k):=0; + kinsoku_code(k):=0; kinsoku_type(k):=0; + end; +@z +@x [17.232] l.4971 - pTeX: initialize cat_code, cur_jfont, cur_tfont +for k:="0" to "9" do math_code(k):=hi(k+var_code); +for k:="A" to "Z" do + begin cat_code(k):=letter; cat_code(k+"a"-"A"):=letter;@/ + math_code(k):=hi(k+var_code+@"100); + math_code(k+"a"-"A"):=hi(k+"a"-"A"+var_code+@"100);@/ + lc_code(k):=k+"a"-"A"; lc_code(k+"a"-"A"):=k+"a"-"A";@/ + uc_code(k):=k; uc_code(k+"a"-"A"):=k;@/ + sf_code(k):=999; + end; +@y +for k:="0" to "9" do + begin math_code(k):=hi(k+var_code); + auto_xsp_code(k):=3; + end; +kansuji_char(0):=toDVI(fromJIS(@"213B)); +kansuji_char(1):=toDVI(fromJIS(@"306C)); +kansuji_char(2):=toDVI(fromJIS(@"4673)); +kansuji_char(3):=toDVI(fromJIS(@"3B30)); +kansuji_char(4):=toDVI(fromJIS(@"3B4D)); +kansuji_char(5):=toDVI(fromJIS(@"385E)); +kansuji_char(6):=toDVI(fromJIS(@"4F3B)); +kansuji_char(7):=toDVI(fromJIS(@"3C37)); +kansuji_char(8):=toDVI(fromJIS(@"482C)); +kansuji_char(9):=toDVI(fromJIS(@"3665)); +for k:="A" to "Z" do + begin cat_code(k):=letter; cat_code(k+"a"-"A"):=letter;@/ + math_code(k):=hi(k+var_code+@"100); + math_code(k+"a"-"A"):=hi(k+"a"-"A"+var_code+@"100);@/ + lc_code(k):=k+"a"-"A"; lc_code(k+"a"-"A"):=k+"a"-"A";@/ + uc_code(k):=k; uc_code(k+"a"-"A"):=k;@/ + auto_xsp_code(k):=3; auto_xsp_code(k+"a"-"A"):=3;@/ + sf_code(k):=999; + end; +@t\hskip10pt@>kcat_code(@"20+1):=other_kchar; {1 ku} +@t\hskip10pt@>kcat_code(@"20+2):=other_kchar; {2 ku} +@+@t\1@>for k:=3 to 6 do kcat_code(@"20+k):=kana; {3 ku ... 6 ku} +@+@t\1@>for k:=7 to 8 do kcat_code(@"20+k):=other_kchar; {7 ku ... 8 ku} +@+@t\1@>for k:=16 to 84 do kcat_code(@"20+k):=kanji; {16 ku ... 84 ku} +{ $\.{@@"20}+|k| = |kcatcodekey|(|fromKUTEN|(|HILO|(k,1))$ } +@z + +@x +@ @= +if n= +if n +@y +primitive("newlinechar",assign_int,int_base+new_line_char_code);@/ +@!@:new_line_char_}{\.{\\newlinechar} primitive@> +primitive("jfam",assign_int,int_base+cur_jfam_code);@/ +@!@:cur_jfam_}{\.{\\jfam} primitive@> +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@> +primitive("ptexlineendmode",assign_int,int_base+ptex_lineend_code);@/ +@!@:ptex_lineend_mode_}{\.{\\ptexlineendmode} primitive@> +primitive("ptextracingfonts",assign_int,int_base+ptex_tracing_fonts_code);@/ +@!@:ptex_tracing_fonts_}{\.{\\ptextracingfonts} primitive@> +@z + +@x [17.247] l.5490 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift +@d h_offset_code=18 {amount of horizontal offset when shipping pages out} +@d v_offset_code=19 {amount of vertical offset when shipping pages out} +@d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking} +@d dimen_pars=21 {total number of dimension parameters} +@d scaled_base=dimen_base+dimen_pars + {table of 256 user-defined \.{\\dimen} registers} +@d eqtb_size=scaled_base+255 {largest subscript of |eqtb|} +@y +@d h_offset_code=18 {amount of horizontal offset when shipping pages out} +@d v_offset_code=19 {amount of vertical offset when shipping pages out} +@d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking} +@d t_baseline_shift_code=21 {shift amount when mixing TATE-kumi and Alphabet} +@d y_baseline_shift_code=22 {shift amount when mixing YOKO-kumi and Alphabet} +@d dimen_pars=23 {total number of dimension parameters} +@d scaled_base=dimen_base+dimen_pars + {table of 256 user-defined \.{\\dimen} registers} +@d kinsoku_penalty_base=scaled_base+256 {table of 256 kinsoku registers} +@d eqtb_size=kinsoku_penalty_base+255 {largest subscript of |eqtb|} +@z + +@x l.5498 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift +@d dimen(#)==eqtb[scaled_base+#].sc +@d dimen_par(#)==eqtb[dimen_base+#].sc {a scaled quantity} +@y +@d dimen(#)==eqtb[scaled_base+#].sc +@d dimen_par(#)==eqtb[dimen_base+#].sc {a scaled quantity} +@d kinsoku_penalty(#)==eqtb[kinsoku_penalty_base+#].int +@z + +@x l.5518 - pTeX: +@d h_offset==dimen_par(h_offset_code) +@d v_offset==dimen_par(v_offset_code) +@y +@d h_offset==dimen_par(h_offset_code) +@d v_offset==dimen_par(v_offset_code) +@d t_baseline_shift==dimen_par(t_baseline_shift_code) +@d y_baseline_shift==dimen_par(y_baseline_shift_code) +@z + +@x l.5542 - pTeX: +h_offset_code:print_esc("hoffset"); +v_offset_code:print_esc("voffset"); +emergency_stretch_code:print_esc("emergencystretch"); +othercases print("[unknown dimen parameter!]") +@y +h_offset_code:print_esc("hoffset"); +v_offset_code:print_esc("voffset"); +t_baseline_shift_code:print_esc("tbaselineshift"); +y_baseline_shift_code:print_esc("ybaselineshift"); +emergency_stretch_code:print_esc("emergencystretch"); +othercases print("[unknown dimen parameter!]") +@z + +@x [17.248] l.5588 - pTeX: rotate offset +primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/ +@!@:h_offset_}{\.{\\hoffset} primitive@> +primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/ +@!@:v_offset_}{\.{\\voffset} primitive@> +@y +primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/ +@!@:h_offset_}{\.{\\hoffset} primitive@> +primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/ +@!@:v_offset_}{\.{\\voffset} primitive@> +primitive("tbaselineshift",assign_dimen,dimen_base+t_baseline_shift_code);@/ +@!@:t_baseline_shift_}{\.{\\tbaselineshift} primitive@> +primitive("ybaselineshift",assign_dimen,dimen_base+y_baseline_shift_code);@/ +@!@:y_baseline_shift_}{\.{\\ybaselineshift} primitive@> +@z + +@x [17.252] l.5622 - pTeX: show eqtb +else if n<=eqtb_size then @ +else print_char("?"); {this can't happen either} +end; +tats +@y +else if n +else if n<=eqtb_size then begin + print("kinsoku table "); print_int(n-kinsoku_penalty_base); + print(", penalty="); print_int(eqtb[n].int); + end +else print_char("?"); {this can't happen either} +end; +tats +@z + +@x [18] buffer2 +for k:=j to j+l-1 do append_char(buffer[k]); +@y +for k:=j to j+l-1 do append_char(buffer2[k]*@"100+buffer[k]); +@z + +@x [18.???] l.???? - pTeX multibyte control symbol +procedure print_cs(@!p:integer); {prints a purported control sequence} +@y +procedure print_cs(@!p:integer); {prints a purported control sequence} +var j, l:pool_pointer; @!cat:0..max_char_code; +@z + +@x [18.???] +else begin print_esc(text(p)); + print_char(" "); + end; +@y +else begin l:=text(p); + print_esc(l); j:=str_start[l]; l:=str_start[l+1]; + if l>j+1 then begin + if (str_pool[j]>=@"100)and(l-j=multistrlenshort(str_pool, l, j)) then + begin cat:=kcat_code(kcatcodekey(fromBUFFshort(str_pool, l, j))); + if (cat<>other_kchar) then print_char(" "); + end + else print_char(" "); end + else print_char(" "); + end; +@z + +@x [18.???] pTeX: ensure buffer2[]=0 in primitive + for j:=0 to l-1 do buffer[j]:=so(str_pool[k+j]); +@y + for j:=0 to l-1 do begin + buffer[j]:=Lo(so(str_pool[k+j])); buffer2[j]:=Hi(so(str_pool[k+j])); end; +@z + +@x [18.265] l.5903 - pTeX: \jfont \tfont +primitive("font",def_font,0);@/ +@!@:font_}{\.{\\font} primitive@> +@y +primitive("font",def_font,0);@/ +@!@:font_}{\.{\\font} primitive@> +primitive("jfont",def_jfont,0);@/ +@!@:jfont_}{\.{\\jfont} primitive@> +primitive("tfont",def_tfont,0);@/ +@!@:tfont_}{\.{\\tfont} primitive@> +@z + +@x [18.266] l.5979 - pTeX: \jfont, \tfont +def_font: print_esc("font"); +@y +def_font: print_esc("font"); +def_jfont: print_esc("jfont"); +def_tfont: print_esc("tfont"); +@z + +@x [18.???] pTeX: \ptextracingfonts based on pdfTeX \pdftracingfonts +@= +print_esc(font_id_text(font(p))) +@y +@= +begin + print_esc(font_id_text(font(p))); + if ptex_tracing_fonts > 0 then begin + print(" ("); + print_font_name_and_size(font(p)); + if ptex_tracing_fonts > 1 then begin + print_font_dir_and_enc(font(p)); + end; + print(")"); + end; +end; + +@ @= +procedure print_font_name_and_size(f:internal_font_number); +begin + print(font_name[f]); + if font_size[f]<>font_dsize[f] then begin + print("@@"); + print_scaled(font_size[f]); + print("pt"); + end; +end; +@# +procedure print_font_dir_and_enc(f:internal_font_number); +begin + if font_dir[f]=dir_tate then print("/TATE") + else if font_dir[f]=dir_yoko then print("/YOKO"); + if font_enc[f]=2 then print("+Unicode") + else if font_enc[f]=1 then print("+JIS"); +end; +@z + +@x [20.289] l.6387 - pTeX: cs_token_flag +@d cs_token_flag==@'7777 {amount added to the |eqtb| location in a + token that stands for a control sequence; is a multiple of~256, less~1} +@y +@d cs_token_flag==@"FFFF {amount added to the |eqtb| location in a + token that stands for a control sequence; is a multiple of~256, less~1} +@z + +@x [20.293] l.6496 - pTeX: show_token_list +@ @= +if (pmem_end) then + begin print_esc("CLOBBERED."); return; +@.CLOBBERED@> + end; +if info(p)>=cs_token_flag then print_cs(info(p)-cs_token_flag) +else begin m:=info(p) div @'400; c:=info(p) mod @'400; + if info(p)<0 then print_esc("BAD.") +@.BAD@> + else @; + end +@y +@ @= +if (pmem_end) then + begin print_esc("CLOBBERED."); return; +@.CLOBBERED@> + end; +if info(p)>=cs_token_flag then print_cs(info(p)-cs_token_flag) {|wchar_token|} +else begin + if check_kanji(info(p)) then {|wchar_token|} + begin m:=kcat_code(kcatcodekey(info(p))); c:=info(p); + end + else begin m:=Hi(info(p)); c:=Lo(info(p)); + end; + if (m256) then print_esc("BAD.") +@.BAD@> + else @; +end +@z + +@x [20.294] l.6512 - pTeX: show_token_list +@= +case m of +left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer, + letter,other_char: print(c); +@y +@= +case m of +kanji,kana,other_kchar: print_kanji(KANJI(c)); +left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer, + letter,other_char: print(c); +@z + +@x [21.298] l.6632 - pTeX: print KANJI +other_char: chr_cmd("the character "); +@y +other_char: chr_cmd("the character "); +kanji,kana,other_kchar: begin print("kanji character "); + print_kanji(KANJI(chr_code)); end; +@z + +@x [22.303] l.6726 - pTeX: state mid_kanji +1) |state=mid_line| is the normal state.\cr +2) |state=skip_blanks| is like |mid_line|, but blanks are ignored.\cr +3) |state=new_line| is the state at the beginning of a line.\cr}}$$ +@y +1) |state=mid_line| is the normal state.\cr +2) |state=mid_kanji| is like |mid_line|, and internal KANJI string.\cr +3) |state=skip_blanks| is like |mid_line|, but blanks are ignored.\cr +4) |state=skip_blanks_kanji| is like |mid_kanji|, but blanks are ignored.\cr +5) |state=new_line| is the state at the beginning of a line.\cr}}$$ +@z + +@x +ignored; after this case is processed, the next value of |state| will +be |skip_blanks|. +@y +ignored; after this case is processed, the next value of |state| will +be |skip_blanks|. + +If \.{\\ptexlineendmode} is odd, the |state| become |skip_blanks_kanji| +after a control word which ends with a Japanese character. This is +similar to |skip_blanks|, but the |state| will be |mid_kanji| after +|skip_blanks_kanji+left_brace| and |skip_blanks_kanji+right_brace|, +instead of |mid_line|. +@z + +@x [22.303] l.6736 - pTeX: state mid_kanji +@d mid_line=1 {|state| code when scanning a line of characters} +@d skip_blanks=2+max_char_code {|state| code when ignoring blanks} +@d new_line=3+max_char_code+max_char_code {|state| code at start of line} +@y +@d mid_line=1 {|state| code when scanning a line of characters} +@d mid_kanji=2+max_char_code {|state| code when scanning a line of characters} +@d skip_blanks=3+max_char_code+max_char_code {|state| code when ignoring blanks} +@d skip_blanks_kanji=4+max_char_code+max_char_code+max_char_code + {|state| code when ignoring blanks} +@d new_line=5+max_char_code+max_char_code+max_char_code+max_char_code + {|state| code at start of line} +@z + +@x [22.311] l.6986 - pTeX: label +@p procedure show_context; {prints where the scanner is} +label done; +var old_setting:0..max_selector; {saved |selector| setting} +@y +@p procedure show_context; {prints where the scanner is} +label done, done1; +var old_setting:0..max_selector; {saved |selector| setting} +@!s: pointer; {temporary pointer} +@z + +@x [22.316] l.7110 - pTeX: init kcode_pos +@d begin_pseudoprint== + begin l:=tally; tally:=0; selector:=pseudo; + trick_count:=1000000; + end +@y +@d begin_pseudoprint== + begin l:=tally; tally:=0; selector:=pseudo; kcode_pos:=0; + trick_count:=1000000; + end +@z + +@x [22.316] l.7114 - pTeX: kcode_pos +@d set_trick_count== + begin first_count:=tally; + trick_count:=tally+1+error_line-half_error_line; + if trick_count0)and(trick_buf2[(first_count-1)mod error_line]=1) then + incr(first_count); + trick_count:=first_count+1+error_line-half_error_line; + if trick_count0 then for i:=start to j-1 do + begin if i=loc then set_trick_count; + print(buffer[i]); + end +@y +if j>0 then begin + i:=start; + if (loc<=j-1)and(start<=loc) then begin + for i:=start to loc-1 do + if buffer2[i]>0 then + print_char(@"100*buffer2[i]+buffer[i]) else print(buffer[i]); + set_trick_count; print_unread_buffer_with_ptenc(loc,j); + end + else + for i:=start to j-1 do + if buffer2[i]>0 then + print_char(@"100*buffer2[i]+buffer[i]) else print(buffer[i]); + end +@z + +@x [22.319] l.7157 - pTeX: adjust kanji code token +@ @= +begin_pseudoprint; +if token_type= +begin_pseudoprint; +if token_typenull) then + begin if (link(start)=null)and(check_kanji(info(start))) then {|wchar_token|} + begin cur_input:=input_stack[base_ptr-1]; + s:=get_avail; info(s):=Lo(info(loc)); + cur_input:=input_stack[base_ptr]; + link(start):=s; + show_token_list(start,loc,100000); + free_avail(s);link(start):=null; + goto done1; + end; + end; + show_token_list(start,loc,100000); + end +else show_token_list(link(start),loc,100000); {avoid reference count} +done1: +@z + +@x [23.???] pTeX: init the input routines +first:=buf_size; repeat buffer[first]:=0; decr(first); until first=0; +@y +first:=buf_size; repeat buffer[first]:=0; buffer2[first]:=0; decr(first); until first=0; +@z + + +@x [24.341] l.7479 - pTeX: set last_chr +@!cat:0..max_char_code; {|cat_code(cur_chr)|, usually} +@y +@!cat:escape..max_char_code; {|cat_code(cur_chr)|, usually} +@!l:0..buf_size; {temporary index into |buffer|} +@z + +@x [24.343] l.7500 - pTeX: input external file +@ @= +@^inner loop@> +begin switch: if loc<=limit then {current line not yet finished} + begin cur_chr:=buffer[loc]; incr(loc); + reswitch: cur_cmd:=cat_code(cur_chr); +@y +@ @= +@^inner loop@> +begin switch: if loc<=limit then {current line not yet finished} + begin cur_chr:=buffer[loc]; incr(loc); + if multistrlen(ustringcast(buffer), limit+1, loc-1)=2 then + begin cur_chr:=fromBUFF(ustringcast(buffer), limit+1, loc-1); + cur_cmd:=kcat_code(kcatcodekey(cur_chr)); + for l:=loc-1 to loc-2+multistrlen(ustringcast(buffer), limit+1, loc-1) do + buffer2[l]:=1; + incr(loc); + end + else reswitch: cur_cmd:=cat_code(cur_chr); +@z + +@x [24.344] l.7535 - pTeX: ASCII-KANJI space handling +@d any_state_plus(#) == mid_line+#,skip_blanks+#,new_line+# +@y +@d any_state_plus(#) == + mid_line+#,mid_kanji+#,skip_blanks+#,skip_blanks_kanji+#,new_line+# +@z + +@x +@ @= +any_state_plus(ignore),skip_blanks+spacer,new_line+spacer +@y +@ @= +any_state_plus(ignore),skip_blanks+spacer,skip_blanks_kanji+spacer,new_line+spacer +@z + +@x [24.347] l.7569 - pTeX: scaner +@ @d add_delims_to(#)==#+math_shift,#+tab_mark,#+mac_param, + #+sub_mark,#+letter,#+other_char +@y +@ @d add_delims_to(#)==#+math_shift,#+tab_mark,#+mac_param, + #+sub_mark,#+letter,#+other_char +@d all_jcode(#)==#+kanji,#+kana,#+other_kchar +@z + +@x [24.347] l.7573 - pTeX: scaner +mid_line+spacer:@; +mid_line+car_ret:@; +skip_blanks+car_ret,any_state_plus(comment): + @; +new_line+car_ret:@; +mid_line+left_brace: incr(align_state); +skip_blanks+left_brace,new_line+left_brace: begin + state:=mid_line; incr(align_state); + end; +mid_line+right_brace: decr(align_state); +skip_blanks+right_brace,new_line+right_brace: begin + state:=mid_line; decr(align_state); + end; +add_delims_to(skip_blanks),add_delims_to(new_line): state:=mid_line; +@y +mid_kanji+spacer,mid_line+spacer:@; +mid_line+car_ret:@; +mid_kanji+car_ret: if skip_mode then @ + else @; +skip_blanks+car_ret,skip_blanks_kanji+car_ret,any_state_plus(comment): + @; +new_line+car_ret:@; +mid_line+left_brace: incr(align_state); +mid_kanji+left_brace: begin incr(align_state); + if ((ptex_lineend div 4) mod 2)=1 then state:=mid_line; + end; +skip_blanks+left_brace,new_line+left_brace: begin + state:=mid_line; incr(align_state); + end; +skip_blanks_kanji+left_brace: begin + state:=mid_kanji; incr(align_state); + end; +mid_line+right_brace: decr(align_state); +mid_kanji+right_brace: begin decr(align_state); + if ((ptex_lineend div 4) mod 2)=1 then state:=mid_line; + end; +skip_blanks+right_brace,new_line+right_brace: begin + state:=mid_line; decr(align_state); + end; +skip_blanks_kanji+right_brace: begin + state:=mid_kanji; decr(align_state); + end; +add_delims_to(skip_blanks),add_delims_to(skip_blanks_kanji), +add_delims_to(new_line),add_delims_to(mid_kanji): + state:=mid_line; +all_jcode(skip_blanks),all_jcode(skip_blanks_kanji),all_jcode(new_line), +all_jcode(mid_line): + state:=mid_kanji; + +@ @= +skip_mode:boolean; + +@ @= +skip_mode:=true; +@z + +@x [24.354] l.7659 - pTeX: scan control sequence +@= +begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case} +else begin start_cs: k:=loc; cur_chr:=buffer[k]; cat:=cat_code(cur_chr); + incr(k); + if cat=letter then state:=skip_blanks + else if cat=spacer then state:=skip_blanks + else state:=mid_line; + if (cat=letter)and(k<=limit) then + @ + else @; + cur_cs:=single_base+buffer[loc]; incr(loc); + end; +found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); +if cur_cmd>=outer_call then check_outer_validity; +end +@y +@= +begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case} +else begin k:=loc; cur_chr:=buffer[k]; incr(k); + if multistrlen(ustringcast(buffer), limit+1, k-1)=2 then + begin cat:=kcat_code(kcatcodekey(fromBUFF(ustringcast(buffer), limit+1, k-1))); + for l:=k-1 to k-2+multistrlen(ustringcast(buffer), limit+1, k-1) do + buffer2[l]:=1; + incr(k); + end + else cat:=cat_code(cur_chr); +start_cs: + if cat=letter then state:=skip_blanks + else if (cat=kanji)or(cat=kana) then + begin if (ptex_lineend mod 2)=0 then state:=skip_blanks_kanji + else state:=skip_blanks end + else if cat=spacer then state:=skip_blanks + else if cat=other_kchar then + begin if ((ptex_lineend div 2) mod 2)=0 then state:=mid_kanji + else state:=mid_line end + else state:=mid_line; + if cat=other_kchar then + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end + else if ((cat=letter)or(cat=kanji)or(cat=kana))and(k<=limit) then + @ + else @; + {single-letter control sequence} + if (cat=kanji)or(cat=kana) then + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end + else begin cur_cs:=single_base+buffer[loc]; incr(loc); end; + end; +found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); +if cur_cmd>=outer_call then check_outer_validity; +end +@z + +@x +@= +begin if buffer[k]=cur_chr then @+if cat=sup_mark then @+if k2 then + begin hex_to_cur_chr; buffer[k-1]:=cur_chr; + end + else if c<@'100 then buffer[k-1]:=c+@'100 + else buffer[k-1]:=c-@'100; + limit:=limit-d; first:=first-d; + while k<=limit do + begin buffer[k]:=buffer[k+d]; incr(k); + end; + goto start_cs; + end; + end; +end +@y +@= +begin if buffer[k]=cur_chr then @+if cat=sup_mark then @+if k2 then + begin hex_to_cur_chr; buffer[k-1]:=cur_chr; + end + else if c<@'100 then buffer[k-1]:=c+@'100 + else buffer[k-1]:=c-@'100; + buffer2[k-1]:=0; limit:=limit-d; first:=first-d; + l:=k; cur_chr:=buffer[k-1]; cat:=cat_code(cur_chr); + while l<=limit do + begin buffer[l]:=buffer[l+d]; buffer2[l]:=buffer2[l+d]; incr(l); + end; + goto start_cs; + end; + end; +end +@z + +@x [24.356] l.7727 - pTeX: scan control sequence (cont) +@ @= +begin repeat cur_chr:=buffer[k]; cat:=cat_code(cur_chr); incr(k); +until (cat<>letter)or(k>limit); +@; +if cat<>letter then decr(k); + {now |k| points to first nonletter} +if k>loc+1 then {multiletter control sequence has been scanned} + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end; +end +@y +@ @= +begin repeat cur_chr:=buffer[k]; incr(k); + if multistrlen(ustringcast(buffer), limit+1, k-1)=2 then + begin cat:=kcat_code(kcatcodekey(fromBUFF(ustringcast(buffer), limit+1, k-1))); + for l:=k-1 to k-2+multistrlen(ustringcast(buffer), limit+1, k-1) do + buffer2[l]:=1; + incr(k); + if (cat=kanji)or(cat=kana) then + begin if (ptex_lineend mod 2)=0 then state:=skip_blanks_kanji + else state:=skip_blanks end; + end + else cat:=cat_code(cur_chr); + while (buffer[k]=cur_chr)and(cat=sup_mark)and(k2 then + begin hex_to_cur_chr; + end + else if c<@'100 then cur_chr:=c+@'100 + else cur_chr:=c-@'100; + cat:=cat_code(cur_chr); + if (cat=letter)or(cat=sup_mark) then + begin buffer[k-1]:=cur_chr; buffer2[k-1]:=0; + limit:=limit-d; first:=first-d; + l:=k; + while l<=limit do + begin buffer[l]:=buffer[l+d]; buffer2[l]:=buffer2[l+d]; incr(l); + end; + end; + end; + end; + if cat=letter then state:=skip_blanks; +until not((cat=letter)or(cat=kanji)or(cat=kana))or(k>limit); +{@@;} +if not((cat=letter)or(cat=kanji)or(cat=kana)) then decr(k); +if cat=other_kchar then decr(k); {now |k| points to first nonletter} +if k>loc+1 then {multiletter control sequence has been scanned} + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end; +end +@z + +@x [24.357] l.7771 - pTeX: input from token list +@= +if loc<>null then {list not exhausted} +@^inner loop@> + begin t:=info(loc); loc:=link(loc); {move to next} + if t>=cs_token_flag then {a control sequence token} + begin cur_cs:=t-cs_token_flag; + cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); + if cur_cmd>=outer_call then + if cur_cmd=dont_expand then + @ + else check_outer_validity; + end + else begin cur_cmd:=t div @'400; cur_chr:=t mod @'400; + case cur_cmd of + left_brace: incr(align_state); + right_brace: decr(align_state); + out_param: @; + othercases do_nothing + endcases; + end; + end +else begin {we are done with this token list} + end_token_list; goto restart; {resume previous level} + end +@y +@= +if loc<>null then {list not exhausted} +@^inner loop@> + begin t:=info(loc); loc:=link(loc); {move to next} + if t>=cs_token_flag then {a control sequence token} + begin cur_cs:=t-cs_token_flag; + cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); + if cur_cmd>=outer_call then + if cur_cmd=dont_expand then + @ + else check_outer_validity; + end + else if check_kanji(t) then {|wchar_token|} + begin cur_chr:=t; cur_cmd:=kcat_code(kcatcodekey(t)); + end + else + begin cur_cmd:=Hi(t); cur_chr:=Lo(t); + case cur_cmd of + left_brace: incr(align_state); + right_brace: decr(align_state); + out_param: @; + othercases do_nothing + endcases; + end; + end +else begin {we are done with this token list} + end_token_list; goto restart; {resume previous level} + end +@z + +@x [24] pTeX: firm_up_the_line + if start"); {wait for user response} +@.=>@> + if last>first then + begin for k:=first to last-1 do {move line down in buffer} + buffer[k+start-first]:=buffer[k]; +@y + if start0 then print_char(buffer[k]) else print(buffer[k]); + first:=limit; prompt_input("=>"); {wait for user response} +@.=>@> + if last>first then + begin for k:=first to last-1 do {move line down in buffer} + begin buffer[k+start-first]:=buffer[k]; buffer2[k+start-first]:=buffer2[k]; end; +@z + +@x [24.365] l.7935 - pTeX: get_token +@p procedure get_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|} +begin no_new_control_sequence:=false; get_next; no_new_control_sequence:=true; +@^inner loop@> +if cur_cs=0 then cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +end; +@y +@p procedure get_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|} +begin no_new_control_sequence:=false; get_next; no_new_control_sequence:=true; +@^inner loop@> +if cur_cs=0 then + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|} + cur_tok:=cur_chr + else cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +end; +@z + +@x [25.374] l.8073 - pTeX: get_chr +@ @= +j:=first; p:=link(r); +while p<>null do + begin if j>=max_buf_stack then + begin max_buf_stack:=j+1; + if max_buf_stack=buf_size then + overflow("buffer size",buf_size); +@:TeX capacity exceeded buffer size}{\quad buffer size@> + end; + buffer[j]:=info(p) mod @'400; incr(j); p:=link(p); + end; +if j>first+1 then + begin no_new_control_sequence:=false; cur_cs:=id_lookup(first,j-first); + no_new_control_sequence:=true; + end +else if j=first then cur_cs:=null_cs {the list is empty} +else cur_cs:=single_base+buffer[first] {the list has length one} +@y +@ @= +j:=first; p:=link(r); +while p<>null do + begin if j>=max_buf_stack then + begin max_buf_stack:=j+1; + if max_buf_stack=buf_size then + overflow("buffer size",buf_size); +@:TeX capacity exceeded buffer size}{\quad buffer size@> + end; + if check_kanji(info(p)) then {|wchar_token|} + begin buffer[j]:=Hi(info(p)); buffer2[j]:=1; incr(j); buffer2[j]:=1; + end + else buffer2[j]:=0; + buffer[j]:=Lo(info(p)); incr(j); p:=link(p); + end; +if j>first+1 then + begin no_new_control_sequence:=false; cur_cs:=id_lookup(first,j-first); + no_new_control_sequence:=true; + end +else if j=first then cur_cs:=null_cs {the list is empty} +else cur_cs:=single_base+buffer[first] {the list has length one} +@z + +@x [25.380] l.8221 - pTeX: get_x_token +@p procedure get_x_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|, + and expands macros} +label restart,done; +begin restart: get_next; +@^inner loop@> +if cur_cmd<=max_command then goto done; +if cur_cmd>=call then + if cur_cmd +if cur_cmd<=max_command then goto done; +if cur_cmd>=call then + if cur_cmdmax_command do + begin expand; + get_next; + end; +if cur_cs=0 then cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +@y +@p procedure x_token; {|get_x_token| without the initial |get_next|} +begin while cur_cmd>max_command do + begin expand; + get_next; + end; +if cur_cs=0 then + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + cur_tok:=cur_chr + else cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +@z + +@x [26.413] l.8341 - pTeX: scan_something_internal +@p procedure scan_something_internal(@!level:small_number;@!negative:boolean); +@y +@p @t\4@>@@t@>@/ +procedure scan_something_internal(@!level:small_number;@!negative:boolean); +@z +@x [26.413] l.8343 - pTeX: scan_something_internal +var m:halfword; {|chr_code| part of the operand token} +@y +var m:halfword; {|chr_code| part of the operand token} +@!q,@!r:pointer; {general purpose indices} +@!tx:pointer; {effective tail node} +@!qx:halfword; {general purpose index} +@z +@x [26.413] l.8345 - pTeX: scan_something_internal +case cur_cmd of +def_code: @; +toks_register,assign_toks,def_family,set_font,def_font: @; +@y +case cur_cmd of +assign_kinsoku: @; +assign_inhibit_xsp_code: @; +set_kansuji_char: @; +def_code: @; +toks_register,assign_toks,def_family,set_font,def_font,def_jfont,def_tfont: + @; +@z + +@x [26.414] l.8373 - pTeX: +begin scan_char_num; +if m=math_code_base then scanned_result(ho(math_code(cur_val)))(int_val) +else if m +@y +primitive("badness",last_item,badness_code); +@!@:badness_}{\.{\\badness} primitive@> +primitive("ptexversion",last_item,ptex_version_code); +@!@:ptexversion_}{\.{\\ptexversion} primitive@> +primitive("ptexminorversion",last_item,ptex_minor_version_code); +@!@:ptexminorversion_}{\.{\\ptexminorversion} primitive@> +@z + +@x pTeX: \ptexversion + input_line_no_code: print_esc("inputlineno"); +@y + input_line_no_code: print_esc("inputlineno"); + ptex_version_code: print_esc("ptexversion"); + ptex_minor_version_code: print_esc("ptexminorversion"); +@z + +@x [26.420] l.8474 - pTeX: Fetch a box dimension: dir_node +begin scan_eight_bit_int; +if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc; +@y +begin scan_eight_bit_int; q:=box(cur_val); +if q=null then cur_val:=0 +else begin qx:=q; + while (q<>null)and(abs(box_dir(q))<>abs(direction)) do q:=link(q); + if q=null then + begin r:=link(qx); link(qx):=null; + q:=new_dir_node(qx,abs(direction)); link(qx):=r; + cur_val:=mem[q+m].sc; + delete_glue_ref(space_ptr(q)); delete_glue_ref(xspace_ptr(q)); + free_node(q,box_node_size); + end + else cur_val:=mem[q+m].sc; + end; +@z + +@x [26.424] l.8508 - pTeX: disp_node +legal in similar contexts. +@y +legal in similar contexts. + +The macro |find_effective_tail_pTeX| sets |tx| to the last non-|disp_node| +of the current list. +@z + +@x [26.424] l.8510 - pTeX: disp_node +@= +@y +@d find_effective_tail_pTeX== +tx:=tail; +if not is_char_node(tx) then + if type(tx)=disp_node then + begin tx:=prev_node; + if not is_char_node(tx) then + if type(tx)=disp_node then {|disp_node| from a discretionary} + begin tx:=head; q:=link(head); + while q<>prev_node do + begin if is_char_node(q) then tx:=q + else if type(q)<>disp_node then tx:=q; + end; + q:=link(q); + end; + end +@# +@d find_effective_tail==find_effective_tail_pTeX + +@= +@z + +@x pTeX: \ptexversion + begin if cur_chr=input_line_no_code then cur_val:=line + else cur_val:=last_badness; {|cur_chr=badness_code|} +@y + begin case m of + input_line_no_code: cur_val:=line; + badness_code: cur_val:=last_badness; + ptex_version_code: cur_val:=pTeX_version; + ptex_minor_version_code: cur_val:=pTeX_minor_version; + end; {there and no other cases} +@z + +@x [26.424] l.8516 - pTeX: Fetch an item ...: disp_node +else begin if cur_chr=glue_val then cur_val:=zero_glue@+else cur_val:=0; +@y +else begin if cur_chr=glue_val then cur_val:=zero_glue@+else cur_val:=0; + find_effective_tail; +@z +@x [26.424] l.8518 - pTeX: Fetch an item ...: disp_node + if not is_char_node(tail)and(mode<>0) then + case cur_chr of + int_val: if type(tail)=penalty_node then cur_val:=penalty(tail); + dimen_val: if type(tail)=kern_node then cur_val:=width(tail); + glue_val: if type(tail)=glue_node then + begin cur_val:=glue_ptr(tail); + if subtype(tail)=mu_glue then cur_val_level:=mu_val; + end; +@y + if not is_char_node(tx)and(tx<>head)and(mode<>0) then + case cur_chr of + int_val: if type(tx)=penalty_node then cur_val:=penalty(tx); + dimen_val: if type(tx)=kern_node then cur_val:=width(tx); + glue_val: if type(tx)=glue_node then + begin cur_val:=glue_ptr(tx); + if subtype(tx)=mu_glue then cur_val_level:=mu_val; + end; +@z +@x [26.424] l.8527 - pTeX: Fetch an item ...: disp_node + else if (mode=vmode)and(tail=head) then +@y + else if (mode=vmode)and(tx=head) then +@z + +@x [26.435] l.8940 - pTeX: scan_char_num +procedure scan_char_num; +begin scan_int; +if (cur_val<0)or(cur_val>255) then + begin print_err("Bad character code"); +@.Bad character code@> + help2("A character number must be between 0 and 255.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@y +procedure scan_ascii_num; +begin scan_int; +if (cur_val<0)or(cur_val>255) then + begin print_err("Bad character code"); +@.Bad character code@> + help2("A character number must be between 0 and 255.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +procedure scan_char_num; +begin scan_int; +if not is_char_ascii(cur_val) and not is_char_kanji(cur_val) then + begin print_err("Bad character code"); +@.Bad character code@> + help2("A character number must be between 0 and 255, or KANJI code.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@z + +@x [26.442] l.9045 - pTeX: KANJI character scanning +@= +begin get_token; {suppress macro expansion} +if cur_tok255 then + begin print_err("Improper alphabetic constant"); +@.Improper alphabetic constant@> + help2("A one-character control sequence belongs after a ` mark.")@/ + ("So I'm essentially inserting \0 here."); + cur_val:="0"; back_error; + end +else @; +end +@y +@= +begin get_token; {suppress macro expansion} +if cur_tok both case should raise "Improper ..." error + * otherwise it should be a single-character CS with |cur_val|<=255 } + begin if not (cur_cmd255)and(cur_cmd + help2("A one-character control sequence belongs after a ` mark.")@/ + ("So I'm essentially inserting \0 here."); + cur_val:="0"; back_error; + end +else @; +skip_mode:=true; +end +@z + +@x [26.455] l.9288 - pTeX: zw, zh: zenkaku width & height +if scan_keyword("em") then v:=(@) +@.em@> +else if scan_keyword("ex") then v:=(@) +@.ex@> +else goto not_found; +@y +if scan_keyword("em") then v:=(@) +@.em@> +else if scan_keyword("ex") then v:=(@) +@.ex@> +else if scan_keyword("zw") then @ +@.zw@> +else if scan_keyword("zh") then @ +@.zh@> +else goto not_found; +@z + +@x [26.458] l.9345 - pTeX: dimension unit: Q, H (1/4 mm) +else if scan_keyword("sp") then goto done +@.sp@> +@y +else if scan_keyword("H") then set_conversion(7227)(10160) +@.H@> +else if scan_keyword("Q") then set_conversion(7227)(10160) +@.Q@> +else if scan_keyword("sp") then goto done +@.sp@> +@z + +@x [26.459] pTeX: help message +help6("Dimensions can be in units of em, ex, in, pt, pc,")@/ + ("cm, mm, dd, cc, bp, or sp; but yours is a new one!")@/ +@y +help6("Dimensions can be in units of em, ex, zw, zh, in, pt, pc,")@/ + ("cm, mm, dd, cc, bp, H, Q, or sp; but yours is a new one!")@/ +@z + +@x [27.464] l.9475 - pTeX: str_toks + if t=" " then t:=space_token + else t:=other_token+t; +@y + if t>=@"100 then + begin t:=fromBUFFshort(str_pool, pool_ptr, k); incr(k); + end + else if t=" " then t:=space_token + else t:=other_token+t; +@z + +@x [27.468] l.9531 - pTeX: convert KANJI code +@d number_code=0 {command code for \.{\\number}} +@d roman_numeral_code=1 {command code for \.{\\romannumeral}} +@d string_code=2 {command code for \.{\\string}} +@d meaning_code=3 {command code for \.{\\meaning}} +@d font_name_code=4 {command code for \.{\\fontname}} +@d job_name_code=5 {command code for \.{\\jobname}} +@y +@d number_code=0 {command code for \.{\\number}} +@d roman_numeral_code=1 {command code for \.{\\romannumeral}} +@d kansuji_code=2 {command code for \.{\\kansuji}} +@d string_code=3 {command code for \.{\\string}} +@d meaning_code=4 {command code for \.{\\meaning}} +@d font_name_code=5 {command code for \.{\\fontname}} +@d euc_code=6 {command code for \.{\\euc}} +@d sjis_code=7 {command code for \.{\\sjis}} +@d jis_code=8 {command code for \.{\\jis}} +@d kuten_code=9 {command code for \.{\\kuten}} +@d ucs_code=10 {command code for \.{\\ucs}} +@d toucs_code=11 {command code for \.{\\toucs}} +@d tojis_code=12 {command code for \.{\\tojis}} +@d ptex_font_name_code=13 {command code for \.{\\ptexfontname}} +@d ptex_revision_code=14 {command code for \.{\\ptexrevision}} +@d ptex_convert_codes=15 {end of \pTeX's command codes} +@d job_name_code=ptex_convert_codes {command code for \.{\\jobname}} +@z + +@x [27.468] l.9547 - pTeX: +primitive("fontname",convert,font_name_code);@/ +@!@:font_name_}{\.{\\fontname} primitive@> +@y +primitive("fontname",convert,font_name_code);@/ +@!@:font_name_}{\.{\\fontname} primitive@> +primitive("kansuji",convert,kansuji_code); +@!@:kansuji_}{\.{\\kansuji} primitive@> +primitive("euc",convert,euc_code); +@!@:euc_}{\.{\\euc} primitive@> +primitive("sjis",convert,sjis_code); +@!@:sjis_}{\.{\\sjis} primitive@> +primitive("jis",convert,jis_code); +@!@:jis_}{\.{\\jis} primitive@> +primitive("kuten",convert,kuten_code); +@!@:kuten_}{\.{\\kuten} primitive@> +primitive("ucs",convert,ucs_code); +@!@:ucs_}{\.{\\ucs} primitive@> +primitive("toucs",convert,toucs_code); +@!@:toucs_}{\.{\\toucs} primitive@> +primitive("tojis",convert,tojis_code); +@!@:tojis_}{\.{\\tojis} primitive@> +primitive("ptexfontname",convert,ptex_font_name_code); +@!@:ptexfontname_}{\.{\\ptexfontname} primitive@> +primitive("ptexrevision",convert,ptex_revision_code); +@!@:ptexrevision_}{\.{\\ptexrevision} primitive@> +@z + +@x [27.469] l.9558 - pTeX: + font_name_code: print_esc("fontname"); +@y + font_name_code: print_esc("fontname"); + kansuji_code: print_esc("kansuji"); + euc_code:print_esc("euc"); + sjis_code:print_esc("sjis"); + jis_code:print_esc("jis"); + kuten_code:print_esc("kuten"); + ucs_code:print_esc("ucs"); + toucs_code:print_esc("toucs"); + tojis_code:print_esc("tojis"); + ptex_font_name_code: print_esc("ptexfontname"); + ptex_revision_code:print_esc("ptexrevision"); +@z + +@x [27.470] l.9566 - pTeX: convert KANJI code continue +@p procedure conv_toks; +var old_setting:0..max_selector; {holds |selector| setting} +@y +@p procedure conv_toks; +var old_setting:0..max_selector; {holds |selector| setting} +@!cx:KANJI_code; {temporary register for KANJI} +@z + +@x [27.471] l.9577 - pTeX: convert KANJI code continue +@ @= +case c of +number_code,roman_numeral_code: scan_int; +string_code, meaning_code: begin save_scanner_status:=scanner_status; + scanner_status:=normal; get_token; scanner_status:=save_scanner_status; + end; +@y +@ @= +KANJI(cx):=0; +case c of +number_code,roman_numeral_code, +kansuji_code,euc_code,sjis_code,jis_code,kuten_code, +ucs_code,toucs_code,tojis_code: scan_int; +ptex_font_name_code: scan_font_ident; +ptex_revision_code: do_nothing; +string_code, meaning_code: begin save_scanner_status:=scanner_status; + scanner_status:=normal; get_token; + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|} + KANJI(cx):=cur_tok; + scanner_status:=save_scanner_status; + end; +@z + +@x [27.471] l.9587 - pTeX: convert KANJI code continue +@ @= +case c of +number_code: print_int(cur_val); +roman_numeral_code: print_roman_int(cur_val); +string_code:if cur_cs<>0 then sprint_cs(cur_cs) + else print_char(cur_chr); +@y +@ @= +case c of +number_code: print_int(cur_val); +roman_numeral_code: print_roman_int(cur_val); +kansuji_code: print_kansuji(cur_val); +jis_code: begin cur_val:=fromJIS(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +euc_code: begin cur_val:=fromEUC(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +sjis_code: begin cur_val:=fromSJIS(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +kuten_code: begin cur_val:=fromKUTEN(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +ucs_code: begin cur_val:=fromUCS(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +toucs_code: begin cur_val:=toUCS(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +tojis_code: begin cur_val:=toJIS(cur_val); + if cur_val=0 then print_int(-1) else print_int(cur_val); end; +ptex_font_name_code: begin + print_font_name_and_size(cur_val); + print_font_dir_and_enc(cur_val); + end; +ptex_revision_code: print(pTeX_revision); +string_code:if cur_cs<>0 then sprint_cs(cur_cs) + else if KANJI(cx)=0 then print_char(cur_chr) + else print_kanji(cx); +@z + +@x [28.487] l.9852 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox +@d if_case_code=16 { `\.{\\ifcase}' } +@y +@d if_case_code=16 { `\.{\\ifcase}' } +@# +@d if_tdir_code=if_case_code+1 { `\.{\\iftdir}' } +@d if_ydir_code=if_tdir_code+1 { `\.{\\ifydir}' } +@d if_ddir_code=if_ydir_code+1 { `\.{\\ifddir}' } +@d if_mdir_code=if_ddir_code+1 { `\.{\\ifmdir}' } +@d if_tbox_code=if_mdir_code+1 { `\.{\\iftbox}' } +@d if_ybox_code=if_tbox_code+1 { `\.{\\ifybox}' } +@d if_dbox_code=if_ybox_code+1 { `\.{\\ifdbox}' } +@d if_mbox_code=if_dbox_code+1 { `\.{\\ifmbox}' } +@# +@d if_jfont_code=if_mbox_code+1 { `\.{\\ifjfont}' } +@d if_tfont_code=if_jfont_code+1 { `\.{\\iftfont}' } +@z + +@x [28.487] l.9887 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox +primitive("ifcase",if_test,if_case_code); +@!@:if_case_}{\.{\\ifcase} primitive@> +@y +primitive("ifcase",if_test,if_case_code); +@!@:if_case_}{\.{\\ifcase} primitive@> +primitive("iftdir",if_test,if_tdir_code); +@!@:if_tdir_}{\.{\\iftdir} primitive@> +primitive("ifydir",if_test,if_ydir_code); +@!@:if_ydir_}{\.{\\ifydir} primitive@> +primitive("ifddir",if_test,if_ddir_code); +@!@:if_ddir_}{\.{\\ifddir} primitive@> +primitive("ifmdir",if_test,if_mdir_code); +@!@:if_mdir_}{\.{\\ifmdir} primitive@> +primitive("iftbox",if_test,if_tbox_code); +@!@:if_tbox_}{\.{\\iftbox} primitive@> +primitive("ifybox",if_test,if_ybox_code); +@!@:if_ybox_}{\.{\\ifybox} primitive@> +primitive("ifdbox",if_test,if_dbox_code); +@!@:if_dbox_}{\.{\\ifdbox} primitive@> +primitive("ifmbox",if_test,if_mbox_code); +@!@:if_mbox_}{\.{\\ifmbox} primitive@> +primitive("ifjfont",if_test,if_jfont_code); +@!@:if_jfont_}{\.{\\ifjfont} primitive@> +primitive("iftfont",if_test,if_tfont_code); +@!@:if_tfont_}{\.{\\iftfont} primitive@> +@z + +@x [28.488] l.9907 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox + if_case_code:print_esc("ifcase"); +@y + if_case_code:print_esc("ifcase"); + if_tdir_code:print_esc("iftdir"); + if_ydir_code:print_esc("ifydir"); + if_ddir_code:print_esc("ifddir"); + if_mdir_code:print_esc("ifmdir"); + if_tbox_code:print_esc("iftbox"); + if_ybox_code:print_esc("ifybox"); + if_dbox_code:print_esc("ifdbox"); + if_mbox_code:print_esc("ifmbox"); + if_jfont_code:print_esc("ifjfont"); + if_tfont_code:print_esc("iftfont"); +@z + +@x [28.501] l.10073 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox +if_void_code, if_hbox_code, if_vbox_code: @; +@y +if_tdir_code: b:=(abs(direction)=dir_tate); +if_ydir_code: b:=(abs(direction)=dir_yoko); +if_ddir_code: b:=(abs(direction)=dir_dtou); +if_mdir_code: b:=(direction<0); +if_tbox_code, if_ybox_code, if_dbox_code, if_mbox_code, +if_void_code, if_hbox_code, if_vbox_code: @; +if_jfont_code, if_tfont_code: + begin scan_font_ident; + if this_if=if_jfont_code then b:=(font_dir[cur_val]=dir_yoko) + else if this_if=if_tfont_code then b:=(font_dir[cur_val]=dir_tate); + end; +@z + +@x [28.505] l.10118 - pTeX: Test box register status : iftbox, ifybox, ifdbox +if this_if=if_void_code then b:=(p=null) +else if p=null then b:=false +else if this_if=if_hbox_code then b:=(type(p)=hlist_node) +else b:=(type(p)=vlist_node); +@y +if this_if=if_void_code then b:=(p=null) +else if p=null then b:=false +else begin + if type(p)=dir_node then p:=list_ptr(p); + if this_if=if_hbox_code then b:=(type(p)=hlist_node) + else if this_if=if_vbox_code then b:=(type(p)=vlist_node) + else if this_if=if_tbox_code then b:=(abs(box_dir(p))=dir_tate) + else if this_if=if_ybox_code then b:=(abs(box_dir(p))=dir_yoko) + else if this_if=if_dbox_code then b:=(abs(box_dir(p))=dir_dtou) + else b:=(box_dir(p)<0); + end +@z + +@x [28.502] l.10138 - pTeX: if[cat] : Test character : KANJI character +if (cur_cmd>active_char)or(cur_chr>255) then {not a character} + begin m:=relax; n:=256; + end +else begin m:=cur_cmd; n:=cur_chr; + end; +get_x_token_or_active_char; +if (cur_cmd>active_char)or(cur_chr>255) then + begin cur_cmd:=relax; cur_chr:=256; + end; +@y +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + begin m:=cur_cmd; n:=cur_chr; + end +else if (cur_cmd>active_char)or(cur_chr>255) then + begin m:=relax; n:=max_cjk_val; + end +else begin m:=cur_cmd; n:=cur_chr; + end; +get_x_token_or_active_char; +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + begin cur_cmd:=cur_cmd; + end {dummy} +else if (cur_cmd>active_char)or(cur_chr>255) then + begin cur_cmd:=relax; cur_chr:=max_cjk_val; + end; +@z + +@x pTeX for Windows, treat filename with 0x5c +@p procedure begin_name; +begin area_delimiter:=0; ext_delimiter:=0; quoted_filename:=false; +end; +@y +@p procedure begin_name; +begin area_delimiter:=0; ext_delimiter:=0; quoted_filename:=false; prev_char:=0; +end; +@z + +@x pTeX for Windows, treat filename with 0x5c +else begin str_room(1); append_char(c); {contribute |c| to the current string} + if IS_DIR_SEP(c) then + begin area_delimiter:=cur_length; ext_delimiter:=0; + end + else if c="." then ext_delimiter:=cur_length; + more_name:=true; + end; +end; +@y +else begin str_room(1); append_char(c); {contribute |c| to the current string} + if (IS_DIR_SEP(c)and(not_kanji_char_seq(prev_char,c))) then + begin area_delimiter:=cur_length; ext_delimiter:=0; + end + else if c="." then ext_delimiter:=cur_length; + more_name:=true; + end; + prev_char:=c; +end; +@z + +@x [29.518] - print_quoted in pTeX is already defined +@d print_quoted(#) == {print string |#|, omitting quotes} +if #<>0 then + for j:=str_start[#] to str_start[#+1]-1 do + if so(str_pool[j])<>"""" then + print(so(str_pool[j])) + +@y +@z + +@x [29.519] +@d append_to_name(#)==begin c:=#; if not (c="""") then begin incr(k); + if k<=file_name_size then name_of_file[k]:=xchr[c]; + end end +@y +@d append_to_name_char(#)==begin incr(k); + if k<=file_name_size then name_of_file[k]:=xchr[#]; + end + +@d append_to_name_hex(#)==if (#)<10 then append_to_name_char((#)+"0") + else append_to_name_char((#)-10+"a") + +@d append_to_name(#)==begin c:=#; if not (c="""") then append_to_name_char(c); end + +@d append_to_name_escape(#)==begin + if (#)>=@"100 then begin + c:=(#)-@"100; + append_to_name_char(c); + end else begin + c:=#; + if (c>=@"80) and (not isinternalUPTEX) and isterminalUTF8 then begin + append_to_name_char("^"); + append_to_name_char("^"); + append_to_name_hex(c div 16); + append_to_name_hex(c mod 16); + end else + append_to_name_char(c); + end +end + +@d append_to_name_str_pool(#)==if not ((#)="""") then append_to_name_escape(#) +@z + +@x l.10389 +name_of_file:= xmalloc_array (ASCII_code, length(a)+length(n)+length(e)+1); +@y +name_of_file:= xmalloc_array (ASCII_code, (length(a)+length(n)+length(e))*4+1); +@z + +@x [29.519] pack_file_name +for j:=str_start[a] to str_start[a+1]-1 do append_to_name(so(str_pool[j])); +for j:=str_start[n] to str_start[n+1]-1 do append_to_name(so(str_pool[j])); +for j:=str_start[e] to str_start[e+1]-1 do append_to_name(so(str_pool[j])); +@y +for j:=str_start[a] to str_start[a+1]-1 do append_to_name_str_pool(so(str_pool[j])); +for j:=str_start[n] to str_start[n+1]-1 do append_to_name_str_pool(so(str_pool[j])); +for j:=str_start[e] to str_start[e+1]-1 do append_to_name_str_pool(so(str_pool[j])); +@z + +@x l.10444 +name_of_file := xmalloc_array (ASCII_code, n+(b-a+1)+format_ext_length+1); +@y +name_of_file := xmalloc_array (ASCII_code, (n+(b-a+1)+format_ext_length)*4+1); +@z + +@x [29.526] l.10668 - pTeX: scan file name +loop@+begin if (cur_cmd>other_char)or(cur_chr>255) then {not a character} + begin back_input; goto done; + end; + {If |cur_chr| is a space and we're not scanning a token list, check + whether we're at the end of the buffer. Otherwise we end up adding + spurious spaces to file names in some cases.} + if (cur_chr=" ") and (state<>token_list) and (loc>limit) then goto done; + if not more_name(cur_chr) then goto done; + get_x_token; + end; + end; +done: end_name; name_in_progress:=false; +@y +skip_mode:=false; +loop@+begin + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {is kanji} + begin str_room(2); + append_char(@"100+Hi(cur_chr)); {kanji upper byte} + append_char(@"100+Lo(cur_chr)); {kanji lower byte} + end + else if (cur_cmd>other_char)or(cur_chr>255) then {not an alphabet} + begin back_input; goto done; + end + {If |cur_chr| is a space and we're not scanning a token list, check + whether we're at the end of the buffer. Otherwise we end up adding + spurious spaces to file names in some cases.} + else if ((cur_chr=" ") and (state<>token_list) and (loc>limit)) or not more_name(cur_chr) then goto done; + get_x_token; + end; + end; +done: end_name; name_in_progress:=false; +skip_mode:=true; +@z + +@x [29.???] open_log_file +if buffer[l]=end_line_char then decr(l); +for k:=1 to l do print(buffer[k]); +print_ln; {now the transcript file contains the first line of input} +@y +if buffer[l]=end_line_char then decr(l); print_unread_buffer_with_ptenc(1,l+1); +print_ln; {now the transcript file contains the first line of input} +@z + +@x [29.536] l.10834 - pTeX: +begin +if src_specials_p or file_line_error_style_p or parse_first_line_p +then + wlog(banner_k) +else + wlog(banner); +@y +begin +if src_specials_p or file_line_error_style_p or parse_first_line_p +then + wlog(banner_k) +else + wlog(banner); + wlog(' ('); + wlog(conststringcast(get_enc_string)); + wlog(')'); +@z + +@x [29.???] pTeX - start_input +print_char("("); incr(open_parens); +slow_print(full_source_filename_stack[in_open]); update_terminal; +@y +print_char("("); incr(open_parens); +slow_print_filename(full_source_filename_stack[in_open]); update_terminal; +@z + +@x [30.560] l.10968 - pTeX: +This is called BigEndian order. +@!@^BigEndian order@> +@y +This is called BigEndian order. +@!@^BigEndian order@> + +We get \TeX\ knowledge about KANJI fonts from \.{JFM} files. +The \.{JFM} format holds more two 16-bit integers, |id| and |nt|, +at the top of the file. +$$\vbox{\halign{\hfil#&$\null=\null$#\hfil\cr +|id|&identification code of the file;\cr +|nt|&number of words in the |char_type| table;\cr}}$$ +The identification byte, |id| equals~11 or~9. When \TeX\ reads a font file, +the |id| equals~11 or~9 then the font is the \.{JFM}, othercases it is +the \.{TFM} file. The \.{TFM} holds |lf| at the same postion of |id|, +usually it takes a larger number than~9 or~11. +The |nt| is nonnegative and less than $2^{15}$. + +We must have |bc=0|, +$$\hbox{|lf=7+lh+nt+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np|.}$$ + +@d yoko_jfm_id=11 {for `yoko-kumi' fonts} +@d tate_jfm_id=9 {for `tate-kumi' fonts} +@z + +@x [30.544] l.11085 - pTeX: gk_tag +operation looks for both |list_tag| and |ext_tag|. +@y +operation looks for both |list_tag| and |ext_tag|. + +If the \.{JFM}, the |lig_tag| is called |gk_tag|. The |gk_tag| means that +this character has a glue/kerning program starting at position |remainder| +in the |glue_kern| array. And a \.{JFM} does not use |tag=2| and |tag=3|. +@z + +@x [30.544] l.11088 - pTeX: gk_tag +@d lig_tag=1 {character has a ligature/kerning program} +@y +@d lig_tag=1 {character has a ligature/kerning program} +@d gk_tag=1 {character has a glue/kerning program} +@z + +@x [30.549] l.11228 - pTeX: +@= +@!font_info: ^fmemory_word; +@y +@= +@!font_info: ^memory_word; {pTeX: use halfword for |char_type| table.} +@!font_dir: ^eight_bits; + {pTeX: direction of fonts, 0 is default, 1 is Yoko, 2 is Tate} +@!font_enc: ^eight_bits; + {pTeX: encoding of fonts, 0 is default, 1 is JIS, 2 is Unicode} +@!font_num_ext: ^integer; + {pTeX: number of the |char_type| table.} +@!jfm_enc: eight_bits; {pTeX: holds scanned result of encoding} +@z + +@x [30.550] l.11270 - pTeX: +@!char_base: ^integer; + {base addresses for |char_info|} +@y +@!char_base: ^integer; + {base addresses for |char_info|} +@!ctype_base: ^integer; + {pTeX: base addresses for KANJI character type parameters} +@z + +@x +@ @= +@y +@ @= +jfm_enc:=0; +@z + +@x [30.554] l.11373 - pTeX: +@d orig_char_info_end(#)==#].qqqq +@d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end +@y +@d orig_char_info_end(#)==#].qqqq +@d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end +@# +@d kchar_code_end(#)==#].hh.rh +@d kchar_code(#)==font_info[ctype_base[#]+kchar_code_end +@d kchar_type_end(#)==#].hh.lhfield +@d kchar_type(#)==font_info[ctype_base[#]+kchar_type_end +@z + +@x [30.557] l.11413 - pTeX: glue_kern_start +@d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program} +@d lig_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset +@d lig_kern_restart(#)==lig_kern_base[#]+lig_kern_restart_end +@y +@d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program} +@d lig_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset +@d lig_kern_restart(#)==lig_kern_base[#]+lig_kern_restart_end +@d glue_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of glue/kern program} +@d glue_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset +@d glue_kern_restart(#)==lig_kern_base[#]+glue_kern_restart_end +@z + +@x [30.560] l.11457 - pTeX: jfm_flag, jfm_id, nt, cx +var k:font_index; {index into |font_info|} +@y +var k:font_index; {index into |font_info|} +@!jfm_flag:dir_default..dir_tate; {direction of the \.{JFM}} +@!nt:halfword; {number of the |char_type| tables} +@!cx:KANJI_code; {kanji code} +@z + +@x +@d read_sixteen(#)==begin #:=fbyte; + if #>127 then abort; + fget; #:=#*@'400+fbyte; + end +@y +@d read_sixteen(#)==begin #:=fbyte; + if #>127 then abort; + fget; #:=#*@'400+fbyte; + end +@d read_twentyfourx(#)==begin #:=fbyte; + fget; #:=#*@"100+fbyte; + fget; #:=#+fbyte*@"10000; + end +@z + +@x [30.565] l.11548 - pTeX: read tfm size +@ @= +begin read_sixteen(lf); +fget; read_sixteen(lh); +fget; read_sixteen(bc); +fget; read_sixteen(ec); +if (bc>ec+1)or(ec>255) then abort; +if bc>255 then {|bc=256| and |ec=255|} + begin bc:=1; ec:=0; + end; +fget; read_sixteen(nw); +fget; read_sixteen(nh); +fget; read_sixteen(nd); +fget; read_sixteen(ni); +fget; read_sixteen(nl); +fget; read_sixteen(nk); +fget; read_sixteen(ne); +fget; read_sixteen(np); +if lf<>6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; +if (nw=0)or(nh=0)or(nd=0)or(ni=0) then abort; +end +@y +@ @= +begin read_sixteen(lf); +fget; read_sixteen(lh); +if lf=yoko_jfm_id then + begin jfm_flag:=dir_yoko; nt:=lh; + fget; read_sixteen(lf); + fget; read_sixteen(lh); + end +else if lf=tate_jfm_id then + begin jfm_flag:=dir_tate; nt:=lh; + fget; read_sixteen(lf); + fget; read_sixteen(lh); + end +else begin jfm_flag:=dir_default; nt:=0; + end; +fget; read_sixteen(bc); +fget; read_sixteen(ec); +if (bc>ec+1)or(ec>255) then abort; +if bc>255 then {|bc=256| and |ec=255|} + begin bc:=1; ec:=0; + end; +fget; read_sixteen(nw); +fget; read_sixteen(nh); +fget; read_sixteen(nd); +fget; read_sixteen(ni); +fget; read_sixteen(nl); +fget; read_sixteen(nk); +fget; read_sixteen(ne); +fget; read_sixteen(np); +if jfm_flag<>dir_default then + begin if lf<>7+lh+nt+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; + end +else + begin if lf<>6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; + end; +if (nw=0)or(nh=0)or(nd=0)or(ni=0) then abort; +end +@z + +@x [30.566] l.11574 - pTeX: set font_dir & font_num_ext +@= +lf:=lf-6-lh; {|lf| words should be loaded into |font_info|} +if np<7 then lf:=lf+7-np; {at least seven parameters will appear} +if (font_ptr=font_max)or(fmem_ptr+lf>font_mem_size) then + @; +f:=font_ptr+1; +char_base[f]:=fmem_ptr-bc; +width_base[f]:=char_base[f]+ec+1; +height_base[f]:=width_base[f]+nw; +depth_base[f]:=height_base[f]+nh; +italic_base[f]:=depth_base[f]+nd; +lig_kern_base[f]:=italic_base[f]+ni; +kern_base[f]:=lig_kern_base[f]+nl-kern_base_offset; +exten_base[f]:=kern_base[f]+kern_base_offset+nk; +param_base[f]:=exten_base[f]+ne +@y +@= +if jfm_flag<>dir_default then + lf:=lf-7-lh {If \.{JFM}, |lf| holds more two-16bit records than \.{TFM}} +else + lf:=lf-6-lh; {|lf| words should be loaded into |font_info|} +if np<7 then lf:=lf+7-np; {at least seven parameters will appear} +if (font_ptr=font_max)or(fmem_ptr+lf>font_mem_size) then + @; +f:=font_ptr+1; +font_dir[f]:=jfm_flag; +font_enc[f]:=jfm_enc; if jfm_flag=dir_default then font_enc[f]:=0; +font_num_ext[f]:=nt; +ctype_base[f]:=fmem_ptr; +char_base[f]:=ctype_base[f]+nt-bc; +width_base[f]:=char_base[f]+ec+1; +height_base[f]:=width_base[f]+nw; +depth_base[f]:=height_base[f]+nh; +italic_base[f]:=depth_base[f]+nd; +lig_kern_base[f]:=italic_base[f]+ni; +kern_base[f]:=lig_kern_base[f]+nl-kern_base_offset; +exten_base[f]:=kern_base[f]+kern_base_offset+nk; +param_base[f]:=exten_base[f]+ne; +@z + +@x [30.569] l.11619 - pTeX: read char_type +@ @= +for k:=fmem_ptr to width_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@y +@ @= +if jfm_flag<>dir_default then + for k:=ctype_base[f] to ctype_base[f]+nt-1 do + begin + fget; read_twentyfourx(cx); + if jfm_enc=2 then {Unicode TFM} + font_info[k].hh.rh:=toDVI(fromUCS(cx)) + else if jfm_enc=1 then {JIS-encoded TFM} + font_info[k].hh.rh:=toDVI(fromJIS(cx)) + else + font_info[k].hh.rh:=tokanji(cx); {|kchar_code|} + fget; cx:=fbyte; + font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|} + end; +for k:=char_base[f]+bc to width_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@z + +@x [30.570] l.11638 - pTeX: +@d current_character_being_worked_on==k+bc-fmem_ptr +@y +@d current_character_being_worked_on==k-char_base[f] +@z + +@x [30.573] l.11704 - pTeX: jfm + if a>128 then + begin if 256*c+d>=nl then abort; + if a=255 then if k=lig_kern_base[f] then bchar:=b; + end + else begin if b<>bchar then check_existence(b); + if c<128 then check_existence(d) {check ligature} + else if 256*(c-128)+d>=nk then abort; {check kern} + if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; + end; + end; +@y + if a>128 then + begin if 256*c+d>=nl then abort; + if a=255 then if k=lig_kern_base[f] then bchar:=b; + end + else begin if b<>bchar then check_existence(b); + if c<128 then begin + if jfm_flag<>dir_default then + begin if 256*c+d>=ne then abort; end {check glue} + else check_existence(d); {check ligature} + end + else if 256*(c-128)+d>=nk then abort; {check kern} + if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; + end; + end; +@z + +@x [30.574] l.11720 - pTeX: read jfm exten +for k:=exten_base[f] to param_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@y +if jfm_flag<>dir_default then + for k:=exten_base[f] to param_base[f]-1 do + store_scaled(font_info[k].sc) {NOTE: this area subst for glue program} +else for k:=exten_base[f] to param_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@z + +@x [30.576] l.11765 - pTeX: adjust ctype_base +adjust(char_base); adjust(width_base); adjust(lig_kern_base); +@y +adjust(ctype_base); +adjust(char_base); adjust(width_base); adjust(lig_kern_base); +@z + +@x [30.577] l.11778 - pTeX: jfont, tfont +if cur_cmd=def_font then f:=cur_font +@y +if cur_cmd=def_jfont then f:=cur_jfont +else if cur_cmd=def_tfont then f:=cur_tfont +else if cur_cmd=def_font then f:=cur_font +@z + +@x [30.581] +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +@y +@d print_lc_hex(#)==l:=#; + if l<10 then print_char(l+"0")@+else print_char(l-10+"a") + +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var @!l:0..255; {small indices or counters} +@z +@x [30.581] + print_ASCII(c); print(" in font "); +@y + if (c<" ")or(c>"~") then + begin print_char("^"); print_char("^"); + if c<64 then print_char(c+64) + else if c<128 then print_char(c-64) + else begin print_lc_hex(c div 16); print_lc_hex(c mod 16); end + end + else print_ASCII(c); + print(" in font "); +@z + +@x [30.???] +@ Here is a function that returns a pointer to a character node for a +@y +@ Another warning for (u)\pTeX. + +@p procedure char_warning_jis(@!f:internal_font_number;@!jc:KANJI_code); +begin if tracing_lost_chars>0 then + begin begin_diagnostic; + print_nl("Character "); print_kanji(jc); print(" ("); + print_hex(jc); print(") cannot be typeset in JIS-encoded JFM "); + slow_print(font_name[f]); + print_char(","); print_nl("so I use .notdef glyph instead."); + end_diagnostic(false); + end; +end; + +@ Here is a function that returns a pointer to a character node for a +@z + +@x [31.586] l.12189 - pTeX: define set2 +@d set1=128 {typeset a character and move right} +@y +@d set1=128 {typeset a character and move right} +@d set2=129 {typeset a character and move right} +@z +@x [31.586] l.12214 - pTeX: define dirchg +@d post_post=249 {postamble ending} +@y +@d post_post=249 {postamble ending} +@d dirchg=255 {direction change} +@z + +@x [31.587] l.12246 - pTeX: ex_id_byte +@d id_byte=2 {identifies the kind of \.{DVI} files described here} +@y +@d id_byte=2 {identifies the kind of \.{DVI} files described here} +@d ex_id_byte=3 {identifies the kind of extended \.{DVI} files} +@z + +@x [32.590] l.12329 - pTeX: ex_id_byte: This dvi is extended! +@ The last part of the postamble, following the |post_post| byte that +signifies the end of the font definitions, contains |q|, a pointer to the +|post| command that started the postamble. An identification byte, |i|, +comes next; this currently equals~2, as in the preamble. +@y +@ The last part of the postamble, following the |post_post| byte that +signifies the end of the font definitions, contains |q|, a pointer to the +|post| command that started the postamble. An identification byte, |i|, +comes next; this equals~2 or~3. If \pTeX\ primitives are not used then the +identification byte equals~2, othercase this is set to~3. +@z + +@x [32.592] l.12405 - pTeX: + {character and font in current |char_node|} +@!c:quarterword; +@!f:internal_font_number; +@y + {character and font in current |char_node|} +@!c:quarterword; +@!f:internal_font_number; +@!dir_used:boolean; {Is this dvi extended?} +@z + +@x [32.593] l.12414 - pTeX: dir_used: Is this dvi extended? +doing_leaders:=false; dead_cycles:=0; cur_s:=-1; +@y +doing_leaders:=false; dead_cycles:=0; cur_s:=-1; dir_used:=false; +@z + +@x [32.617] l.12846 - pTeX: Initialize dvi_dir as shipout begins +dvi_h:=0; dvi_v:=0; cur_h:=h_offset; dvi_f:=null_font; +@y +dvi_h:=0; dvi_v:=0; cur_h:=h_offset; dvi_f:=null_font; +dvi_dir:=dir_yoko; cur_dir_hv:=dvi_dir; +@z + +@x [32.619] l.12892 - pTeX: hlist_out Kanji, disp_node +procedure hlist_out; {output an |hlist_node| box} +label reswitch, move_past, fin_rule, next_p, continue, found; +var base_line: scaled; {the baseline coordinate for this box} +@y +procedure hlist_out; {output an |hlist_node| box} +label reswitch, move_past, fin_rule, next_p, continue, found; +var base_line: scaled; {the baseline coordinate for this box} +@!disp: scaled; {displacement} +@!save_dir:eight_bits; {what |dvi_dir| should pop to} +@!jc:KANJI_code; {temporary register for KANJI codes} +@!ksp_ptr:pointer; {position of |auto_spacing_glue| in the hlist} +@z +@x [32.619] l.12913 - pTeX: hlist_out Kanji, disp_node +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; base_line:=cur_v; left_edge:=cur_h; +@y +ksp_ptr:=space_ptr(this_box); +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; +synch_dir; +base_line:=cur_v; left_edge:=cur_h; disp:=0; +@z + +@x [32.622] l.12945 - pTeX: chain +@= +reswitch: if is_char_node(p) then + begin synch_h; synch_v; + repeat f:=font(p); c:=character(p); + if f<>dvi_f then @; + if font_ec[f]>=qo(c) then if font_bc[f]<=qo(c) then + if char_exists(orig_char_info(f)(c)) then {N.B.: not |char_info|} + begin if c>=qi(128) then dvi_out(set1); + dvi_out(qo(c));@/ + cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); + goto continue; + end; + if mltex_enabled_p then + @; +continue: + p:=link(p); + until not is_char_node(p); + dvi_h:=cur_h; + end +else @ +@y +@= +reswitch: if is_char_node(p) then + begin synch_h; synch_v; + chain:=false; + repeat f:=font(p); c:=character(p); + if f<>dvi_f then @; + if font_dir[f]=dir_default then + begin chain:=false; + if font_ec[f]>=qo(c) then if font_bc[f]<=qo(c) then + if char_exists(orig_char_info(f)(c)) then {N.B.: not |char_info|} + begin if c>=qi(128) then dvi_out(set1); + dvi_out(qo(c));@/ + cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); + goto continue; + end; + if mltex_enabled_p then + @; +continue: + end + else + begin if chain=false then chain:=true + else begin cur_h:=cur_h+width(ksp_ptr); + if g_sign<>normal then + begin if g_sign=stretching then + begin if stretch_order(ksp_ptr)=g_order then + cur_h:=cur_h+round(float(glue_set(this_box))*stretch(ksp_ptr)); +@^real multiplication@> + end + else + begin if shrink_order(ksp_ptr)=g_order then + cur_h:=cur_h-round(float(glue_set(this_box))*shrink(ksp_ptr)); +@^real multiplication@> + end; + end; + synch_h; + end; + p:=link(p); + jc:=KANJI(info(p)); + if font_enc[f]=2 then {Unicode TFM} + jc:=toUCS(jc) + else if font_enc[f]=1 then {JIS-encoded TFM} + begin if toJIS(jc)=0 then char_warning_jis(f,jc); + jc:=toJIS(jc); end + else + jc:=toDVI(jc); + dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc)); + cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); {not |jc|} + end; + dvi_h:=cur_h; p:=link(p); + until not is_char_node(p); + chain:=false; + end +else @ +@z + +@x [32.623] l.12982 - pTeX: disp_node, dir_node +@ @= +begin case type(p) of +hlist_node,vlist_node:@; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +whatsit_node: @; +@y +@ @= +begin case type(p) of +hlist_node,vlist_node,dir_node:@; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +whatsit_node: @; +disp_node: begin disp:=disp_dimen(p); cur_v:=base_line+disp; end; +@z + +@x [32.624] l.13000 - pTeX: output a box(and dir_node) with disp +@ @= +if list_ptr(p)=null then cur_h:=cur_h+width(p) +else begin save_h:=dvi_h; save_v:=dvi_v; + cur_v:=base_line+shift_amount(p); {shift the box down} +@y +@ @= +if list_ptr(p)=null then cur_h:=cur_h+width(p) +else begin save_h:=dvi_h; save_v:=dvi_v; save_dir:=dvi_dir; + cur_v:=base_line+disp+shift_amount(p); {shift the box down} +@z +@x [32.624] l.13005 - pTeX: output a box(and dir_node) with disp + if type(p)=vlist_node then vlist_out@+else hlist_out; + dvi_h:=save_h; dvi_v:=save_v; + cur_h:=edge+width(p); cur_v:=base_line; + end +@y + case type(p) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; + endcases; + dvi_h:=save_h; dvi_v:=save_v; dvi_dir:=save_dir; + cur_h:=edge+width(p); cur_v:=base_line+disp; cur_dir_hv:=save_dir; + end +@z + +@x [32.625] l.13010 - pTeX: Output a rule with disp +@ @= +if is_running(rule_ht) then rule_ht:=height(this_box); +if is_running(rule_dp) then rule_dp:=depth(this_box); +@y +@ @= +if is_running(rule_ht) then rule_ht:=height(this_box)+disp; +if is_running(rule_dp) then rule_dp:=depth(this_box)-disp; +@z + +@x [32.629] l.13103 - pTeX: Output a leader box(and dir_node) with disp +@= +begin cur_v:=base_line+shift_amount(leader_box); synch_v; save_v:=dvi_v;@/ +synch_h; save_h:=dvi_h; temp_ptr:=leader_box; +@y +@= +begin cur_v:=base_line+disp+shift_amount(leader_box); synch_v; save_v:=dvi_v;@/ +synch_h; save_h:=dvi_h; save_dir:=dvi_dir; temp_ptr:=leader_box; +@z +@x [32.629] l.13107 - pTeX: Output a leader box(and dir_node) with disp +if type(leader_box)=vlist_node then vlist_out@+else hlist_out; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; cur_v:=base_line; +cur_h:=save_h+leader_wd+lx; +end +@y +case type(leader_box) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; +endcases; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; dvi_dir:=save_dir; +cur_v:=base_line; cur_h:=save_h+leader_wd+lx; cur_dir_hv:=save_dir; +end +@z + +@x [32.630] l.13133 - pTeX: vlist_out +begin cur_g:=0; cur_glue:=float_constant(0); +this_box:=temp_ptr; g_order:=glue_order(this_box); +g_sign:=glue_sign(this_box); p:=list_ptr(this_box); +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; left_edge:=cur_h; cur_v:=cur_v-height(this_box); +@y +@!save_dir:integer; {what |dvi_dir| should pop to} +begin cur_g:=0; cur_glue:=float_constant(0); +this_box:=temp_ptr; g_order:=glue_order(this_box); +g_sign:=glue_sign(this_box); p:=list_ptr(this_box); +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; +synch_dir; +left_edge:=cur_h; cur_v:=cur_v-height(this_box); +@z + +@x [32.632] l.13155 - pTeX: output non-char-node +@ @= +begin case type(p) of +hlist_node,vlist_node:@; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +@y +@ @= +begin case type(p) of +hlist_node,vlist_node,dir_node: @; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +@z + +@x [32.633] l.13175 - pTeX: Output a box in a vlist +@= +if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) +else begin cur_v:=cur_v+height(p); synch_v; + save_h:=dvi_h; save_v:=dvi_v; +@y +@= +if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) +else begin cur_v:=cur_v+height(p); synch_v; + save_h:=dvi_h; save_v:=dvi_v; save_dir:=dvi_dir; +@z +@x [32.633] l.13181 - pTeX: Output a box in a vlist + if type(p)=vlist_node then vlist_out@+else hlist_out; + dvi_h:=save_h; dvi_v:=save_v; + cur_v:=save_v+depth(p); cur_h:=left_edge; + end +@y + case type(p) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; + endcases; + dvi_h:=save_h; dvi_v:=save_v; dvi_dir:=save_dir; + cur_v:=save_v+depth(p); cur_h:=left_edge; cur_dir_hv:=save_dir; + end +@z + +@x [32.637] l.13256 - pTeX: Output a leader in a vlist +@= +@y +@= +@z +@x [32.637] l.13258 - pTeX: Output a leader in a vlist +cur_v:=cur_v+height(leader_box); synch_v; save_v:=dvi_v; +temp_ptr:=leader_box; +outer_doing_leaders:=doing_leaders; doing_leaders:=true; +if type(leader_box)=vlist_node then vlist_out@+else hlist_out; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; cur_h:=left_edge; +cur_v:=save_v-height(leader_box)+leader_ht+lx; +end +@y +cur_v:=cur_v+height(leader_box); synch_v; save_v:=dvi_v; save_dir:=dvi_dir; +temp_ptr:=leader_box; +outer_doing_leaders:=doing_leaders; doing_leaders:=true; +case type(leader_box) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; +endcases; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; dvi_dir:=save_dir; +cur_h:=left_edge; cur_v:=save_v-height(leader_box)+leader_ht+lx; +cur_dir_hv:=save_dir; +end +@z + +@x [32.638] l.13270 - pTeX: ship out +@p procedure ship_out(@!p:pointer); {output the box |p|} +label done; +var page_loc:integer; {location of the current |bop|} +@y +@p procedure ship_out(@!p:pointer); {output the box |p|} +label done; +var page_loc:integer; {location of the current |bop|} +@!del_node:pointer; {used when delete the |dir_node| continued box} +@z +@x [32.640] l.13294 - pTeX: ship out +@; +@y +if type(p)=dir_node then + begin del_node:=p; p:=list_ptr(p); + delete_glue_ref(space_ptr(del_node)); + delete_glue_ref(xspace_ptr(del_node)); + free_node(del_node,box_node_size); + end; +flush_node_list(link(p)); link(p):=null; +if abs(box_dir(p))<>dir_yoko then p:=new_dir_node(p,dir_yoko); +@; +@z + +@x [32.641] l.13327 - pTeX: dir_node +if type(p)=vlist_node then vlist_out@+else hlist_out; +@y +case type(p) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; +endcases; +@z + +@x [33.642] l.13394 - pTeX: postamble's id_byte + @; + dvi_out(post_post); dvi_four(last_bop); dvi_out(id_byte);@/ +@y + @; + dvi_out(post_post); dvi_four(last_bop); + if dir_used then dvi_out(ex_id_byte) else dvi_out(id_byte);@/ +@z + +@x [33.647] l.13515 - pTeX: cur_kanji_skip, cur_xkanji_skip, last_disp +@ If the global variable |adjust_tail| is non-null, the |hpack| routine +also removes all occurrences of |ins_node|, |mark_node|, and |adjust_node| +items and appends the resulting material onto the list that ends at +location |adjust_tail|. + +@= +@!adjust_tail:pointer; {tail of adjustment list} +@y +@ If the global variable |adjust_tail| is non-null, the |hpack| routine +also removes all occurrences of |ins_node|, |mark_node|, and |adjust_node| +items and appends the resulting material onto the list that ends at +location |adjust_tail|. + +@= +@!adjust_tail:pointer; {tail of adjustment list} +@!last_disp:scaled; {displacement at end of list} +@!cur_kanji_skip:pointer; +@!cur_xkanji_skip:pointer; +@z + +@x [33.648] l.13518 - pTeX: cur_kanji_skip, cur_xkanji_skip +@ @=adjust_tail:=null; last_badness:=0; +@y +@ @=adjust_tail:=null; last_badness:=0; + cur_kanji_skip:=zero_glue; cur_xkanji_skip:=zero_glue; +{ koko + |incr(glue_ref_count(cur_kanji_skip));| + |incr(glue_ref_count(cur_xkanji_skip));| +} +@z + +@x [33.649] l.13522 - pTeX: hpack +@p function hpack(@!p:pointer;@!w:scaled;@!m:small_number):pointer; +label reswitch, common_ending, exit; +var r:pointer; {the box node that will be returned} +@y +@p function hpack(@!p:pointer;@!w:scaled;@!m:small_number):pointer; +label reswitch, common_ending, exit; +var r:pointer; {the box node that will be returned} +@!k:pointer; {points to a |kanji_space| specification} +@!disp:scaled; {displacement} +@z + +@x [33.649] l.13535 - pTeX: hpack +q:=r+list_offset; link(q):=p;@/ +h:=0; @; +@y +set_box_dir(r)(dir_default); +space_ptr(r):=cur_kanji_skip; xspace_ptr(r):=cur_xkanji_skip; +add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); +k:=cur_kanji_skip; +q:=r+list_offset; link(q):=p;@/ +h:=0; @; +disp:=0; +@z +@x [33.649] l.13537 - pTeX: hpack +while p<>null do @; +if adjust_tail<>null then link(adjust_tail):=null; +height(r):=h; depth(r):=d;@/ +@; +common_ending: @; +exit: hpack:=r; +end; +@y +while p<>null do @; +if adjust_tail<>null then link(adjust_tail):=null; +height(r):=h; depth(r):=d;@/ +@; +common_ending: + @; +exit: last_disp:=disp; hpack:=r; +end; +@z + +@x [33.651] l.13556 - pTeX: dir_node, disp_node, reset chain +@ @= +@^inner loop@> +begin reswitch: while is_char_node(p) do + @; +if p<>null then + begin case type(p) of + hlist_node,vlist_node,rule_node,unset_node: + @; + ins_node,mark_node,adjust_node: if adjust_tail<>null then + @; + whatsit_node:@; +@y +@ @= +@^inner loop@> +begin reswitch: chain:=false; +while is_char_node(p) do + @; +if p<>null then + begin case type(p) of + hlist_node,vlist_node,dir_node,rule_node,unset_node: + @; + ins_node,mark_node,adjust_node: if adjust_tail<>null then + @; + whatsit_node:@; + disp_node:disp:=disp_dimen(p); +@z + +@x [33.653] l.13589 - pTeX: displacement +@= +begin x:=x+width(p); +if type(p)>=rule_node then s:=0 @+else s:=shift_amount(p); +if height(p)-s>h then h:=height(p)-s; +if depth(p)+s>d then d:=depth(p)+s; +end +@y +@= +begin x:=x+width(p); +if type(p)>=rule_node then s:=disp @+else s:=shift_amount(p)+disp; +if height(p)-s>h then h:=height(p)-s; +if depth(p)+s>d then d:=depth(p)+s; +end +@z + +@x [33.654] l.13601 - pTeX: auto spacing, displacement +@= +begin f:=font(p); i:=char_info(f)(character(p)); hd:=height_depth(i); +x:=x+char_width(f)(i);@/ +s:=char_height(f)(hd);@+if s>h then h:=s; +s:=char_depth(f)(hd);@+if s>d then d:=s; +p:=link(p); +end +@y +@= +begin f:=font(p); i:=char_info(f)(character(p)); hd:=height_depth(i); +x:=x+char_width(f)(i);@/ +s:=char_height(f)(hd)-disp; if s>h then h:=s; +s:=char_depth(f)(hd)+disp; if s>d then d:=s; +if font_dir[f]<>dir_default then + begin p:=link(p); + if chain then + begin x:=x+width(k);@/ + o:=stretch_order(k); total_stretch[o]:=total_stretch[o]+stretch(k); + o:=shrink_order(k); total_shrink[o]:=total_shrink[o]+shrink(k); + end + else chain:=true; + end +else chain:=false; +p:=link(p); +end +@z + +@x [33.668] l.13779 - pTeX: vpackage +begin last_badness:=0; r:=get_node(box_node_size); type(r):=vlist_node; +subtype(r):=min_quarterword; shift_amount(r):=0; +@y +begin last_badness:=0; r:=get_node(box_node_size); type(r):=vlist_node; +subtype(r):=min_quarterword; shift_amount(r):=0; set_box_dir(r)(dir_default); +space_ptr(r):=zero_glue; xspace_ptr(r):=zero_glue; +add_glue_ref(zero_glue); add_glue_ref(zero_glue); +@z + +@x [33.669] l.13797 - pTeX: dir_node +@ @= +begin if is_char_node(p) then confusion("vpack") +@:this can't happen vpack}{\quad vpack@> +else case type(p) of + hlist_node,vlist_node,rule_node,unset_node: + @; +@y +@ @= +begin if is_char_node(p) then confusion("vpack") +@:this can't happen vpack}{\quad vpack@> +else case type(p) of + hlist_node,vlist_node,dir_node,rule_node,unset_node: + @; +@z + +@x [34.681] l.14026 - pTeX: math noad +@d noad_size=4 {number of words in a normal noad} +@d nucleus(#)==#+1 {the |nucleus| field of a noad} +@d supscr(#)==#+2 {the |supscr| field of a noad} +@d subscr(#)==#+3 {the |subscr| field of a noad} +@y +\yskip\hang In Japanese, |math_type(q)=math_jchar| means that |fam(q)| +refers to one of the sixteen kanji font families, and |KANJI(q)| is the +internal kanji code number. +@^Japanese extentions@> + +@d noad_size=5 {number of words in a normal noad} +@d nucleus(#)==#+1 {the |nucleus| field of a noad} +@d supscr(#)==#+2 {the |supscr| field of a noad} +@d subscr(#)==#+3 {the |subscr| field of a noad} +@d kcode_noad(#)==#+4 +@d math_kcode(#)==info(#+4) {the |kanji character| field of a noad} +@d kcode_noad_nucleus(#)==#+3 +@d math_kcode_nucleus(#)==info(#+3) + {the |kanji character| field offset from nucleus} +@# +@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} +@d radical_noad=inner_noad+1 {|type| of a noad for square roots} +@d radical_noad_size=5 {number of |mem| words in a radical noad} +@y +@d left_delimiter(#)==#+5 {first delimiter field of a noad} +@d right_delimiter(#)==#+4 {second delimiter field of a fraction noad} +@d radical_noad=inner_noad+1 {|type| of a noad for square roots} +@d radical_noad_size=6 {number of |mem| words in a radical noad} +@z + +@x [34.686] l.14129 - pTeX: new_noad +mem[supscr(p)].hh:=empty_field; +new_noad:=p; +@y +mem[supscr(p)].hh:=empty_field; +mem[kcode_noad(p)].hh:=empty_field; +new_noad:=p; +@z + +@x [34.687] accent with japanese char +@d accent_noad_size=5 {number of |mem| words in an accent noad} +@d accent_chr(#)==#+4 {the |accent_chr| field of an accent noad} +@y +@d accent_noad_size=6 {number of |mem| words in an accent noad} +@d accent_chr(#)==#+5 {the |accent_chr| field of an accent noad} +@z + +@x [34.691] l.14236 - pTeX: print_fam_and_char +procedure print_fam_and_char(@!p:pointer); {prints family and character} +begin print_esc("fam"); print_int(fam(p)); print_char(" "); +print_ASCII(qo(character(p))); +@y +procedure print_fam_and_char(@!p:pointer;@!t:small_number); + {prints family and character} +var @!cx:KANJI_code; {temporary register for KANJI} +begin print_esc("fam"); print_int(fam(p)); print_char(" "); +if t=math_char then print_ASCII(qo(character(p))) +else begin KANJI(cx):=math_kcode_nucleus(p); print_kanji(cx); + end; +@z + +@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 +accent_noad: begin print_esc("accent"); print_fam_and_char(accent_chr(p)); +@y +accent_noad: begin print_esc("accent"); + print_fam_and_char(accent_chr(p),math_char); +@z + +@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 + flush_node_list(info(supscr(p))); + if math_type(subscr(p))>=sub_box then + flush_node_list(info(subscr(p))); +@y + begin if (math_type(nucleus(p))>=sub_box) + and (math_type(nucleus(p))<>math_jchar) + and (math_type(nucleus(p))<>math_text_jchar) then + flush_node_list(info(nucleus(p))); + if math_type(supscr(p))>=sub_box + and (math_type(supscr(p))<>math_jchar) + and (math_type(supscr(p))<>math_text_jchar) then + flush_node_list(info(supscr(p))); + if math_type(subscr(p))>=sub_box + and (math_type(subscr(p))<>math_jchar) + and (math_type(subscr(p))<>math_text_jchar) then + flush_node_list(info(subscr(p))); +@z + +@x [35.715] l.14687 - pTeX: rebox + begin if type(b)=vlist_node then b:=hpack(b,natural); + p:=list_ptr(b); + if (is_char_node(p))and(link(p)=null) then + begin f:=font(p); v:=char_width(f)(char_info(f)(character(p))); + if v<>width(b) then link(p):=new_kern(width(b)-v); + end; +@y + begin if type(b)<>hlist_node then b:=hpack(b,natural); + p:=list_ptr(b); + if is_char_node(p) then + if font_dir[font(p)]<>dir_default then + begin if link(link(p))=null then + begin f:=font(p); v:=char_width(f)(orig_char_info(f)(character(p))); + if v<>width(b) then link(link(p)):=new_kern(width(b)-v); + end + end + else if link(p)=null then + begin f:=font(p); v:=char_width(f)(orig_char_info(f)(character(p))); + if v<>width(b) then link(p):=new_kern(width(b)-v); + end; + delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); +@z + +@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 abs(direction)=abs(box_dir(info(q))) then begin + if abs(direction)=dir_tate then begin + if box_dir(info(q))=dir_tate then d:=t_baseline_shift + else d:=y_baseline_shift end + else d:=y_baseline_shift; + if cur_styledir_default then q:=link(q); + r:=link(q); +@z + +@x [36.722] l.14833 - pTeX: fetch +else begin if (qo(cur_c)>=font_bc[cur_f])and(qo(cur_c)<=font_ec[cur_f]) then + cur_i:=orig_char_info(cur_f)(cur_c) + else cur_i:=null_character; + if not(char_exists(cur_i)) then + begin char_warning(cur_f,qo(cur_c)); + math_type(a):=empty; cur_i:=null_character; + end; + end; +@y +else begin if font_dir[cur_f]<>dir_default then + cur_c:=qi(get_jfm_pos(KANJI(math_kcode_nucleus(a)),cur_f)); + if (qo(cur_c)>=font_bc[cur_f])and(qo(cur_c)<=font_ec[cur_f]) then + cur_i:=orig_char_info(cur_f)(cur_c) + else cur_i:=null_character; + if not(char_exists(cur_i)) then + begin char_warning(cur_f,qo(cur_c)); + math_type(a):=empty; cur_i:=null_character; + end; + end; +@z + +@x [36.726] l.14892 - pTeX: mlist_to_hlist +var mlist:pointer; {beginning of the given list} +@!penalties:boolean; {should penalty nodes be inserted?} +@!style:small_number; {the given style} +@y +var mlist:pointer; {beginning of the given list} +@!penalties:boolean; {should penalty nodes be inserted?} +@!style:small_number; {the given style} +@!u:pointer; {temporary register} +@z + +@x [36.726] l.14913 - pTeX: mlist_to_hlist +@; +end; +@y +@; +p:=new_null_box; link(p):=link(temp_head); +adjust_hlist(p,false); link(temp_head):=link(p); +delete_glue_ref(space_ptr(p)); delete_glue_ref(xspace_ptr(p)); +free_node(p,box_node_size); +end; +@z + +@x [36.727] l.14928 - pTeX: free box +free_node(z,box_node_size); +@y +delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); +free_node(z,box_node_size); +@z + +@x [36.730] l.14976 - pTeX: free box: disp_node +kern_node: begin math_kern(q,cur_mu); goto done_with_node; + end; +@y +kern_node: begin math_kern(q,cur_mu); goto done_with_node; + end; +disp_node: goto done_with_node; +@z + +@x [36.734] l.15046 - pTeX: make_over:clean_box + overbar(clean_box(nucleus(q),cramped_style(cur_style)),@| +@y + overbar(clean_box(nucleus(q),cramped_style(cur_style),math_kcode(q)),@| +@z + +@x [36.735] l.15055 - pTeX: make_under:clean_box +begin x:=clean_box(nucleus(q),cur_style); +@y +begin x:=clean_box(nucleus(q),cur_style,math_kcode(q)); +@z + +@x [36.736] l.15069 - pTeX: make_under:clean_box +if type(v)<>vlist_node then confusion("vcenter"); +@y +if type(v)=dir_node then + begin if type(list_ptr(v))<>vlist_node then confusion("dircenter") + end +else begin if type(v)<>vlist_node then confusion("vcenter") + end; +@z + +@x [36.737] l.15089 - pTeX: make_radical:clean_box +begin x:=clean_box(nucleus(q),cramped_style(cur_style)); +@y +begin x:=clean_box(nucleus(q),cramped_style(cur_style),math_kcode(q)); +@z + +@x [36.738] l.15123 - pTeX: make_math_accent:clean_box + x:=clean_box(nucleus(q),cramped_style(cur_style)); w:=width(x); h:=height(x); +@y + x:=clean_box(nucleus(q),cramped_style(cur_style),math_kcode(q)); + w:=width(x); h:=height(x); +@z + +@x [36.742] l.15186 - pTeX: make_math_accent:clean_box +x:=clean_box(nucleus(q),cur_style); delta:=delta+height(x)-h; h:=height(x); +@y +x:=clean_box(nucleus(q),cur_style,math_kcode(q)); +delta:=delta+height(x)-h; h:=height(x); +@z + +@x [36.744] l.15211 - pTeX: make_fraction:clean_box +x:=clean_box(numerator(q),num_style(cur_style)); +z:=clean_box(denominator(q),denom_style(cur_style)); +@y +x:=clean_box(numerator(q),num_style(cur_style),math_kcode(q)); +z:=clean_box(denominator(q),denom_style(cur_style),math_kcode(q)); +@z + +@x [36.749] l.15304 - pTeX: make_op:clean_box + delta:=char_italic(cur_f)(cur_i); x:=clean_box(nucleus(q),cur_style); +@y + delta:=char_italic(cur_f)(cur_i); + x:=clean_box(nucleus(q),cur_style,math_kcode(q)); +@z + +@x [36.750] l.15321 - pTeX: make_op:clean_box +begin x:=clean_box(supscr(q),sup_style(cur_style)); +y:=clean_box(nucleus(q),cur_style); +z:=clean_box(subscr(q),sub_style(cur_style)); +@y +begin x:=clean_box(supscr(q),sup_style(cur_style),math_kcode(q)); +y:=clean_box(nucleus(q),cur_style,math_kcode(q)); +z:=clean_box(subscr(q),sub_style(cur_style),math_kcode(q)); +@z + +@x [36.751] l.15342 - pTeX: free box node + begin free_node(x,box_node_size); list_ptr(v):=y; + end +@y + begin + delete_glue_ref(space_ptr(x)); delete_glue_ref(xspace_ptr(x)); + free_node(x,box_node_size); list_ptr(v):=y; + end +@z + +@x [36.751] l.15350 - pTeX: free box node +if math_type(subscr(q))=empty then free_node(z,box_node_size) +@y +if math_type(subscr(q))=empty then begin + delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); + free_node(z,box_node_size) +end +@z + +@x [36.752] l.15369 - pTeX: make_ord +procedure make_ord(@!q:pointer); +label restart,exit; +var a:integer; {address of lig/kern instruction} +@!p,@!r:pointer; {temporary registers for list manipulation} +begin restart:@t@>@;@/ +if math_type(subscr(q))=empty then if math_type(supscr(q))=empty then + if math_type(nucleus(q))=math_char then + begin p:=link(q); + if p<>null then if (type(p)>=ord_noad)and(type(p)<=punct_noad) then + if math_type(nucleus(p))=math_char then + if fam(nucleus(p))=fam(nucleus(q)) then + begin math_type(nucleus(q)):=math_text_char; + fetch(nucleus(q)); + if char_tag(cur_i)=lig_tag then + begin a:=lig_kern_start(cur_f)(cur_i); + cur_c:=character(nucleus(p)); + cur_i:=font_info[a].qqqq; + if skip_byte(cur_i)>stop_flag then + begin a:=lig_kern_restart(cur_f)(cur_i); + cur_i:=font_info[a].qqqq; + end; + loop@+ begin @; + if skip_byte(cur_i)>=stop_flag then return; + a:=a+qo(skip_byte(cur_i))+1; + cur_i:=font_info[a].qqqq; + end; + end; + end; + end; +exit:end; +@y +procedure make_ord(@!q:pointer); +label restart,exit; +var a:integer; {address of lig/kern instruction} +@!gp,@!gq,@!p,@!r:pointer; {temporary registers for list manipulation} +@!rr:halfword; +begin restart:@t@>@;@/ +if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty)and@| +((math_type(nucleus(q))=math_char)or(math_type(nucleus(q))=math_jchar)) then + begin p:=link(q); + if p<>null then if (type(p)>=ord_noad)and(type(p)<=punct_noad) then + if fam(nucleus(p))=fam(nucleus(q)) then + if math_type(nucleus(p))=math_char then + begin math_type(nucleus(q)):=math_text_char; + fetch(nucleus(q)); + if char_tag(cur_i)=lig_tag then + begin a:=lig_kern_start(cur_f)(cur_i); + cur_c:=character(nucleus(p)); + cur_i:=font_info[a].qqqq; + if skip_byte(cur_i)>stop_flag then + begin a:=lig_kern_restart(cur_f)(cur_i); + cur_i:=font_info[a].qqqq; + end; + loop@+ begin @; + if skip_byte(cur_i)>=stop_flag then return; + a:=a+qo(skip_byte(cur_i))+1; + cur_i:=font_info[a].qqqq; + end; + end; + end + else if math_type(nucleus(p))=math_jchar then + begin math_type(nucleus(q)):=math_text_jchar; + fetch(nucleus(p)); a:=cur_c; fetch(nucleus(q)); + if char_tag(cur_i)=gk_tag then + begin cur_c:=a; a:=glue_kern_start(cur_f)(cur_i); + {|cur_c|:=qi(|get_jfm_pos|(|math_kcode|(p), + |fam_fnt|(fam(nucleus(p))+|cur_size|)));} + cur_i:=font_info[a].qqqq; + if skip_byte(cur_i)>stop_flag then {huge glue/kern table rearranged} + begin a:=glue_kern_restart(cur_f)(cur_i); + cur_i:=font_info[a].qqqq; + end; + loop@+ begin + if next_char(cur_i)=cur_c then if skip_byte(cur_i)<=stop_flag then + if op_byte(cur_i)null then begin + while((type(gp)<>rr)and(link(gp)<>null)) do begin gp:=link(gp); + end; + gq:=glue_ptr(gp); + end + else begin gp:=get_node(small_node_size); + font_glue[cur_f]:=gp; gq:=null; + end; + if gq=null then + begin type(gp):=rr; gq:=new_spec(zero_glue); glue_ptr(gp):=gq; + a:=exten_base[cur_f]+qi((qo(rr))*3); width(gq):=font_info[a].sc; + stretch(gq):=font_info[a+1].sc; shrink(gq):=font_info[a+2].sc; + add_glue_ref(gq); link(gp):=get_node(small_node_size); + gp:=link(gp); glue_ptr(gp):=null; link(gp):=null; + end; + p:=new_glue(gq); subtype(p):=jfm_skip+1; + link(p):=link(q); link(q):=p; return; + end + else begin p:=new_kern(char_kern(cur_f)(cur_i)); + link(p):=link(q); link(q):=p; return; + end; + if skip_byte(cur_i)>=stop_flag then return; + a:=a+qo(skip_byte(cur_i))+1; {SKIP property} + cur_i:=font_info[a].qqqq; + end; + end; + end; + end; +exit:end; +@z + +@x [36.754] l.15452 - pTeX: +math_char, math_text_char: +@y +math_char, math_text_char, math_jchar, math_text_jchar: +@z + +@x [36.754] pTeX: +sub_box: p:=info(nucleus(q)); +@y +sub_box: p:=info(nucleus(q)); +sub_exp_box: p:=shift_sub_exp_box(nucleus(q)); +@z + +@x [36.755] l.15475 - pTeX: convert math text to KANJI char_node + begin delta:=char_italic(cur_f)(cur_i); p:=new_character(cur_f,qo(cur_c)); + if (math_type(nucleus(q))=math_text_char)and(space(cur_f)<>0) then + delta:=0; {no italic correction in mid-word of text font} + if (math_type(subscr(q))=empty)and(delta<>0) then + begin link(p):=new_kern(delta); delta:=0; +@y + begin delta:=char_italic(cur_f)(cur_i); p:=new_character(cur_f,qo(cur_c)); + u:=p; + if font_dir[cur_f]<>dir_default then begin + link(u):=get_avail; u:=link(u); info(u):=math_kcode(q); + end; + if ((math_type(nucleus(q))=math_text_char)or + (math_type(nucleus(q))=math_text_jchar))and(space(cur_f)<>0) then + delta:=0; {no italic correction in mid-word of text font} + if (math_type(subscr(q))=empty)and(delta<>0) then begin + link(u):=new_kern(delta); delta:=0; +@z + +@x [36.756] l.15505 - pTeX: free box + shift_down:=depth(z)+sub_drop(t); + free_node(z,box_node_size); + end; +@y + shift_down:=depth(z)+sub_drop(t); + delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); + free_node(z,box_node_size); + end; +@z + +@x [36.757] l.15526 - pTeX: make_scripts:clean_box +begin x:=clean_box(subscr(q),sub_style(cur_style)); +@y +begin x:=clean_box(subscr(q),sub_style(cur_style),math_kcode(q)); +@z + +@x [36.758] l.15538 - pTeX: make_scripts:clean_box +begin x:=clean_box(supscr(q),sup_style(cur_style)); +@y +begin x:=clean_box(supscr(q),sup_style(cur_style),math_kcode(q)); +@z + +@x [36.758] l.15555 - pTeX: make_scripts:clean_box +begin y:=clean_box(subscr(q),sub_style(cur_style)); +@y +begin y:=clean_box(subscr(q),sub_style(cur_style),math_kcode(q)); +@z + +@x [36.760] l.15616 - pTeX: disp_node +othercases confusion("mlist3") +@y +disp_node: begin link(p):=q; p:=q; q:=link(q); link(p):=null; goto done; + end; +othercases confusion("mlist3") +@z + +@x [37.???] init_span: pTeX: init inhibit_glue_flag +if mode=-hmode then space_factor:=1000 +else begin prev_depth:=ignore_depth; normal_paragraph; + end; +@y +if mode=-hmode then space_factor:=1000 +else begin prev_depth:=ignore_depth; normal_paragraph; + end; +inhibit_glue_flag:=false; +@z + +@x [37.796] l.16276 - pTeX: call adjust_hlist + begin adjust_tail:=cur_tail; u:=hpack(link(head),natural); w:=width(u); +@y + begin adjust_tail:=cur_tail; adjust_hlist(head,false); + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head); + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + u:=hpack(link(head),natural); w:=width(u); +@z + +@x [37.???] l.????? - increased max_quarterword +if n>max_quarterword then confusion("256 spans"); {this can happen, but won't} +@^system dependencies@> +@:this can't happen 256 spans}{\quad 256 spans@> +@y +if n>max_quarterword then confusion("too many spans"); + {this can happen, but won't} +@^system dependencies@> +@:this can't happen too many spans}{\quad too many spans@> +@z + +@x [37.799] l.16331 - fin_row: pTeX: call adjust_hlist + begin p:=hpack(link(head),natural); +@y + begin adjust_hlist(head,false); + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head); + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + p:=hpack(link(head),natural); +@z + +@x [37.799] l.16331 - fin_row: init inhibit_glue_flag + link(tail):=p; tail:=p; space_factor:=1000; +@y + link(tail):=p; tail:=p; space_factor:=1000; + inhibit_glue_flag:=false; +@z + +@x [37.800] l.16353 - pTeX: call adjust_hlist +var @!p,@!q,@!r,@!s,@!u,@!v: pointer; {registers for the list operations} +@y +var @!p,@!q,@!r,@!s,@!u,@!v,@!z: pointer; {registers for the list operations} +@z + +@x [37.804] l.16456 - pTeX: call adjust_hlist + p:=hpack(preamble,saved(1),saved(0)); overfull_rule:=rule_save; +@y + z:=new_null_box; link(z):=preamble; + adjust_hlist(z,false); + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=space_ptr(z); cur_xkanji_skip:=xspace_ptr(z); + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + p:=hpack(preamble,saved(1),saved(0)); overfull_rule:=rule_save; + delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); + free_node(z,box_node_size); +@z + +@x [37.807] l.16499 - pTeX: unset box -> BOX +glue_order(q):=glue_order(p); glue_sign(q):=glue_sign(p); +glue_set(q):=glue_set(p); shift_amount(q):=o; +r:=link(list_ptr(q)); s:=link(list_ptr(p)); +@y +set_box_dir(q)(direction); +glue_order(q):=glue_order(p); glue_sign(q):=glue_sign(p); +glue_set(q):=glue_set(p); shift_amount(q):=o; +r:=link(list_ptr(q)); s:=link(list_ptr(p)); +@z + +@x [37.809] l.16541 - pTeX: unset box -> BOX +s:=link(s); link(u):=new_null_box; u:=link(u); t:=t+width(s); +if mode=-vmode then width(u):=width(s)@+else + begin type(u):=vlist_node; height(u):=width(s); + end +@y +s:=link(s); link(u):=new_null_box; u:=link(u); t:=t+width(s); +if mode=-vmode then width(u):=width(s)@+else + begin type(u):=vlist_node; height(u):=width(s); + end; +set_box_dir(u)(direction) +@z + +@x [37.810] l.16564 - pTeX: unset box -> BOX +width(r):=w; type(r):=hlist_node; +end +@y +width(r):=w; type(r):=hlist_node; +set_box_dir(r)(direction); +end +@z + +@x [37.811] l.16585 - pTeX: unset box -> BOX +height(r):=w; type(r):=vlist_node; +@y +height(r):=w; type(r):=vlist_node; +set_box_dir(r)(direction); +@z + +@x [38.816] l.16687 - pTeX: init chain, delete disp_node +link(temp_head):=link(head); +if is_char_node(tail) then tail_append(new_penalty(inf_penalty)) +else if type(tail)<>glue_node then tail_append(new_penalty(inf_penalty)) +@y +first_use:=true; chain:=false; +delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); +cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head); +add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); +if not is_char_node(tail)and(type(tail)=disp_node) then + begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null + end; +link(temp_head):=link(head); +if is_char_node(tail) then tail_append(new_penalty(inf_penalty)) +else if type(tail)<>glue_node then tail_append(new_penalty(inf_penalty)) +@z + +@x [38.828] l.16946 - pTeX: Global variable |chain| +@!cur_p:pointer; {the current breakpoint under consideration} +@y +@!cur_p:pointer; {the current breakpoint under consideration} +@!chain:boolean; {chain current line and next line?} +@z + +% chain ¤¬¿¿¤Î¾ì¹ç¡¢¸å¤í¤Ë cur_kanji_skip ¤¬ÁÞÆþ¤µ¤ì¤ë¤Î¤Ç¡¢¤³¤³¤Ç +% break_width ¤«¤é°ú¤¤¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +@x [38.837] l.17125 - pTeX: add kanji_skip width, ita_kern +begin no_break_yet:=false; do_all_six(set_break_width_to_background); +s:=cur_p; +if break_type>unhyphenated then if cur_p<>null then + @; +while s<>null do + begin if is_char_node(s) then goto done; +@y +begin no_break_yet:=false; do_all_six(set_break_width_to_background); +s:=cur_p; +if break_type>unhyphenated then if cur_p<>null then + @; +while s<>null do + begin if is_char_node(s) then + begin if chain then + begin break_width[1]:=break_width[1]-width(cur_kanji_skip); + break_width[2+stretch_order(cur_kanji_skip)]:= + break_width[2+stretch_order(cur_kanji_skip)]-stretch(cur_kanji_skip); + break_width[6]:=break_width[6]-shrink(cur_kanji_skip); + end; + goto done end; +@z + +@x [38.837] l.17135 - pTeX: + kern_node: if subtype(s)<>explicit then goto done + else break_width[1]:=break_width[1]-width(s); +@y + kern_node: if (subtype(s)<>explicit)and(subtype(s)<>ita_kern) then + goto done + else break_width[1]:=break_width[1]-width(s); +@z + +@x [38.841] l.17186 - pTeX: +if is_char_node(v) then + begin f:=font(v); + break_width[1]:=break_width[1]-char_width(f)(char_info(f)(character(v))); + end +else case type(v) of + ligature_node: begin f:=font(lig_char(v));@/ + break_width[1]:=@|break_width[1]- + char_width(f)(char_info(f)(character(lig_char(v)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + break_width[1]:=break_width[1]-width(v); + othercases confusion("disc1") +@:this can't happen disc1}{\quad disc1@> + endcases +@y +if is_char_node(v) then + begin f:=font(v); + break_width[1]:=break_width[1]-char_width(f)(orig_char_info(f)(character(v))); + if font_dir[f]<>dir_default then v:=link(v); + end +else case type(v) of + ligature_node: begin f:=font(lig_char(v));@/ + break_width[1]:=@|break_width[1]- + char_width(f)(orig_char_info(f)(character(lig_char(v)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + break_width[1]:=break_width[1]-width(v); + disp_node: do_nothing; + othercases confusion("disc1") +@:this can't happen disc1}{\quad disc1@> + endcases +@z + +@x [38.842] l.17204 - pTeX: + break_width[1]:=@|break_width[1]+char_width(f)(char_info(f)(character(s))); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + break_width[1]:=break_width[1]+ + char_width(f)(char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + break_width[1]:=break_width[1]+width(s); +@y + break_width[1]:=@|break_width[1]+char_width(f)(orig_char_info(f)(character(s))); + if font_dir[f]<>dir_default then s:=link(s); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + break_width[1]:=break_width[1]+ + char_width(f)(orig_char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + break_width[1]:=break_width[1]+width(s); + disp_node: do_nothing; +@z + +@x [38.856] l.17467 - pTeX: print symbolic feasible node +if cur_p=null then print_esc("par") +else if type(cur_p)<>glue_node then + begin if type(cur_p)=penalty_node then print_esc("penalty") + else if type(cur_p)=disc_node then print_esc("discretionary") +@y +if cur_p=null then print_esc("par") +else if (type(cur_p)<>glue_node)and(not is_char_node(cur_p)) then + begin if type(cur_p)=penalty_node then print_esc("penalty") + else if type(cur_p)=disc_node then print_esc("discretionary") +@z + +@x [39.862] l.17584 - pTeX: local valiable for line breaking +@!auto_breaking:boolean; {is node |cur_p| outside a formula?} +@!prev_p:pointer; {helps to determine when glue nodes are breakpoints} +@!q,@!r,@!s,@!prev_s:pointer; {miscellaneous nodes of temporary interest} +@!f:internal_font_number; {used when calculating character widths} +@y +@!auto_breaking:boolean; {is node |cur_p| outside a formula?} +@!prev_p:pointer; {helps to determine when glue nodes are breakpoints} +@!q,@!r,@!s,@!prev_s:pointer; {miscellaneous nodes of temporary interest} +@!f,@!post_f:internal_font_number; {used when calculating character widths} +@!post_p:pointer; +@!cc:ASCII_code; +@!first_use:boolean; +@z + +@x [39.866] l.17677 - pTeX: dir_node, disp_node, ita_kern +case type(cur_p) of +hlist_node,vlist_node,rule_node: act_width:=act_width+width(cur_p); +@y +case type(cur_p) of +hlist_node,vlist_node,dir_node,rule_node: act_width:=act_width+width(cur_p); +@z + +@x [39.866] l.17685 - pTeX: +kern_node: if subtype(cur_p)=explicit then kern_break + else act_width:=act_width+width(cur_p); +@y +kern_node: if (subtype(cur_p)=explicit)or(subtype(cur_p)=ita_kern) then + kern_break + else act_width:=act_width+width(cur_p); +@z + +@x [39.866] l.17694 - pTeX: +mark_node,ins_node,adjust_node: do_nothing; +@y +disp_node,mark_node,ins_node,adjust_node: do_nothing; +@z + +% ¤³¤³¤Ç¡¢Ï¢Â³¤¹¤ë´Á»ú¥³¡¼¥É´Ö¤Ë cur_kanji_skip ¤òÁÞÆþ¤¹¤ë¡£ +% penalty_node ¤ä box_node ¤Ë¤Ï¡¢adjust_hlist ¥ë¡¼¥Á¥ó¤Ë¤è¤Ã¤Æ´û¤Ë¼ÂºÝ¤Î +% glue_node ¤¬ÁÞÆþ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È²¾Äꤷ¤Æ¤¤¤ë¡£ +% chain ¤Ï¡¢try_break ¤Ç cur_kanji_skip ¤Î¥¢¥¸¥ã¥¹¥È¤Î¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +@x [39.867] l.17708 - pTeX: add kanji char width +@= +begin prev_p:=cur_p; +repeat f:=font(cur_p); +act_width:=act_width+char_width(f)(char_info(f)(character(cur_p))); +cur_p:=link(cur_p); +until not is_char_node(cur_p); +end +@y +@= +begin chain:=false; +if is_char_node(cur_p) then + if font_dir[font(cur_p)]<>dir_default then + begin case type(prev_p) of + hlist_node,vlist_node,dir_node,rule_node, + ligature_node,disc_node,math_node: begin + cur_p:=prev_p; try_break(0,unhyphenated); cur_p:=link(cur_p); + end; + othercases do_nothing; + endcases; + end; + prev_p:=cur_p; post_p:=cur_p; post_f:=font(post_p); + repeat f:=post_f; cc:=character(cur_p); + act_width:=act_width+char_width(f)(orig_char_info(f)(cc)); + post_p:=link(cur_p); + if font_dir[f]<>dir_default then + begin prev_p:=cur_p; cur_p:=post_p; post_p:=link(post_p); + if is_char_node(post_p) then + begin post_f:=font(post_p); + if font_dir[post_f]<>dir_default then chain:=true else chain:=false; + try_break(0,unhyphenated); + end + else + begin chain:=false; + case type(post_p) of + hlist_node,vlist_node,dir_node,rule_node,ligature_node, + disc_node,math_node: try_break(0,unhyphenated); + othercases do_nothing; + endcases; + end; + if chain then + begin if first_use then + begin check_shrinkage(cur_kanji_skip); + first_use:=false; + end; + act_width:=act_width+width(cur_kanji_skip);@| + active_width[2+stretch_order(cur_kanji_skip)]:=@| + active_width[2+stretch_order(cur_kanji_skip)] + +stretch(cur_kanji_skip);@/ + active_width[6]:=active_width[6]+shrink(cur_kanji_skip); + end; + prev_p:=cur_p; + end + else if is_char_node(post_p) then + begin post_f:=font(post_p); chain:=false; + if font_dir[post_f]<>dir_default then try_break(0,unhyphenated); + end; + cur_p:=post_p; + until not is_char_node(cur_p); +chain:=false; +end +@z + +@x [39.868] l.17723 - pTeX: ita_kern + else if (type(prev_p)=kern_node)and(subtype(prev_p)<>explicit) then + try_break(0,unhyphenated); +@y + else if type(prev_p)=kern_node then + if (subtype(prev_p)<>explicit)and(subtype(prev_p)<>ita_kern) then + try_break(0,unhyphenated); +@z + +@x [39.871] l.17756 - pTeX: add kanji char width, dir_node width, disp_node + disc_width:=disc_width+char_width(f)(char_info(f)(character(s))); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + disc_width:=disc_width+ + char_width(f)(char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + disc_width:=disc_width+width(s); +@y + disc_width:=disc_width+char_width(f)(orig_char_info(f)(character(s))); + if font_dir[f]<>dir_default then s:=link(s) + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + disc_width:=disc_width+ + char_width(f)(orig_char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + disc_width:=disc_width+width(s); + disp_node: do_nothing; +@z + +@x [39.872] l.17772 - pTeX: add kanji char width, dir_node width, disp_node + act_width:=act_width+char_width(f)(char_info(f)(character(s))); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + act_width:=act_width+ + char_width(f)(char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + act_width:=act_width+width(s); +@y + act_width:=act_width+char_width(f)(orig_char_info(f)(character(s))); + if font_dir[f]<>dir_default then s:=link(s) + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + act_width:=act_width+ + char_width(f)(orig_char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + act_width:=act_width+width(s); + disp_node: do_nothing; +@z + +@x [39.877] l.17879 - pTeX: last_disp +cur_line:=prev_graf+1; +@y +cur_line:=prev_graf+1; last_disp:=0; +@z + +@x [39.879] l.17919 - pTeX: ita_kern + if type(q)=kern_node then if subtype(q)<>explicit then goto done1; +@y + if type(q)=kern_node then + if (subtype(q)<>explicit)and(subtype(q)<>ita_kern) then goto done1; +@z + +@x [39.881] l.17950 - pTeX: |q| may be a |char_node| +if q<>null then {|q| cannot be a |char_node|} + if type(q)=glue_node then + begin delete_glue_ref(glue_ptr(q)); + glue_ptr(q):=right_skip; + subtype(q):=right_skip_code+1; add_glue_ref(right_skip); + goto done; + end + else begin if type(q)=disc_node then + @ +@y +if q<>null then {|q| may be a |char_node|} + begin if not is_char_node(q) then + if type(q)=glue_node then + begin delete_glue_ref(glue_ptr(q)); + glue_ptr(q):=right_skip; + subtype(q):=right_skip_code+1; add_glue_ref(right_skip); + goto done; + end + else begin if type(q)=disc_node then + @ +@z +@x [39.881] l.17961 - pTeX: |q| may be a |char_node| + end +@y + end + end +@z + +@x [39.887] l.18014 - pTeX: disp_node at begin-of-line +r:=link(q); link(q):=null; q:=link(temp_head); link(temp_head):=r; +@y +r:=link(q); link(q):=null; q:=link(temp_head); link(temp_head):=r; +if last_disp<>0 then begin + r:=get_node(small_node_size); + type(r):=disp_node; disp_dimen(r):=last_disp; + link(r):=q; q:=r; disp_called:=true; + end; +@z + +@x [40.896] l.18177 - pTeX: hyphenation +loop@+ begin if is_char_node(s) then + begin c:=qo(character(s)); hf:=font(s); + end +@y +loop@+ begin if is_char_node(s) then + begin hf:=font(s); + if font_dir[hf]<>dir_default then + begin prev_s:=s; s:=link(prev_s); c:=info(s); goto continue; + end else c:=qo(character(s)); + end + else if type(s)=disp_node then goto continue + else if (type(s)=penalty_node)and(subtype(s)<>normal) then goto continue +@z + +@x [40.899] l.18248 - pTeX: disp_node + whatsit_node,glue_node,penalty_node,ins_node,adjust_node,mark_node: + goto done4; +@y + disp_node: do_nothing; + whatsit_node,glue_node,penalty_node,ins_node,adjust_node,mark_node: + goto done4; +@z + +@x [44.968] l.19535 - pTeX: dir_node + hlist_node,vlist_node,rule_node:@@;@/ +@y +dir_node, +hlist_node,vlist_node,rule_node: begin@t@>@;@/ +@z + +@x [44.977] l.19710 - pTeX: free box node +var v:pointer; {the box to be split} +@y +var v:pointer; {the box to be split} +w:pointer; {|dir_node|} +@z + +@x [44.977] l.19722 - pTeX: free box node +q:=prune_page_top(q); p:=list_ptr(v); free_node(v,box_node_size); +if q=null then box(n):=null {the |eq_level| of the box stays the same} +else box(n):=vpack(q,natural); +vsplit:=vpackage(p,h,exactly,split_max_depth); +@y +q:=prune_page_top(q); p:=list_ptr(v); +if q=null then box(n):=null {the |eq_level| of the box stays the same} +else begin + box(n):=vpack(q,natural); set_box_dir(box(n))(box_dir(v)); + end; +q:=vpackage(p,h,exactly,split_max_depth); +set_box_dir(q)(box_dir(v)); +delete_glue_ref(space_ptr(v)); delete_glue_ref(xspace_ptr(v)); +free_node(v,box_node_size); +vsplit:=q; +@z + +@x [44.978] l.19732 - pTeX: bad box for vsplit +if type(v)<>vlist_node then + begin print_err(""); print_esc("vsplit"); print(" needs a "); + print_esc("vbox"); +@:vsplit_}{\.{\\vsplit needs a \\vbox}@> + help2("The box you are trying to split is an \hbox.")@/ + ("I can't split such a box, so I'll leave it alone."); + error; vsplit:=null; return; + end +@y +if type(v)=dir_node then begin + w:=v; v:=list_ptr(v); + delete_glue_ref(space_ptr(w)); + delete_glue_ref(xspace_ptr(w)); + free_node(w,box_node_size); +end; +if type(v)<>vlist_node then begin + print_err(""); print_esc("vsplit"); print(" needs a "); + print_esc("vbox"); +@:vsplit_}{\.{\\vsplit needs a \\vbox}@> + help2("The box you are trying to split is an \hbox.")@/ + ("I can't split such a box, so I'll leave it alone."); + error; vsplit:=null; return; +end; +flush_node_list(link(v)); link(v):=null +@z + +@x [45.993] l.20053 - pTeX: ensure_vbox +begin p:=box(n); +if p<>null then if type(p)=hlist_node then + begin print_err("Insertions can only be added to a vbox"); +@y +begin p:=box(n); +if p<>null then if type(p)=dir_node then + begin p:=list_ptr(p); + delete_glue_ref(space_ptr(box(n))); + delete_glue_ref(xspace_ptr(box(n))); + free_node(box(n),box_node_size); + box(n):=p +end; +if p<>null then if type(p)<>vlist_node then begin + print_err("Insertions can only be added to a vbox"); +@z + +@x [45.1000] l.20146 - pTeX: dir_node +hlist_node,vlist_node,rule_node: if page_contents +@y +hlist_node,vlist_node,dir_node,rule_node: if page_contents +@z + +@x [45.1009] l.20291 - pTeX: ins_dir +if box(n)=null then height(r):=0 +else height(r):=height(box(n))+depth(box(n)); +@y +if box(n)=null then height(r):=0 +else + begin if abs(ins_dir(p))<>abs(box_dir(box(n))) then + begin print_err("Insertions can only be added to a same direction vbox"); +@.Insertions can only...@> + help3("Tut tut: You're trying to \insert into a")@/ + ("\box register that now have a different direction.")@/ + ("Proceed, and I'll discard its present contents."); + box_error(n) + end + else + height(r):=height(box(n))+depth(box(n)); + end; +@z + +@x [45.1017] l.20470 - pTeX: page dir +box(255):=vpackage(link(page_head),best_size,exactly,page_max_depth); +@y +box(255):=vpackage(link(page_head),best_size,exactly,page_max_depth); +set_box_dir(box(255))(page_dir); +@z + +@x [45.1020] l.20513 - pTeX: check ins_dir +if best_ins_ptr(r)=null then wait:=true +else begin wait:=false; s:=last_ins_ptr(r); link(s):=ins_ptr(p); +@y +if best_ins_ptr(r)=null then wait:=true +else begin wait:=false; + n:=qo(subtype(p)); + case abs(box_dir(box(n))) of + any_dir: + if abs(ins_dir(p))<>abs(box_dir(box(n))) then begin + print_err("Insertions can only be added to a same direction vbox"); +@.Insertions can only...@> + help3("Tut tut: You're trying to \insert into a")@/ + ("\box register that now have a different direction.")@/ + ("Proceed, and I'll discard its present contents."); + box_error(n); + box(n):=new_null_box; last_ins_ptr(r):=box(n)+list_offset; + end; + othercases + set_box_dir(box(n))(abs(ins_dir(p))); + endcases; + s:=last_ins_ptr(r); link(s):=ins_ptr(p); +@z + +@x [45.1021] l.20537 - pTeX: free box node, ins_dir + free_node(temp_ptr,box_node_size); wait:=true; +@y + delete_glue_ref(space_ptr(temp_ptr)); + delete_glue_ref(xspace_ptr(temp_ptr)); + free_node(temp_ptr,box_node_size); wait:=true; +@z + +@x [45.1021] l.20543 - pTeX: free box node, ins_dir +free_node(box(n),box_node_size); +box(n):=vpack(temp_ptr,natural); +@y +delete_glue_ref(space_ptr(box(n))); +delete_glue_ref(xspace_ptr(box(n))); +flush_node_list(link(box(n))); +free_node(box(n),box_node_size); +box(n):=vpack(temp_ptr,natural); set_box_dir(box(n))(abs(ins_dir(p))); +@z + +@x [46.1030] l.20687 - pTeX:main_control +@d append_normal_space=120 {go here to append a normal space between words} +@y +@d append_normal_space=120 {go here to append a normal space between words} +@d main_loop_j=130 {like |main_loop|, but |cur_chr| holds a KANJI code} +@d skip_loop=141 +@d again_2=150 +@z + +@x [46.1030] l.20691 - pTeX: main_control +procedure main_control; {governs \TeX's activities} +label big_switch,reswitch,main_loop,main_loop_wrapup, +@y +procedure main_control; {governs \TeX's activities} +label big_switch,reswitch,main_loop,main_loop_wrapup, + main_loop_j,main_loop_j+1,main_loop_j+3,skip_loop,again_2, +@z + +@x [46.1030] l.20697 - pTeX: main_control +var@!t:integer; {general-purpose temporary variable} +@y +var@!t:integer; {general-purpose temporary variable} +@!cx:KANJI_code; {kanji character} +@!kp:pointer; {kinsoku penalty register} +@!gp,gq:pointer; {temporary registers for list manipulation} +@!disp:scaled; {displacement register} +@!ins_kp:boolean; {whether insert kinsoku penalty} +@z + +@x [46.1030] l.20701 - pTeX: main_control +case abs(mode)+cur_cmd of +hmode+letter,hmode+other_char,hmode+char_given: goto main_loop; +hmode+char_num: begin scan_char_num; cur_chr:=cur_val; goto main_loop;@+end; +hmode+no_boundary: begin get_x_token; + if (cur_cmd=letter)or(cur_cmd=other_char)or(cur_cmd=char_given)or + (cur_cmd=char_num) then cancel_boundary:=true; + goto reswitch; + end; +@y +ins_kp:=false; +case abs(mode)+cur_cmd of +hmode+letter,hmode+other_char: goto main_loop; +hmode+kanji,hmode+kana,hmode+other_kchar: goto main_loop_j; +hmode+char_given: + if is_char_ascii(cur_chr) then goto main_loop else goto main_loop_j; +hmode+char_num: begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then goto main_loop else goto main_loop_j; + end; +hmode+no_boundary: begin get_x_token; + if (cur_cmd=letter)or(cur_cmd=other_char)or + (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar)or + (cur_cmd=char_given)or(cur_cmd=char_num) then cancel_boundary:=true; + goto reswitch; + end; +@z + +@x [46.1030] l.20715 - pTeX: main_control +main_loop:@; +@y +main_loop_j:@; +main_loop: inhibit_glue_flag:=false; +@; +@z + +@x [46.1034] l.20788 - pTeX: disp_node +@= +if ((head=tail) and (mode>0)) then begin + if (insert_src_special_auto) then append_src_special; +end; +adjust_space_factor;@/ +@y +@= +if ((head=tail) and (mode>0)) then begin + if (insert_src_special_auto) then append_src_special; +end; +adjust_space_factor;@/ +if direction=dir_tate then disp:=t_baseline_shift else disp:=y_baseline_shift; +@; +@z + +%@x [46.1035] l.20850 - pTeX: kinsoku penalty +%@= +%wrapup(rt_hit) +%@y +%@= +%wrapup(rt_hit); +%if ins_kp=true then +% begin cx:=KANJI(cur_l); @; +% ins_kp:=false; +% end +%@z + +@x [46.1036] l.20854 - pTeX: disp_node +if lig_stack=null then goto reswitch; +@y +if lig_stack=null then + begin @; + goto reswitch; + end; +@z + +@x [46.1037] l.20886 - pTeX: Look ahead for another character +@= +get_next; {set only |cur_cmd| and |cur_chr|, for speed} +if cur_cmd=letter then goto main_loop_lookahead+1; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then goto main_loop_lookahead+1; +x_token; {now expand and set |cur_cmd|, |cur_chr|, |cur_tok|} +if cur_cmd=letter then goto main_loop_lookahead+1; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then goto main_loop_lookahead+1; +if cur_cmd=char_num then + begin scan_char_num; cur_chr:=cur_val; goto main_loop_lookahead+1; + end; +if cur_cmd=no_boundary then bchar:=non_char; +cur_r:=bchar; lig_stack:=null; goto main_lig_loop; +main_loop_lookahead+1: adjust_space_factor; +fast_get_avail(lig_stack); font(lig_stack):=main_f; +cur_r:=qi(cur_chr); character(lig_stack):=cur_r; +if cur_r=false_bchar then cur_r:=non_char {this prevents spurious ligatures} +@y +@= +get_next; {set only |cur_cmd| and |cur_chr|, for speed} +if cur_cmd=letter then goto main_loop_lookahead+1; +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + @; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then + begin if is_char_ascii(cur_chr) then goto main_loop_lookahead+1 + else @; + end; +x_token; {now expand and set |cur_cmd|, |cur_chr|, |cur_tok|} +if cur_cmd=letter then goto main_loop_lookahead+1; +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + @; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then + begin if is_char_ascii(cur_chr) then goto main_loop_lookahead+1 + else @; + end; +if cur_cmd=char_num then + begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then goto main_loop_lookahead+1 + else @; + end; +if cur_cmd=inhibit_glue then + begin inhibit_glue_flag:=true; goto main_loop_lookahead; + end; +if cur_cmd=no_boundary then bchar:=non_char; +cur_r:=bchar; lig_stack:=null; goto main_lig_loop; +main_loop_lookahead+1: adjust_space_factor; +inhibit_glue_flag:=false; +fast_get_avail(lig_stack); font(lig_stack):=main_f; +cur_r:=qi(cur_chr); character(lig_stack):=cur_r; +if cur_r=false_bchar then cur_r:=non_char {this prevents spurious ligatures} + +@ @= +begin bchar:=non_char; cur_r:=bchar; lig_stack:=null; +if ligature_present then pack_lig(rt_hit); +if ins_kp=true then + begin cx:=cur_l; @; + end; +ins_kp:=false; +goto main_loop_j; +end +@z + +@x [46.1041] l.20999 - pTeX: disp_node +link(tail):=temp_ptr; tail:=temp_ptr; +@y +if not is_char_node(tail)and(type(tail)=disp_node) then + begin link(prev_node):=temp_ptr; link(temp_ptr):=tail; prev_node:=temp_ptr; + end +else begin link(tail):=temp_ptr; tail:=temp_ptr; + end; +@z + +@x [46.1043] l.21029 - pTeX: disp_node +link(tail):=q; tail:=q; +@y +if not is_char_node(tail)and(type(tail)=disp_node) then + begin link(prev_node):=q; link(q):=tail; prev_node:=q; + end +else begin link(tail):=q; tail:=q; + end +@z + +@x [47.????] pTeX: reset inhibit_glue_flag at rule_node +vmode+hrule,hmode+vrule,mmode+vrule: begin tail_append(scan_rule_spec); +@y +vmode+hrule,hmode+vrule,mmode+vrule: begin tail_append(scan_rule_spec); + inhibit_glue_flag := false; +@z + +@x [47.1060] pTeX: append_glue, inhibit_glue_flag +end; {now |cur_val| points to the glue specification} +tail_append(new_glue(cur_val)); +if s>=skip_code then +@y +end; {now |cur_val| points to the glue specification} +tail_append(new_glue(cur_val)); +inhibit_glue_flag := false; +if s>=skip_code then +@z + +@x [47.1061] l.21277 - pTeX: append kern +begin s:=cur_chr; scan_dimen(s=mu_glue,false,false); +tail_append(new_kern(cur_val)); subtype(tail):=s; +end; +@y +begin s:=cur_chr; scan_dimen(s=mu_glue,false,false); +inhibit_glue_flag := false; +if not is_char_node(tail)and(type(tail)=disp_node) then + begin prev_append(new_kern(cur_val)); subtype(prev_node):=s; + end +else + begin tail_append(new_kern(cur_val)); subtype(tail):=s; + end; +end; +@z + +@x [47.1068] l.21377 - pTeX: +var p,@!q:pointer; {for short-term use} +@y +var p,@!q:pointer; {for short-term use} +@!r:pointer; {temporary} +@z + +@x [47.1071] l.21485 - pTeX: \tate, \yoko, \dtou +primitive("hbox",make_box,vtop_code+hmode);@/ +@!@:hbox_}{\.{\\hbox} primitive@> +@y +primitive("hbox",make_box,vtop_code+hmode);@/ +@!@:hbox_}{\.{\\hbox} primitive@> +primitive("tate",chg_dir,dir_tate);@/ +@!@:tate_}{\.{\\tate} primitive@> +primitive("yoko",chg_dir,dir_yoko);@/ +@!@:yoko_}{\.{\\yoko} primitive@> +primitive("dtou",chg_dir,dir_dtou);@/ +@!@:dtou_}{\.{\\dtou} primitive@> +@z + +@x [47.1072] l.21506 - pTeX: \tate, \yoko, \dtou + othercases print_esc("hbox") + endcases; +leader_ship: if chr_code=a_leaders then print_esc("leaders") +@y + othercases print_esc("hbox") + endcases; +chg_dir: + case chr_code of + dir_yoko: print_esc("yoko"); + dir_tate: print_esc("tate"); + dir_dtou: print_esc("dtou"); + endcases; +leader_ship: if chr_code=a_leaders then print_esc("leaders") +@z + +@x [47.1073] l.21523 - pTeX: \tate, \yoko +any_mode(make_box): begin_box(0); +@y +any_mode(make_box): begin_box(0); +any_mode(chg_dir): + begin if cur_group<>align_group then + if mode=hmode then + begin print_err("Improper `"); print_cmd_chr(cur_cmd,cur_chr); + print("'"); + help2("You cannot change the direction in unrestricted") + ("horizontal mode."); error; + end + else if abs(mode)=mmode then + begin print_err("Improper `"); print_cmd_chr(cur_cmd,cur_chr); + print("'"); + help1("You cannot change the direction in math mode."); error; + end + else if nest_ptr=0 then change_page_direction(cur_chr) + else if head=tail then direction:=cur_chr + else begin print_err("Use `"); print_cmd_chr(cur_cmd,cur_chr); + print("' at top of list"); + help2("Direction change command is available only while") + ("current list is null."); error; + end + else begin print_err("You can't use `"); print_cmd_chr(cur_cmd,cur_chr); + print("' in an align"); + help2("To change direction in an align,") + ("you shold use \hbox or \vbox with \tate or \yoko."); error; + end + end; +@z + +@x [47.1075] l.21538 - pTeX: box_end +var p:pointer; {|ord_noad| for new box in math mode} +@y +var p:pointer; {|ord_noad| for new box in math mode} +q:pointer; +@z + +@x [47.1076] l.21553 - pTeX: box_dir adjust + begin shift_amount(cur_box):=box_context; +@y + begin p:=link(cur_box); link(cur_box):=null; + while p<>null do begin + q:=p; p:=link(p); + if abs(box_dir(q))=abs(direction) then + begin list_ptr(q):=cur_box; cur_box:=q; link(cur_box):=null; + end + else begin + delete_glue_ref(space_ptr(q)); + delete_glue_ref(xspace_ptr(q)); + free_node(q,box_node_size); + end; + end; + if abs(box_dir(cur_box))<>abs(direction) then + cur_box:=new_dir_node(cur_box,abs(direction)); + shift_amount(cur_box):=box_context; +@z + +@x [47.1076] pTeX: sub_exp_box + else begin if abs(mode)=hmode then space_factor:=1000 + else begin p:=new_noad; + math_type(nucleus(p)):=sub_box; +@y + else begin if abs(mode)=hmode then + begin space_factor:=1000; inhibit_glue_flag:=false; end + 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; + end +@y + begin append_glue; subtype(tail):=box_context-(leader_flag-a_leaders); + if type(cur_box)<=dir_node then + begin p:=link(cur_box); link(cur_box):=null; + while p<>null do + begin q:=p; p:=link(p); + if abs(box_dir(q))=abs(direction) then + begin list_ptr(q):=cur_box; cur_box:=q; link(cur_box):=null; + end + else begin + delete_glue_ref(space_ptr(q)); + delete_glue_ref(xspace_ptr(q)); + free_node(q,box_node_size); + end; + end; + if abs(box_dir(cur_box))<>abs(direction) then + cur_box:=new_dir_node(cur_box,abs(direction)); + end; + leader_ptr(tail):=cur_box; + end +@z + +@x [47.1079] l.20920 begin_box - pTeX: disp_node, adjust direction +@!m:quarterword; {the length of a replacement list} +@y +@!r:pointer; {running behind |p|} +@!fd:boolean; {a final |disp_node| pair?} +@!disp,@!pdisp:scaled; {displacement} +@!a_dir:eight_bits; {adjust direction} +@!tx:pointer; {effective tail node} +@!m:quarterword; {the length of a replacement list} +@z + +@x [47.1080] l.20937 - pTeX: disp_node, check head=tail +@ Note that the condition |not is_char_node(tail)| implies that |head<>tail|, +since |head| is a one-word node. +@y +@ Note that in \TeX\ the condition |not is_char_node(tail)| implies that +|head<>tail|, since |head| is a one-word node; this is not so for \pTeX. +@z + +@x [47.1080] l.20940 - pTeX: disp_node +@= +@y +@d check_effective_tail_pTeX(#)== +tx:=tail; +if not is_char_node(tx) then + if type(tx)=disp_node then + begin tx:=prev_node; + if not is_char_node(tx) then + if type(tx)=disp_node then #; {|disp_node| from a discretionary} + end +@# +@d fetch_effective_tail_pTeX(#)== {extract |tx|, merge |disp_node| pair} +q:=head; p:=null; disp:=0; pdisp:=0; +repeat r:=p; p:=q; fd:=false; +if not is_char_node(q) then + if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tx then #; + end + else if type(q)=disp_node then + begin pdisp:=disp; disp:=disp_dimen(q); fd:=true;@+end; +q:=link(p); +until q=tx; {found |r|$\to$|p|$\to$|q=tx|} +q:=link(tx); link(p):=q; link(tx):=null; +if q=null then tail:=p +else if fd then {|r|$\to$|p=disp_node|$\to$|q=disp_node|} + begin prev_node:=r; prev_disp:=pdisp; link(p):=null; tail:=p; + disp_dimen(p):=disp_dimen(q); free_node(q,small_node_size); + end +else prev_node:=p +@# +@d check_effective_tail==check_effective_tail_pTeX +@d fetch_effective_tail==fetch_effective_tail_pTeX + +@= +@z + +@x [47.1080] l.20950 - pTeX: disp_node, check head=tail +else begin if not is_char_node(tail) then + if (type(tail)=hlist_node)or(type(tail)=vlist_node) then + @; + end; +@y +else begin check_effective_tail(goto done); + if not is_char_node(tx)and(head<>tx) then + if (type(tx)=hlist_node)or(type(tx)=vlist_node) + or(type(tx)=dir_node) then + @; + done:end; +@z + +@x [47.1081] l.20957 - pTeX: disp_node +begin q:=head; +repeat p:=q; +if not is_char_node(q) then if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tail then goto done; + end; +q:=link(p); +until q=tail; +cur_box:=tail; shift_amount(cur_box):=0; +tail:=p; link(p):=null; +done:end +@y +begin fetch_effective_tail(goto done); +cur_box:=tx; shift_amount(cur_box):=0; +if type(cur_box)=dir_node then + begin link(list_ptr(cur_box)):=cur_box; + cur_box:=list_ptr(cur_box); + list_ptr(link(cur_box)):=null; + end +else + if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(direction); +end +@z + +@x [47.1083] l.20989 - pTeX: adjust_dir +if k=hmode then + if (box_context; + end; +pop_nest; box_end(saved(0)); +end; +@y +begin d:=box_max_depth; + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + if auto_spacing>0 then cur_kanji_skip:=kanji_skip + else cur_kanji_skip:=zero_glue; + if auto_xspacing>0 then cur_xkanji_skip:=xkanji_skip + else cur_xkanji_skip:=zero_glue; + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + unsave; save_ptr:=save_ptr-3; + if mode=-hmode then begin + cur_box:=hpack(link(head),saved(2),saved(1)); + set_box_dir(cur_box)(direction); pop_nest; + end else begin + cur_box:=vpackage(link(head),saved(2),saved(1),d); + set_box_dir(cur_box)(direction); pop_nest; + if c=vtop_code then + @; + end; + box_end(saved(0)); +end; +@z + +@x [47.1090] l.21079 - pTeX: apend vmode case +vmode+letter,vmode+other_char,vmode+char_num,vmode+char_given, + vmode+math_shift,vmode+un_hbox,vmode+vrule, + vmode+accent,vmode+discretionary,vmode+hskip,vmode+valign, + vmode+ex_space,vmode+no_boundary:@t@>@;@/ + begin back_input; new_graf(true); + end; +@y +vmode+letter,vmode+other_char,vmode+char_num,vmode+char_given, + vmode+math_shift,vmode+un_hbox,vmode+vrule, + vmode+accent,vmode+discretionary,vmode+hskip,vmode+valign, + vmode+kanji,vmode+kana,vmode+other_kchar, + vmode+ex_space,vmode+no_boundary:@t@>@;@/ + begin back_input; new_graf(true); + end; +@z + +@x [47.1091] l.21096 - pTeX: new_graf, adjust direction +push_nest; mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@y +inhibit_glue_flag := false; +push_nest; adjust_dir:=direction; +mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@z + +@x [47.???] indent_in_hmode: reset inhibit_glue_flag + if abs(mode)=hmode then space_factor:=1000 +@y + if abs(mode)=hmode then + begin space_factor:=1000; inhibit_glue_flag:=false; end +@z + +@x [47.1096] l.21155 - pTeX: end_graf, call adjust_hlist + begin if head=tail then pop_nest {null paragraphs are ignored} + else line_break(widow_penalty); +@y + begin if (link(head)=tail)and(not is_char_node(tail)and(type(tail)=disp_node)) then + begin free_node(tail,small_node_size); tail:=head; link(head):=null; end; + { |disp_node|-only paragraphs are ignored } + if head=tail then pop_nest {null paragraphs are ignored} + else begin adjust_hlist(head,true); line_break(widow_penalty) + end; +@z + +@x [47.1099] l.21184 begin_insert_or_adjust - pTeX: insert and adjust +new_save_level(insert_group); scan_left_brace; normal_paragraph; +push_nest; mode:=-vmode; prev_depth:=ignore_depth; +@y +inhibit_glue_flag:=false; +new_save_level(insert_group); scan_left_brace; normal_paragraph; +push_nest; mode:=-vmode; direction:=adjust_dir; prev_depth:=ignore_depth; +@z + +@x [47.1100] l.21189 - pTeX: free box node, ins_dir + {now |saved(0)| is the insertion number, or 255 for |vadjust|} + p:=vpack(link(head),natural); pop_nest; + if saved(0)<255 then + begin tail_append(get_node(ins_node_size)); + type(tail):=ins_node; subtype(tail):=qi(saved(0)); + height(tail):=height(p)+depth(p); ins_ptr(tail):=list_ptr(p); + split_top_ptr(tail):=q; depth(tail):=d; float_cost(tail):=f; + end + else begin tail_append(get_node(small_node_size)); + type(tail):=adjust_node;@/ + subtype(tail):=0; {the |subtype| is not used} + adjust_ptr(tail):=list_ptr(p); delete_glue_ref(q); + end; + free_node(p,box_node_size); + if nest_ptr=0 then build_page; + end; +@y + {now |saved(0)| is the insertion number, or 255 for |vadjust|} + p:=vpack(link(head),natural); set_box_dir(p)(direction); pop_nest; + if saved(0)<255 then + begin r:=get_node(ins_node_size); + type(r):=ins_node; subtype(r):=qi(saved(0)); + height(r):=height(p)+depth(p); ins_ptr(r):=list_ptr(p); + split_top_ptr(r):=q; depth(r):=d; float_cost(r):=f; + set_ins_dir(r)(box_dir(p)); + if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(r) + else tail_append(r); + end + else begin + if abs(box_dir(p))<>abs(adjust_dir) then + begin print_err("Direction Incompatible"); + help1("\vadjust's argument and outer vlist must have same direction."); + error; flush_node_list(list_ptr(p)); + end + else begin + r:=get_node(small_node_size); type(r):=adjust_node;@/ + subtype(r):=0; {the |subtype| is not used} + adjust_ptr(r):=list_ptr(p); delete_glue_ref(q); + if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(r) + else tail_append(r); + end; + end; + delete_glue_ref(space_ptr(p)); + delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); + if nest_ptr=0 then build_page; + end; +@z + +@x [47.1101] l.21214 make_mark - pTeX: mark_node, prev_append +mark_ptr(p):=def_ref; link(tail):=p; tail:=p; +@y +inhibit_glue_flag:=false; +mark_ptr(p):=def_ref; +if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(p) +else tail_append(p); +@z + +@x [47.1103] l.21224 - pTeX: penalty, prev_append +procedure append_penalty; +begin scan_int; tail_append(new_penalty(cur_val)); +if mode=vmode then build_page; +end; +@y +procedure append_penalty; +begin scan_int; + inhibit_glue_flag:=false; + if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(new_penalty(cur_val)) + else tail_append(new_penalty(cur_val)); + if mode=vmode then build_page; +end; +@z + +@x [47.1105] l.21246 - pTeX: delete_last: disp_node +@!m:quarterword; {the length of a replacement list} +@y +@!r:pointer; {running behind |p|} +@!fd:boolean; {a final |disp_node| pair?} +@!disp,@!pdisp:scaled; {displacement} +@!tx:pointer; {effective tail node} +@!m:quarterword; {the length of a replacement list} +@z + +@x [47.1105] l.21250 - pTeX: delete_last: disp_node +else begin if not is_char_node(tail) then if type(tail)=cur_chr then + begin q:=head; + repeat p:=q; + if not is_char_node(q) then if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tail then return; + end; + q:=link(p); + until q=tail; + link(p):=null; flush_node_list(tail); tail:=p; +@y +else begin check_effective_tail(return); + if not is_char_node(tx) then if type(tx)=cur_chr then + begin fetch_effective_tail(return); + flush_node_list(tx); +@z + +@x [47.1110] l.21310 -pTeX: free box node, delete kanji_skip +var p:pointer; {the box} +@!c:box_code..copy_code; {should we copy?} +@y +var p:pointer; {the box} +@!c:box_code..copy_code; {should we copy?} +@!disp:scaled; {displacement} +@z + +@x [47.1110] l.21314 unpackage - pTeX: free box node, delete kanji_skip +if (abs(mode)=mmode)or((abs(mode)=vmode)and(type(p)<>vlist_node))or@| + ((abs(mode)=hmode)and(type(p)<>hlist_node)) then + begin print_err("Incompatible list can't be unboxed"); +@.Incompatible list...@> + help3("Sorry, Pandora. (You sneaky devil.)")@/ + ("I refuse to unbox an \hbox in vertical mode or vice versa.")@/ + ("And I can't open any boxes in math mode.");@/ + error; return; + end; +if c=copy_code then link(tail):=copy_node_list(list_ptr(p)) +else begin link(tail):=list_ptr(p); box(cur_val):=null; + free_node(p,box_node_size); + end; +@y +if type(p)=dir_node then p:=list_ptr(p); +if (abs(mode)=mmode)or((abs(mode)=vmode)and(type(p)<>vlist_node))or@| + ((abs(mode)=hmode)and(type(p)<>hlist_node)) then + begin print_err("Incompatible list can't be unboxed"); +@.Incompatible list...@> + help3("Sorry, Pandora. (You sneaky devil.)")@/ + ("I refuse to unbox an \hbox in vertical mode or vice versa.")@/ + ("And I can't open any boxes in math mode.");@/ + error; return; +end; +case abs(box_dir(p)) of + any_dir: + if abs(direction)<>abs(box_dir(p)) then begin + print_err("Incompatible direction list can't be unboxed"); + help2("Sorry, Pandora. (You sneaky devil.)")@/ + ("I refuse to unbox a box in different direction.");@/ + error; return; + end; +endcases; +disp:=0; +if c=copy_code then link(tail):=copy_node_list(list_ptr(p)) +else + begin if type(box(cur_val))=dir_node then + begin delete_glue_ref(space_ptr(box(cur_val))); + delete_glue_ref(xspace_ptr(box(cur_val))); + free_node(box(cur_val),box_node_size); + end; + flush_node_list(link(p)); + link(tail):=list_ptr(p); box(cur_val):=null; + delete_glue_ref(space_ptr(p)); + delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); + end; +@z + +@x [47.1110] l.22014 - pTeX: free box node, delete kanji_skip +while link(tail)<>null do tail:=link(tail); +@y +while link(tail)<>null do + {reset |inhibit_glue_flag| when a node other than |disp_node| is found; + |disp_node| is always inserted according to tex-jp-build issue 40} + begin p:=tail; tail:=link(tail); + if is_char_node(tail) then begin + inhibit_glue_flag:=false; + if font_dir[font(tail)]<>dir_default then last_jchr:=link(tail); + end + else + case type(tail) of + glue_node : begin + inhibit_glue_flag:=false; + if (subtype(tail)=kanji_skip_code+1) + or(subtype(tail)=xkanji_skip_code+1) then + begin link(p):=link(tail); + delete_glue_ref(glue_ptr(tail)); + free_node(tail,small_node_size); tail:=p; + end; + end; + penalty_node : begin + inhibit_glue_flag:=false; + if subtype(tail)=widow_pena then + begin link(p):=link(tail); free_node(tail,small_node_size); + tail:=p; + end; + end; + disp_node : + begin prev_disp:=disp; disp:=disp_dimen(tail); prev_node:=p; + end; + othercases inhibit_glue_flag:=false; + endcases; + end; +@z + +@x [47.1113] l.22028 - pTeX: italic correction, ita_kern +procedure append_italic_correction; +label exit; +var p:pointer; {|char_node| at the tail of the current list} +@!f:internal_font_number; {the font in the |char_node|} +begin if tail<>head then + begin if is_char_node(tail) then p:=tail + else if type(tail)=ligature_node then p:=lig_char(tail) + else return; + f:=font(p); + tail_append(new_kern(char_italic(f)(char_info(f)(character(p))))); + subtype(tail):=explicit; + end; +@y +procedure append_italic_correction; +label exit; +var p:pointer; {|char_node| at the tail of the current list} +@!f:internal_font_number; {the font in the |char_node|} +@!d:pointer; {|disp_node|} +begin if tail<>head then + begin + if not is_char_node(tail)and(type(tail)=disp_node) then + begin d:=tail; tail:=prev_node; + end + else d:=null; + if (last_jchr<>null)and(link(last_jchr)=tail)and(is_char_node(tail)) then + p:=last_jchr + else if is_char_node(tail) then p:=tail + else if type(tail)=ligature_node then p:=lig_char(tail) + else return; + f:=font(p); + tail_append(new_kern(char_italic(f)(char_info(f)(character(p))))); + subtype(tail):=ita_kern; + if d<>null then + begin prev_node:=tail; tail_append(d); + end; + end; +@z + +@x [47.????] pTeX: reset inhibit_glue_flag at disc_node +procedure append_discretionary; +var c:integer; {hyphen character} +begin tail_append(new_disc); +@y +procedure append_discretionary; +var c:integer; {hyphen character} +begin tail_append(new_disc); inhibit_glue_flag:=false; +@z + +@x pTeX: direction check in \discretionary +@!n:integer; {length of discretionary list} +@y +@!n:integer; {length of discretionary list} +@!d:integer; {direction} +@z + +@x pTeX: direction check in \discretionary +p:=link(head); pop_nest; +case saved(-1) of +0:pre_break(tail):=p; +1:post_break(tail):=p; +@y +p:=link(head); d:=abs(direction); pop_nest; +case saved(-1) of +0:if abs(direction)=d then pre_break(tail):=p + else begin + print_err("Direction Incompatible"); + help2("\discretionary's argument and outer hlist must have same direction.")@/ + ("I delete your first part."); error; pre_break(tail):=null; flush_node_list(p); + end; +1:if abs(direction)=d then post_break(tail):=p + else begin + print_err("Direction Incompatible"); + help2("\discretionary's argument and outer hlist must have same direction.")@/ + ("I delete your second part."); error; post_break(tail):=null; flush_node_list(p); + end; +@z + +@x pTeX: reset inhibit_glue_flag +push_nest; mode:=-hmode; space_factor:=1000; +@y +push_nest; mode:=-hmode; space_factor:=1000; inhibit_glue_flag:=false; +@z + +@x pTeX: direction check in \discretionary +else link(tail):=p; +if n<=max_quarterword then replace_count(tail):=n +@y +else if (n>0)and(abs(direction)<>d) then + begin print_err("Direction Incompatible"); + help2("\discretionary's argument and outer hlist must have same direction.")@/ + ("I delete your third part."); flush_node_list(p); n:=0; error; + end +else link(tail):=p; +if n<=max_quarterword then replace_count(tail):=n +@z + +@x [47.1120] l.22119 - pTeX: discretionary with disp_node +decr(save_ptr); return; +@y +decr(save_ptr); +prev_node:=tail; tail_append(get_node(small_node_size)); +type(tail):=disp_node; disp_dimen(tail):=0; prev_disp:=0; +return; +@z + +@x [47.1121] l.22127 - pTeX: discretionary with disp_node + begin if not is_char_node(p) then if type(p)>rule_node then + if type(p)<>kern_node then if type(p)<>ligature_node then + begin print_err("Improper discretionary list"); +@y + begin if not is_char_node(p) then + if (type(p)>rule_node)and(type(p)<>kern_node)and + (type(p)<>ligature_node)and(type(p)<>disp_node) then + if (type(p)=penalty_node)and(subtype(p)<>normal) then + begin link(q):=link(p); free_node(p,small_node_size); p:=q; + end + else + begin print_err("Improper discretionary list"); +@z + +@x [47.1123] l.22160 - pTeX: make_accent, Kanji, insert disp_node +var s,@!t: real; {amount of slant} +@y +var s,@!t: real; {amount of slant} +@!disp:scaled; {displacement} +@!cx:KANJI_code; {temporary register for KANJI} +@z + +@x [47.1123] l.22165 - pTeX: make_accent, Kanji, insert disp_node +begin scan_char_num; f:=cur_font; p:=new_character(f,cur_val); +@y +begin scan_char_num; +if not is_char_ascii(cur_val) then + begin KANJI(cx):=cur_val; + if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + p:=new_character(f,get_jfm_pos(KANJI(cx),f)); + if p<>null then + begin + link(p):=get_avail; info(link(p)):=KANJI(cx); + end; + end +else begin f:=cur_font; p:=new_character(f,cur_val); + end; +@z + +@x [47.1123] l.22175 - pTeX: make_accent, Kanji, insert disp_node + link(tail):=p; tail:=p; space_factor:=1000; +@y + link(tail):=p; + if link(p)<>null then tail:=link(p) else tail:=p; + @; + space_factor:=1000; inhibit_glue_flag:=false; +@z + +@x [47.1124] l.22180 - pTeX: make_accent Kanji, insert disp_node +q:=null; f:=cur_font; +if (cur_cmd=letter)or(cur_cmd=other_char)or(cur_cmd=char_given) then + q:=new_character(f,cur_chr) +else if cur_cmd=char_num then + begin scan_char_num; q:=new_character(f,cur_val); + end +else back_input +@y +q:=null; f:=cur_font; KANJI(cx):=empty; +if (cur_cmd=letter)or(cur_cmd=other_char) then + q:=new_character(f,cur_chr) +else if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + begin if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + cx:=cur_chr; + end +else if cur_cmd=char_given then + if is_char_ascii(cur_chr) then q:=new_character(f,cur_chr) + else begin + if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + KANJI(cx):=cur_chr + end + else if cur_cmd=char_num then + begin scan_char_num; + if is_char_ascii(cur_val) then q:=new_character(f,cur_val) + else begin + if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + KANJI(cx):=cur_val + end + end +else back_input; +if direction=dir_tate then + begin if font_dir[f]=dir_tate then disp:=0 + else if font_dir[f]=dir_yoko then disp:=t_baseline_shift-y_baseline_shift + else disp:=t_baseline_shift + end +else begin if font_dir[f]=dir_yoko then disp:=0 + else if font_dir[f]=dir_tate then disp:=y_baseline_shift-t_baseline_shift + else disp:=y_baseline_shift + end; +@; +if KANJI(cx)<>empty then + begin q:=new_character(f,get_jfm_pos(KANJI(cx),f)); + link(q):=get_avail; info(link(q)):=KANJI(cx); last_jchr:=q; + end; +@z + +@x [47.1125] l.22200 - pTeX: make_accent Kanji +if h<>x then {the accent must be shifted up or down} + begin p:=hpack(p,natural); shift_amount(p):=x-h; + end; +@y +if h<>x then {the accent must be shifted up or down} + begin delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=zero_glue; cur_xkanji_skip:=zero_glue; + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + p:=hpack(p,natural); shift_amount(p):=x-h; + end; +@z + +@x [47.1125] pTeX: make accent Kanji +tail:=new_kern(-a-delta); subtype(tail):=acc_kern; link(p):=tail; p:=q; +@y +tail:=new_kern(-a-delta); subtype(tail):=acc_kern; +if h=x then begin + if font_dir[font(p)]<>dir_default then link(link(p)):=tail + else link(p):=tail; end +else link(p):=tail; +{ bugfix: if |p| is KANJI char, |link(p)|:=|tail| collapses |p| and kern after accent. } +p:=q; +@z + +@x [48.1138] l.22385 - pTeX: init math : direction < 0 ... math direction +if (cur_cmd=math_shift)and(mode>0) then @ +else begin back_input; @; + end; +@y +if (cur_cmd=math_shift)and(mode>0) then @ +else begin back_input; @; + end; +direction:=-abs(direction); +@z + +@x [48.1145] l.22435 - pTeX: Call adjust_hlist at begin of display +else begin line_break(display_widow_penalty);@/ +@y +else if (link(head)=tail)and(not is_char_node(tail)and(type(tail)=disp_node)) then + begin free_node(tail,small_node_size); tail:=head; link(head):=null; + pop_nest; w:=-max_dimen; + end + { |disp_node|-only paragraphs are ignored } +else begin adjust_hlist(head,true); line_break(display_widow_penalty);@/ +@z + +@x [48.1147] l.22471 - pTeX: Skip kanji 2nd node, dir_node +reswitch: if is_char_node(p) then + begin f:=font(p); d:=char_width(f)(char_info(f)(character(p))); + goto found; + end; +case type(p) of +hlist_node,vlist_node,rule_node: begin d:=width(p); goto found; + end; +@y +reswitch: if is_char_node(p) then + begin f:=font(p); d:=char_width(f)(orig_char_info(f)(character(p))); + if font_dir[f]<>dir_default then p:=link(p); + goto found; + end; +case type(p) of +hlist_node,vlist_node,dir_node,rule_node: begin d:=width(p); goto found; + end; +@z + +@x [48.1150] l.22541 - pTeX: scan_math +mmode+left_brace: begin tail_append(new_noad); + back_input; scan_math(nucleus(tail)); + end; +@y +mmode+left_brace: begin tail_append(new_noad); + back_input; scan_math(nucleus(tail),kcode_noad(tail)); + end; +@z + +@x [48.1151] l.22555 - pTeX: scan_math: use Kanji in math_mode +procedure scan_math(@!p:pointer); +label restart,reswitch,exit; +var c:integer; {math character code} +begin restart:@; +reswitch:case cur_cmd of +letter,other_char,char_given: begin c:=ho(math_code(cur_chr)); + if c=@'100000 then + begin @; + goto restart; + end; + end; +@y +procedure scan_math(@!p,@!q:pointer); +label restart,reswitch,exit; +var c:integer; {math character code} +cx:KANJI_code; {temporary register for KANJI} +begin KANJI(cx):=0; +restart: @; +reswitch:case cur_cmd of +letter,other_char,char_given: + if is_char_ascii(cur_chr) then begin + c:=ho(math_code(cur_chr)); + if c=@'100000 then + begin @; + goto restart; + end; + end + else + KANJI(cx):=cur_chr; +kanji,kana,other_kchar: cx:=cur_chr; +@z + +@x [48.1151] l.22576 - pTeX: scan_math: use Kanji in math_mode +math_type(p):=math_char; character(p):=qi(c mod 256); +if (c>=var_code)and fam_in_range then fam(p):=cur_fam +else fam(p):=(c div 256) mod 16; +@y +if KANJI(cx)=0 then + begin math_type(p):=math_char; character(p):=qi(c mod 256); + if (c>=var_code)and(fam_in_range) then fam(p):=cur_fam + else fam(p):=(c div 256) mod 16; + if font_dir[fam_fnt(fam(p)+cur_size)]<>dir_default then + begin print_err("Not one-byte family"); + help1("IGNORE.");@/ + error; + end + end +else begin + if q=null then + begin math_type(p):=sub_mlist; info(p):=new_noad; + p:=nucleus(info(p)); q:=kcode_noad_nucleus(p); + end; + math_type(p):=math_jchar; fam(p):=cur_jfam; character(p):=qi(0); + math_kcode(p-1):=KANJI(cx); + if font_dir[fam_fnt(fam(p)+cur_size)]=dir_default then + begin print_err("Not two-byte family"); + help1("IGNORE.");@/ + error; + end + end; +@z + +@x [48.1154] l.22605 - pTeX: math mode +mmode+letter,mmode+other_char,mmode+char_given: + set_math_char(ho(math_code(cur_chr))); +mmode+char_num: begin scan_char_num; cur_chr:=cur_val; + set_math_char(ho(math_code(cur_chr))); + end; +@y +mmode+letter,mmode+other_char,mmode+char_given: + if is_char_ascii(cur_chr) then + set_math_char(ho(math_code(cur_chr))) + else set_math_kchar(cur_chr); +mmode+kanji,mmode+kana,mmode+other_kchar: begin + cx:=cur_chr; set_math_kchar(KANJI(cx)); + end; +mmode+char_num: begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then + set_math_char(ho(math_code(cur_chr))) + else set_math_kchar(cur_chr); + end; +@z + +@x [48.1155] l.22635 - pTeX: set_math_char + link(tail):=p; tail:=p; +@y + link(tail):=p; tail:=p; + if font_dir[fam_fnt(fam(nucleus(p))+cur_size)]<>dir_default then begin + print_err("Not one-byte family"); + help1("IGNORE.");@/ + error; + end; +@z + +@x [48.1158] l.22690 - pTeX: scan_math + type(tail):=cur_chr; scan_math(nucleus(tail)); +@y + type(tail):=cur_chr; scan_math(nucleus(tail),kcode_noad(tail)); +@z + +@x [48.1163] l.22750 - pTeX: scan_math +scan_delimiter(left_delimiter(tail),true); scan_math(nucleus(tail)); +@y +scan_delimiter(left_delimiter(tail),true); +scan_math(nucleus(tail),kcode_noad(tail)); +@z + +@x [48.1164] l.22770 - pTeX: scan_math +scan_math(nucleus(tail)); +@y +scan_math(nucleus(tail),kcode_noad(tail)); +@z + +@x [48.1164] l.22790 - pTeX: vcenter : dir + p:=vpack(link(head),saved(1),saved(0)); pop_nest; + tail_append(new_noad); type(tail):=vcenter_noad; + math_type(nucleus(tail)):=sub_box; info(nucleus(tail)):=p; + end; +@y + p:=vpack(link(head),saved(1),saved(0)); + set_box_dir(p)(direction); pop_nest; + if abs(box_dir(p))<>abs(direction) then p:=new_dir_node(p,abs(direction)); + tail_append(new_noad); type(tail):=vcenter_noad; + math_type(nucleus(tail)):=sub_box; info(nucleus(tail)):=p; + end; +@z + +@x [48.1176] l.22864 - pTeX: scan_math +scan_math(p); +@y +scan_math(p,null); +@z + +@x [48.1186] l.23006 - pTeX: copy kanji code + if math_type(supscr(p))=empty then + begin mem[saved(0)].hh:=mem[nucleus(p)].hh; +@y + if ((math_type(supscr(p))=empty)and(math_kcode(p)=null)) then + begin mem[saved(0)].hh:=mem[nucleus(p)].hh; +@z + +@x [48.1194] l.23078 - pTeX: set cur_kanji_skip, cur_xkanji_skip +var l:boolean; {`\.{\\leqno}' instead of `\.{\\eqno}'} +@y +var l:boolean; {`\.{\\leqno}' instead of `\.{\\eqno}'} +@!disp:scaled; {displacement} +@z + +@x [48.1194] l.23087 - pTeX: set cur_kanji_skip, cur_xkanji_skip +m:=mode; l:=false; p:=fin_mlist(null); {this pops the nest} +@y +delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); +if auto_spacing>0 then cur_kanji_skip:=kanji_skip +else cur_kanji_skip:=zero_glue; +if auto_xspacing>0 then cur_xkanji_skip:=xkanji_skip +else cur_xkanji_skip:=zero_glue; +add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); +m:=mode; l:=false; p:=fin_mlist(null); {this pops the nest} +@z + +@x [48.1196] l.23134 - pTeX: insert disp_node +begin tail_append(new_math(math_surround,before)); +cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist; +link(tail):=link(temp_head); +while link(tail)<>null do tail:=link(tail); +tail_append(new_math(math_surround,after)); +space_factor:=1000; unsave; +end +@y +begin if direction=dir_tate then disp:=t_baseline_shift + else disp:=y_baseline_shift; +@; +tail_append(new_math(math_surround,before)); +cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist; +link(tail):=link(temp_head); +while link(tail)<>null do tail:=link(tail); +tail_append(new_math(math_surround,after)); +@; +space_factor:=1000; inhibit_glue_flag:=false; unsave; +end +@z + +@x [48.1200] l.23203 - pTeX: adjust direction +push_nest; mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@y +push_nest; adjust_dir:=direction; inhibit_glue_flag:=false; +mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@z + +@x [48.1201] l.23217 - pTeX: free box node + begin free_node(b,box_node_size); +@y + begin delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); + free_node(b,box_node_size); +@z + +@x [48.1201] l.23222 - pTeX: free box node + begin free_node(b,box_node_size); +@y + begin delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); + free_node(b,box_node_size); +@z + +@x [49.1210] l.23361 - pTeX: set_auto_spacing +any_mode(toks_register), +any_mode(assign_toks), +any_mode(assign_int), +@y +any_mode(assign_kinsoku), +any_mode(assign_inhibit_xsp_code), +any_mode(set_auto_spacing), +any_mode(set_kansuji_char), +any_mode(toks_register), +any_mode(assign_toks), +any_mode(assign_int), +any_mode(def_jfont), +any_mode(def_tfont), +@z + +@x [49.1211] l.23397 - pTeX: prefixed_command +@t\4@>@@t@>@;@/ +procedure prefixed_command; +label done,exit; +var a:small_number; {accumulated prefix codes so far} +@y +@t\4@>@ +@@t@>@;@/ +procedure prefixed_command; +label done,exit; +var a:small_number; {accumulated prefix codes so far} +@!m:integer; {ditto} +@z + +@x [49.1217] l.23487 - pTeX: select cur font +set_font: define(cur_font_loc,data,cur_chr); +@y +set_font: begin + if font_dir[cur_chr]=dir_yoko then + define(cur_jfont_loc,data,cur_chr) + else if font_dir[cur_chr]=dir_tate then + define(cur_tfont_loc,data,cur_chr) + else + define(cur_font_loc,data,cur_chr) +end; +@z + +@x l.23504 - pTeX +primitive("futurelet",let,normal+1);@/ +@!@:future_let_}{\.{\\futurelet} primitive@> + +@ @= +let: if chr_code<>normal then print_esc("futurelet")@+else print_esc("let"); + +@ @= +let: begin n:=cur_chr; +@y +primitive("futurelet",let,normal+1);@/ +@!@:future_let_}{\.{\\futurelet} primitive@> + +@ @= +let: if chr_code<>normal then print_esc("futurelet")@+else print_esc("let"); + +@ @= +let: begin n:=cur_chr; +@z + +@x [49.1228] l.23785 - pTeX: assign jfam +assign_int: begin p:=cur_chr; scan_optional_equals; scan_int; + word_define(p,cur_val); + end; +@y +assign_int: begin p:=cur_chr; scan_optional_equals; scan_int; + if p=int_base+cur_fam_code then + begin if font_dir[fam_fnt(cur_val)]<>dir_default then + word_define(int_base+cur_jfam_code,cur_val) + else word_define(p,cur_val); + end + else word_define(p,cur_val); + end; +@z + +@x [49.1230] l.23812 - pTeX: xspcode, kcatcode +@= +primitive("catcode",def_code,cat_code_base); +@!@:cat_code_}{\.{\\catcode} primitive@> +@y +@= +primitive("catcode",def_code,cat_code_base); +@!@:cat_code_}{\.{\\catcode} primitive@> +primitive("kcatcode",def_code,kcat_code_base); +@!@:cat_code_}{\.{\\kcatcode} primitive@> +primitive("xspcode",def_code,auto_xsp_code_base); +@!@:auto_xsp_code_}{\.{\\xspcode} primitive@> +@z + +@x [49.1231] l.23842 - pTeX: xspcode, kcatcode +def_code: if chr_code=cat_code_base then print_esc("catcode") + else if chr_code=math_code_base then print_esc("mathcode") +@y +def_code: if chr_code=cat_code_base then print_esc("catcode") + else if chr_code=kcat_code_base then print_esc("kcatcode") + else if chr_code=auto_xsp_code_base then print_esc("xspcode") + else if chr_code=math_code_base then print_esc("mathcode") +@z + +@x [49.1232] l.23857 - pTeX: kcatcode +def_code: begin @; + p:=cur_chr; scan_char_num; p:=p+cur_val; scan_optional_equals; + scan_int; + if ((cur_val<0)and(pn) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + if p; + @; + p:=cur_chr; + if p=kcat_code_base then + begin scan_char_num; p:=p+kcatcodekey(cur_val) end + else begin scan_ascii_num; p:=p+cur_val; end; + scan_optional_equals; scan_int; + if ((cur_valn) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + if p= +if cur_chr=cat_code_base then n:=max_char_code +@y +@ @= +if cur_chr=kcat_code_base then m:=kanji else m:=0 + +@ @= +if cur_chr=cat_code_base then n:=invalid_char {1byte |max_char_code|} +else if cur_chr=kcat_code_base then n:=max_char_code +@z + +@x [49.1247] l.24083 - pTeX: alter_box_dimen : box_dir +procedure alter_box_dimen; +var c:small_number; {|width_offset| or |height_offset| or |depth_offset|} +@y +procedure alter_box_dimen; +var c:small_number; {|width_offset| or |height_offset| or |depth_offset|} +@!p,q:pointer; {temporary registers} +@z +@x [49.1247] l.24087 - pTeX: alter_box_dimen : box_dir +scan_normal_dimen; +if box(b)<>null then mem[box(b)+c].sc:=cur_val; +end; +@y +scan_normal_dimen; +if box(b)<>null then + begin q:=box(b); p:=link(q); + while p<>null do + begin if abs(direction)=abs(box_dir(p)) then q:=p; + p:=link(p); + end; + if abs(box_dir(q))<>abs(direction) then + begin p:=link(box(b)); link(box(b)):=null; + q:=new_dir_node(q,abs(direction)); list_ptr(q):=null; + link(q):=p; link(box(b)):=q; + end; + mem[q+c].sc:=cur_val; + end; +end; +@z + +@x [49.1256] l.24163 - pTeX: def_tfont +def_font: new_font(a); +@y +def_tfont,def_jfont,def_font: new_font(a); +@z + +@x [49.????] pTeX: new_font +get_r_token; u:=cur_cs; +@y +@; +get_r_token; u:=cur_cs; +@z + +@x [49.1292] l.24451 - pTeX: shift_case +@= +t:=info(p); +if t0 then info(p):=t-c+equiv(b+c); + end +@y +@= +t:=info(p); +if (t0 then info(p):=t-c+equiv(b+c); + end +@z + +@x [49.1291] l.24467 - pTeX: show_mode +@d show_lists_code=3 { \.{\\showlists} } +@y +@d show_lists_code=3 { \.{\\showlists} } +@d show_mode=4 { \.{\\showmode} } +@z + +@x [49.1291] l.24476 - pTeX: show_mode +primitive("showlists",xray,show_lists_code); +@!@:show_lists_code_}{\.{\\showlists} primitive@> +@y +primitive("showlists",xray,show_lists_code); +@!@:show_lists_code_}{\.{\\showlists} primitive@> +primitive("showmode",xray,show_mode); +@!@:show_mode_}{\.{\\showmode} primitive@> +@z + +@x [49.1292] l.24483 - pTeX: show_mode + othercases print_esc("show") +@y + show_mode:print_esc("showmode"); + othercases print_esc("show") +@z + +@x [49.1293] l.24495 - pTeX: show_mode +show_code: @; +@y +show_code: @; +show_mode: @; +@z + +@x dump +@!format_engine: ^text_char; +@y +@!w: four_quarters; {four ASCII codes} +@!format_engine: ^text_char; +@z + +@x undump +@!format_engine: ^text_char; +@!dummy_xord: ASCII_code; +@!dummy_xchr: text_char; +@y +@!w: four_quarters; {four ASCII codes} +@!format_engine: ^text_char; +@!dummy_xord: ASCII_code; +@!dummy_xchr: ext_ASCII_code; +@z + +@x +libc_free(format_engine);@/ +@y +libc_free(format_engine);@/ +dump_kanji(fmt_file); +@z + +@x +libc_free(format_engine); +@y +libc_free(format_engine); +undump_kanji(fmt_file); +@z + +@x +dump_things(str_pool[0], pool_ptr); +@y +for k:=0 to str_ptr do dump_int(str_start[k]); +k:=0; +while k+4= +begin +dump_things(font_check[null_font], font_ptr+1-null_font); +@y +@ @= +begin +dump_things(font_dir[null_font], font_ptr+1-null_font); +dump_things(font_enc[null_font], font_ptr+1-null_font); +dump_things(font_num_ext[null_font], font_ptr+1-null_font); +dump_things(font_check[null_font], font_ptr+1-null_font); +@z + +@x [50.1321] l.25000 - pTeX: +dump_things(char_base[null_font], font_ptr+1-null_font); +@y +dump_things(ctype_base[null_font], font_ptr+1-null_font); +dump_things(char_base[null_font], font_ptr+1-null_font); +@z + +@x [50.1322] l.25024 - pTeX: +@= +begin {Allocate the font arrays} +@y +@= +begin {Allocate the font arrays} +font_dir:=xmalloc_array(eight_bits, font_max); +font_enc:=xmalloc_array(eight_bits, font_max); +font_num_ext:=xmalloc_array(integer, font_max); +@z + +@x [50.1322] l.25040 - pTeX: +char_base:=xmalloc_array(integer, font_max); +@y +ctype_base:=xmalloc_array(integer, font_max); +char_base:=xmalloc_array(integer, font_max); +@z + +@x [50.1322] l.25050 - pTeX: +undump_things(font_check[null_font], font_ptr+1-null_font); +@y +undump_things(font_dir[null_font], font_ptr+1-null_font); +undump_things(font_enc[null_font], font_ptr+1-null_font); +undump_things(font_num_ext[null_font], font_ptr+1-null_font); +undump_things(font_check[null_font], font_ptr+1-null_font); +@z + +@x [50.1322] l.25064 - pTeX: +undump_things(char_base[null_font], font_ptr+1-null_font); +@y +undump_things(ctype_base[null_font], font_ptr+1-null_font); +undump_things(char_base[null_font], font_ptr+1-null_font); +@z + +@x + buffer:=xmalloc_array (ASCII_code, buf_size); +@y + buffer:=xmalloc_array (ASCII_code, buf_size); + buffer2:=xmalloc_array (ASCII_code, buf_size); +@z + +@x l.25363 - pTeX + font_info:=xmalloc_array (fmemory_word, font_mem_size); +@y + font_info:=xmalloc_array (memory_word, font_mem_size); +@z + +@x +fix_date_and_time;@/ +@y +last:=ptenc_conv_first_line(loc, last, buffer, buf_size); limit:=last; +fix_date_and_time;@/ +@z + +@x [51.1337] l.25563 - pTeX: + font_check:=xmalloc_array(four_quarters, font_max); +@y + font_dir:=xmalloc_array(eight_bits, font_max); + font_enc:=xmalloc_array(eight_bits, font_max); + font_num_ext:=xmalloc_array(integer, font_max); + font_check:=xmalloc_array(four_quarters, font_max); +@z + +@x [51.1337] l.25577 - pTeX: + char_base:=xmalloc_array(integer, font_max); +@y + ctype_base:=xmalloc_array(integer, font_max); + char_base:=xmalloc_array(integer, font_max); +@z + +@x [51.1337] l.25587 - pTeX: + font_ptr:=null_font; fmem_ptr:=7; +@y + font_ptr:=null_font; fmem_ptr:=7; + font_dir[null_font]:=dir_default; + font_enc[null_font]:=0; + font_num_ext[null_font]:=0; +@z + +@x [51.1337] l.25594 - pTeX: + char_base[null_font]:=0; width_base[null_font]:=0; +@y + ctype_base[null_font]:=0; char_base[null_font]:=0; width_base[null_font]:=0; +@z + +@x [53.????] new_write_whatsit, inhibit_glue_flag +write_stream(tail):=cur_val; +end; +@y +write_stream(tail):=cur_val; +inhibit_glue_flag:=false; +end; +@z + +@x [53.????] Implement \special, inhibit_glue_flag +@= +begin new_whatsit(special_node,write_node_size); write_stream(tail):=null; +p:=scan_toks(false,true); write_tokens(tail):=def_ref; +end +@y +@= +begin new_whatsit(special_node,write_node_size); write_stream(tail):=null; +p:=scan_toks(false,true); write_tokens(tail):=def_ref; +inhibit_glue_flag:=false; +end +@z + +@x [53.????] \write18{foo} (write_out in tex.ch) +@!d:integer; {number of characters in incomplete current string} +@y +@!k:integer; {loop indices} +@!d:integer; {number of characters in incomplete current string} +@z + +@x [53.????] \write18{foo} (write_out in tex.ch) + for d:=0 to cur_length-1 do + begin {|print| gives up if passed |str_ptr|, so do it by hand.} + print(so(str_pool[str_start[str_ptr]+d])); {N.B.: not |print_char|} + end; +@y + for d:=0 to cur_length-1 do + begin {|print| gives up if passed |str_ptr|, so do it by hand.} + if so(str_pool[str_start[str_ptr]+d])>=@"100 then + print_char(so(str_pool[str_start[str_ptr]+d])) + else print(so(str_pool[str_start[str_ptr]+d])); {N.B.: not |print_char|} + end; +@z + +@x [53.????] ignore "flag bit" in str_pool for system(3) + runsystem_ret := runsystem(conststringcast(addressof( + str_pool[str_start[str_ptr]]))); +@y + if name_of_file then libc_free(name_of_file); + name_of_file := xmalloc(cur_length*4+1); + k := 0; + for d:=0 to cur_length-1 do + append_to_name_escape(str_pool[str_start[str_ptr]+d]); {do not remove quote} + name_of_file[k+1] := 0; + runsystem_ret := runsystem(conststringcast(name_of_file+1)); +@z + +@x [53.????] Implement \immediate, inhibit_glue_flag + begin p:=tail; do_extension; {append a whatsit node} + out_what(tail); {do the action immediately} + flush_node_list(tail); tail:=p; link(p):=null; + end +@y + begin k:=inhibit_glue_flag; + p:=tail; do_extension; {append a whatsit node} + out_what(tail); {do the action immediately} + flush_node_list(tail); tail:=p; link(p):=null; + inhibit_glue_flag:=k; + end +@z + +@x [53.????] fix_language, inhibit_glue_flag +if l<>clang then + begin new_whatsit(language_node,small_node_size); +@y +if l<>clang then + begin inhibit_glue_flag:=false; + new_whatsit(language_node,small_node_size); +@z + +@x [53.????] set_language, inhibit_glue_flag +if abs(mode)<>hmode then report_illegal_case +else begin new_whatsit(language_node,small_node_size); +@y +if abs(mode)<>hmode then report_illegal_case +else begin inhibit_glue_flag:=false; + new_whatsit(language_node,small_node_size); +@z + +@x [53.1376] l.26309 - pTeX: +@ = +@!debug_format_file: boolean; +@y +@ = +@!debug_format_file: boolean; + +@ @= +@!debug debug_format_file:=true; @+gubed; +@z + +@x pTeX: xchr + if eight_bit_p then + for k:=0 to 255 do + xprn[k]:=1; +end; +@y + if eight_bit_p then + for k:=0 to 255 do + xprn[k]:=1; +end; +for k:=256 to 511 do xchr[k]:=k; +@z + +@x [54/web2c.???] scan_file_name_braced + for i:=str_start[s] to str_start[s+1]-1 do + dummy := more_name(str_pool[i]); {add each read character to the current file name} +@y + for i:=str_start[s] to str_start[s+1]-1 do + if str_pool[i]>=@"100 then + begin str_room(1); append_char(str_pool[i]); + end + else + dummy := more_name(str_pool[i]); {add each read character to the current file name} +@z + +@x l.26984 - pTeX +@* \[54] System-dependent changes. +@y +@* \[53b/\pTeX] The extended features for \pTeX. +This section described extended variables, procesures, functions and so on +for \pTeX. + +@= +function get_jfm_pos(@!kcode:KANJI_code;@!f:internal_font_number):eight_bits; +var @!jc:KANJI_code; {temporary register for KANJI} +@!sp,@!mp,@!ep:pointer; +begin@/ +if f=null_font then + begin get_jfm_pos:=kchar_type(null_font)(0); return; + end; +jc:=toDVI(kcode); +sp:=1; { start position } +ep:=font_num_ext[f]-1; { end position } +if (ep>=1) then { nt is larger than 1; |char_type| is non-empty } +if font_enc[f]=0 then { |kchar_code| are ordered; faster search } +begin if (kchar_code(f)(sp)<=jc)and(jc<=kchar_code(f)(ep)) then + begin while (sp <= ep) do + begin mp:=sp+((ep-sp) div 2); + if jckchar_code(f)(mp) then sp:=mp+1 + else + begin get_jfm_pos:=kchar_type(f)(mp); return; + end; + end; + end; +end +else { TFM-DVI encoding conversion; whole search } + begin while (sp <= ep) do + if jc=kchar_code(f)(sp) then + begin get_jfm_pos:=kchar_type(f)(sp); return; + end + else incr(sp); + end; +get_jfm_pos:=kchar_type(f)(0); +end; + +@ The function |scan_keyword_noexpand| is used to scan a keyword +preceding possibly undefined control sequence. +It is used while scanning \.{\\font} with JFM encoding specification. + +@= +function scan_keyword_noexpand(@!s:str_number):boolean; +label exit; +var p:pointer; {tail of the backup list} +@!q:pointer; {new node being added to the token list via |store_new_token|} +@!k:pool_pointer; {index into |str_pool|} +begin p:=backup_head; link(p):=null; k:=str_start[s]; +while kspacer)or(p<>backup_head) then + begin back_input; + if p<>backup_head then back_list(link(backup_head)); + scan_keyword_noexpand:=false; return; + end; + end; +flush_list(link(backup_head)); scan_keyword_noexpand:=true; +exit:end; + +@ @= +begin jfm_enc:=0; +if scan_keyword_noexpand("in") then + if scan_keyword_noexpand("jis") then jfm_enc:=1 + else if scan_keyword_noexpand("ucs") then jfm_enc:=2 + else begin + print_err("Unknown TFM encoding"); +@.Unknown TFM encoding@> + help1("TFM encoding specification is ignored.");@/ + error; + end; +end + +@ Following codes are used to calculate a KANJI width and height. + +@= +@!t: eight_bits; + +@ @= +if direction=dir_tate then + v:=char_width(cur_tfont)(orig_char_info(cur_tfont)(qi(0))) +else + v:=char_width(cur_jfont)(orig_char_info(cur_jfont)(qi(0))) + +@ @= +if direction=dir_tate then begin + t:=height_depth(orig_char_info(cur_tfont)(qi(0))); + v:=char_height(cur_tfont)(t)+char_depth(cur_tfont)(t); +end else begin + t:=height_depth(orig_char_info(cur_jfont)(qi(0))); + v:=char_height(cur_jfont)(t)+char_depth(cur_jfont)(t); +end + +@ set a kansuji character. + +@ @= +primitive("kansujichar",set_kansuji_char,0); +@!@:kansujichar_}{\.{\\kansujichar} primitive@> + +@ @= +set_kansuji_char: print_esc("kansujichar"); + +@ @= +set_kansuji_char: +begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int; +if not is_char_kanji(cur_val) then + begin print_err("Invalid KANSUJI char ("); + print_hex_safe(cur_val); print_char(")"); +@.Invalid KANSUJI char@> + help1("I'm skipping this control sequences.");@/ + error; return; + end +else if (n<0)or(n>9) then + begin print_err("Invalid KANSUJI number ("); print_int(n); print_char(")"); +@.Invalid KANSUJI number@> + help1("I'm skipping this control sequences.");@/ + error; return; + end +else + define(kansuji_base+n,n,tokanji(toDVI(cur_val))); +end; + +@ @= +begin scan_int; cur_val_level:=int_val; + if (cur_val<0)or(cur_val>9) then + begin print_err("Invalid KANSUJI number ("); print_int(cur_val); print_char(")"); + help1("I'm skipping this control sequences.");@/ + error; return; + end + else + cur_val:=fromDVI(kansuji_char(cur_val)); +end + +@ |print_kansuji| procedure converts a number to KANJI number. + +@ @= +procedure print_kansuji(@!n:integer); +var @!k:0..23; {index to current digit; we assume that $|n|<10^{23}$} +@!cx: KANJI_code; {temporary register for KANJI} +begin k:=0; + if n<0 then return; {nonpositive input produces no output} + repeat dig[k]:=n mod 10; n:=n div 10; incr(k); + until n=0; + begin while k>0 do + begin decr(k); + cx:=kansuji_char(dig[k]); + print_kanji(fromDVI(cx)); + end; + end; +end; + +@ \pTeX\ inserts a glue specified by \.{\\kanjiskip} between 2byte-characters, +automatically, if \.{\\autospacing}. This glue is suppressed by +\.{\\noautospacing}. +\.{\\xkanjiskip}, \.{\\noautoxspacing}, \.{\\autoxspacing}, \.{\\xspcode} is +used to control between 2byte and 1byte characters. + +@d reset_auto_spacing_code=0 +@d set_auto_spacing_code=1 +@d reset_auto_xspacing_code=2 +@d set_auto_xspacing_code=3 + +@= +primitive("autospacing",set_auto_spacing,set_auto_spacing_code); +@!@:auto_spacing_}{\.{\\autospacing} primitive@> +primitive("noautospacing",set_auto_spacing,reset_auto_spacing_code); +@!@:no_auto_spacing_}{\.{\\noautospacing} primitive@> +primitive("autoxspacing",set_auto_spacing,set_auto_xspacing_code); +@!@:auto_xspacing_}{\.{\\autoxspacing} primitive@> +primitive("noautoxspacing",set_auto_spacing,reset_auto_xspacing_code); +@!@:no_auto_xspacing_}{\.{\\noautoxspacing} primitive@> + +@ @= +set_auto_spacing:begin + if (chr_code mod 2)=0 then print_esc("noauto") else print_esc("auto"); + if chr_code<2 then print("spacing") else print("xspacing"); +end; + +@ @= +set_auto_spacing:begin + if cur_chr<2 then p:=auto_spacing_code + else begin p:=auto_xspacing_code; cur_chr:=(cur_chr mod 2); end; + define(p,data,cur_chr); +end; + +@ Following codes are used in section 49. + +@= +begin print_nl("> "); +if auto_spacing>0 then print("auto spacing mode; ") + else print("no auto spacing mode; "); +print_nl("> "); +if auto_xspacing>0 then print("auto xspacing mode") + else print("no auto xspacing mode"); +goto common_ending; +end + +@ The \.{\\inhibitglue} primitive control to insert a glue specified +JFM (Japanese Font Metic) file. The \.{\\inhibitxspcode} is used to control +inserting a space between 2byte-char and 1byte-char. + +@d inhibit_both=0 {disable to insert space before 2byte-char and after it} +@d inhibit_previous=1 {disable to insert space before 2byte-char} +@d inhibit_after=2 {disable to insert space after 2byte-char} +@d inhibit_none=3 {enable to insert space before/after 2byte-char} +@d inhibit_unused=4 {unused entry} +@d no_entry=10000 +@d new_pos=0 +@d cur_pos=1 + +@ @= + any_mode(inhibit_glue): inhibit_glue_flag:=(cur_chr=0); + +@ @= +primitive("inhibitglue",inhibit_glue,0); +@!@:inhibit_glue_}{\.{\\inhibitglue} primitive@> +primitive("disinhibitglue",inhibit_glue,1); +@!@:dis_inhibit_glue_}{\.{\\disinhibitglue} primitive@> +primitive("inhibitxspcode",assign_inhibit_xsp_code,inhibit_xsp_code_base); +@!@:inhibit_xsp_code_}{\.{\\inhibitxspcode} primitive@> + +@ @= +inhibit_glue: if (chr_code>0) then print_esc("disinhibitglue") + else print_esc("inhibitglue"); +assign_inhibit_xsp_code: print_esc("inhibitxspcode"); + +@ @= +function get_inhibit_pos(c:KANJI_code; n:small_number):pointer; +label done, done1; +var p,pp,s:pointer; +begin s:=calc_pos(c); p:=s; pp:=no_entry; +if n=new_pos then + begin repeat + if inhibit_xsp_code(p)=c then goto done; { found, update there } + if inhibit_xsp_code(p)=0 then { no further scan needed } + begin if pp<>no_entry then p:=pp; goto done; end; + if inhibit_xsp_type(p)=inhibit_unused then + if pp=no_entry then pp:=p; { save the nearest unused hash } + incr(p); if p>1023 then p:=0; + until s=p; + p:=pp; + end +else + begin repeat + if inhibit_xsp_code(p)=0 then goto done1; + if inhibit_xsp_code(p)=c then goto done; + incr(p); if p>1023 then p:=0; + until s=p; +done1: p:=no_entry; + end; +done: get_inhibit_pos:=p; +end; + +@ @= +assign_inhibit_xsp_code: +begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int; +if is_char_kanji(n) then + begin j:=get_inhibit_pos(tokanji(n),new_pos); + if (j<>no_entry)and(cur_val>inhibit_after) then + begin if global or(cur_level=level_one) then cur_val:=inhibit_unused + { remove the entry from inhibit table } + else cur_val:=inhibit_none; end + else if j=no_entry then + begin print_err("Inhibit table is full!!"); + help1("I'm skipping this control sequences.");@/ + error; return; end; + define(inhibit_xsp_code_base+j,cur_val,n); + end +else + begin print_err("Invalid KANJI code ("); print_hex_safe(n); print_char(")"); +@.Invalid KANJI code@> + help1("I'm skipping this control sequences.");@/ + error; return; + end; +end; + +@ @= +begin scan_int; q:=get_inhibit_pos(tokanji(cur_val),cur_pos); +cur_val_level:=int_val; cur_val:=inhibit_none; +if q<>no_entry then cur_val:=inhibit_xsp_type(q); +if cur_val>inhibit_none then cur_val:=inhibit_none; +end + +@ The \.{\\prebreakpenalty} is used to specified amount of penalties inserted +before the 2byte-char which is first argument of this primitive. +The \.{\\postbreakpenalty} is inserted after the 2byte-char. + +@d pre_break_penalty_code=1 +@d post_break_penalty_code=2 +@d kinsoku_unused_code=3 + +@= +primitive("prebreakpenalty",assign_kinsoku,pre_break_penalty_code); +@!@:pre_break_penalty_}{\.{\\prebreakpenalty} primitive@> +primitive("postbreakpenalty",assign_kinsoku,post_break_penalty_code); +@!@:post_break_penalty_}{\.{\\postbreakpenalty} primitive@> + +@ @= +assign_kinsoku: case chr_code of + pre_break_penalty_code: print_esc("prebreakpenalty"); + post_break_penalty_code: print_esc("postbreakpenalty"); + endcases; + +@ @= +function get_kinsoku_pos(c:KANJI_code; n:small_number):pointer; +label done, done1; +var p,pp,s:pointer; +begin s:=calc_pos(c); p:=s; pp:=no_entry; +@!debug +print_ln; print("c:="); print_int(c); print(", p:="); print_int(s); +if p+kinsoku_base<0 then + begin print("p is negative value"); print_ln; + end; +gubed +if n=new_pos then + begin repeat + if kinsoku_code(p)=c then goto done; { found, update there } + if kinsoku_type(p)=0 then { no further scan needed } + begin if pp<>no_entry then p:=pp; goto done; end; + if kinsoku_type(p)=kinsoku_unused_code then + if pp=no_entry then pp:=p; { save the nearest unused hash } + incr(p); if p>1023 then p:=0; + until s=p; + p:=pp; + end +else + begin repeat + if kinsoku_type(p)=0 then goto done1; + if kinsoku_code(p)=c then goto done; + incr(p); if p>1023 then p:=0; + until s=p; +done1: p:=no_entry; + end; +done: get_kinsoku_pos:=p; +end; + +@ @= +assign_kinsoku: +begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int; +if is_char_ascii(n) or is_char_kanji(n) then + begin j:=get_kinsoku_pos(tokanji(n),new_pos); + if (j<>no_entry)and(cur_val=0)and(global or(cur_level=level_one)) then + define(kinsoku_base+j,kinsoku_unused_code,0) { remove the entry from KINSOKU table } + else begin + if j=no_entry then begin + print_err("KINSOKU table is full!!"); + help1("I'm skipping this control sequences.");@/ + error; return; end; + if (p=pre_break_penalty_code)or(p=post_break_penalty_code) then + begin define(kinsoku_base+j,p,tokanji(n)); + word_define(kinsoku_penalty_base+j,cur_val); + end + else confusion("kinsoku"); +@:this can't happen kinsoku}{\quad kinsoku@> + end + end +else + begin print_err("Invalid KANJI code for "); + if p=pre_break_penalty_code then print("pre") + else if p=post_break_penalty_code then print("post") + else print_char("?"); + print("breakpenalty ("); print_hex_safe(n); print_char(")"); +@.Invalid KANJI code@> + help1("I'm skipping this control sequences.");@/ + error; return; + end; +end; + +@ @= +begin scan_int; q:=get_kinsoku_pos(tokanji(cur_val),cur_pos); +cur_val_level:=int_val; cur_val:=0; +if (q<>no_entry)and(m=kinsoku_type(q)) then + scanned_result(kinsoku_penalty(q))(int_val); +end + +@ Following codes are used in |main_control|. + +@= +begin kp:=get_kinsoku_pos(cx,cur_pos); +if kp<>no_entry then if kinsoku_penalty(kp)<>0 then + begin if kinsoku_type(kp)=pre_break_penalty_code then + begin if not is_char_node(cur_q)and(type(cur_q)=penalty_node) then + penalty(cur_q):=penalty(cur_q)+kinsoku_penalty(kp) + else + begin main_p:=link(cur_q); link(cur_q):=new_penalty(kinsoku_penalty(kp)); + subtype(link(cur_q)):=kinsoku_pena; link(link(cur_q)):=main_p; + end; + end + else if kinsoku_type(kp)=post_break_penalty_code then + begin tail_append(new_penalty(kinsoku_penalty(kp))); + subtype(tail):=kinsoku_pena; + end; + end; +end; + +@ @= +begin kp:=get_kinsoku_pos(cur_chr,cur_pos); +if kp<>no_entry then if kinsoku_penalty(kp)<>0 then + begin if kinsoku_type(kp)=pre_break_penalty_code then + if not is_char_node(tail)and(type(tail)=penalty_node) then + penalty(tail):=penalty(tail)+kinsoku_penalty(kp) + else + begin tail_append(new_penalty(kinsoku_penalty(kp))); + subtype(tail):=kinsoku_pena; + end; + end; +end; + +@ @= +begin kp:=get_kinsoku_pos(cx,cur_pos); +if kp<>no_entry then if kinsoku_penalty(kp)<>0 then + begin if kinsoku_type(kp)=post_break_penalty_code then + begin tail_append(new_penalty(kinsoku_penalty(kp))); + subtype(tail):=kinsoku_pena; + end; + end; +end; + +@ This is a part of section 32. + +The procedure |synch_dir| is used in |hlist_out| and |vlist_out|. + +@d dvi_yoko=0 +@d dvi_tate=1 +@d dvi_dtou=3 + +@= +@!dvi_dir:integer; {a \.{DVI} reader program thinks we direct to} +@!cur_dir_hv:integer; {\TeX\ thinks we direct to} +@!page_dir:eight_bits; + +@ @= +page_dir:=dir_yoko; + +@ @= +procedure synch_dir; +var tmp:scaled; {temporary resister} +begin + case cur_dir_hv of + dir_yoko: + if dvi_dir<>cur_dir_hv then begin + synch_h; synch_v; dvi_out(dirchg); dvi_out(dvi_yoko); + dir_used:=true; + case dvi_dir of + dir_tate: begin tmp:=cur_h; cur_h:=-cur_v; cur_v:=tmp end; + dir_dtou: begin tmp:=cur_h; cur_h:=cur_v; cur_v:=-tmp end; + endcases; + dvi_h:=cur_h; dvi_v:=cur_v; dvi_dir:=cur_dir_hv; + end; + dir_tate: + if dvi_dir<>cur_dir_hv then begin + synch_h; synch_v; dvi_out(dirchg); dvi_out(dvi_tate); + dir_used:=true; + case dvi_dir of + dir_yoko: begin tmp:=cur_h; cur_h:=cur_v; cur_v:=-tmp end; + dir_dtou: begin cur_v:=-cur_v; cur_h:=-cur_h; end; + endcases; + dvi_h:=cur_h; dvi_v:=cur_v; dvi_dir:=cur_dir_hv; + end; + dir_dtou: + if dvi_dir<>cur_dir_hv then begin + synch_h; synch_v; dvi_out(dirchg); dvi_out(dvi_dtou); + dir_used:=true; + case dvi_dir of + dir_yoko: begin tmp:=cur_h; cur_h:=-cur_v; cur_v:=tmp end; + dir_tate: begin cur_v:=-cur_v; cur_h:=-cur_h; end; + endcases; + dvi_h:=cur_h; dvi_v:=cur_v; dvi_dir:=cur_dir_hv; + end; + othercases + confusion("synch_dir"); + endcases +end; + +@ This function is called from |adjust_hlist| to check, whether +a list which pointed |box_p| contains a printing character. +If the list contains such a character, then return `true', otherwise `false'. +If the first matter is a character, |first_char| is stored it. +|last_char| is stored a last character. If no printing characters exist +in the list, |first_char| and |last_char| is null. +@^recursion@> + +Note that |first_char| and |last_char| may be |math_node|. + +@= +@!first_char:pointer; {first printable character} +@!last_char:pointer; {last printable character} +@!find_first_char:boolean; {find for a first printable character?} + +@ @= +function check_box(box_p:pointer):boolean; +label done; +var @!p:pointer; {run through the current box} +@!flag:boolean; {found any printable character?} +begin flag:=false; p:=box_p; +while p<>null do + begin if is_char_node(p) then + repeat + if find_first_char then + begin first_char:=p; find_first_char:=false + end; + last_char:=p; flag:=true; + if font_dir[font(p)]<>dir_default then p:=link(p); + p:=link(p); + if p=null then goto done; + until not is_char_node(p); + case type(p) of + hlist_node: + begin flag:=true; + if shift_amount(p)=0 then + begin if check_box(list_ptr(p)) then flag:=true; + end + else if find_first_char then find_first_char:=false + else last_char:=null; + end; + ligature_node: if check_box(lig_ptr(p)) then flag:=true; + ins_node,disp_node,mark_node,adjust_node,whatsit_node,penalty_node: + do_nothing; + math_node: + if (subtype(p)=before)or(subtype(p)=after) then + begin if find_first_char then + begin find_first_char:=false; first_char:=p; + end; + last_char:=p; flag:=true; + end + else do_nothing; {\.{\\beginR} etc.} + kern_node: + if subtype(p)=acc_kern then + begin p:=link(p); + if is_char_node(p) then + if font_dir[font(p)]<>dir_default then p:=link(p); + p:=link(link(p)); + if find_first_char then + begin find_first_char:=false; first_char:=p; + end; + last_char:=p; flag:=true; + if font_dir[font(p)]<>dir_default then p:=link(p); + end + else + begin flag:=true; + if find_first_char then find_first_char:=false + else last_char:=null; + end; + othercases begin flag:=true; + if find_first_char then find_first_char:=false + else last_char:=null; + end; + endcases; + p:=link(p); + end; +done: check_box:=flag; +end; + +@ Following procedure |adjust_hlist| inserts \.{\\xkanjiskip} between +2byte-char and 1byte-char in hlist which pointed |p|. +Note that the skip is inserted into a place where too difficult to decide +whether inserting or not (i.e, before penalty, after penalty). + +If |pf| is true then insert |jchr_widow_penalty| that is penalty for +creating a widow KANJI character line. + +@d no_skip=0 +@d after_schar=1 {denote after single byte character} +@d after_wchar=2 {denote after double bytes character} + +@= +procedure adjust_hlist(p:pointer;pf:boolean); +label exit; +var q,s,t,u,v,x,z:pointer; + i,k:halfword; + a: pointer; { temporary pointer for accent } + insert_skip:no_skip..after_wchar; + cx:KANJI_code; {temporary register for KANJI character} + ax:ASCII_code; {temporary register for ASCII character} + do_ins:boolean; {for inserting |xkanji_skip| into previous (or after) KANJI} +begin if link(p)=null then goto exit; +if auto_spacing>0 then + begin delete_glue_ref(space_ptr(p)); space_ptr(p):=kanji_skip; + add_glue_ref(kanji_skip); + end; +if auto_xspacing>0 then + begin delete_glue_ref(xspace_ptr(p)); xspace_ptr(p):=xkanji_skip; + add_glue_ref(xkanji_skip); + end; +u:=space_ptr(p); add_glue_ref(u); +s:=xspace_ptr(p); add_glue_ref(s); +if not is_char_node(link(p)) then + if (type(link(p))=glue_node)and(subtype(link(p))=jfm_skip+1) then + begin v:=link(p); link(p):=link(v); + fast_delete_glue_ref(glue_ptr(v)); free_node(v,small_node_size); + end + else if (type(link(p))=penalty_node)and(subtype(link(p))=kinsoku_pena) then + begin v:=link(link(p)); + if (not is_char_node(v)) and (type(v)=glue_node)and(subtype(v)=jfm_skip+1) then + begin link(link(p)):=link(v); + fast_delete_glue_ref(glue_ptr(v)); free_node(v,small_node_size); + end + end; + +i:=0; insert_skip:=no_skip; p:=link(p); v:=p; q:=p; +while p<>null do + begin if is_char_node(p) then + begin repeat @; + q:=p; p:=link(p); incr(i); + if (i>5)and pf then + begin if is_char_node(v) then + if font_dir[font(v)]<>dir_default then v:=link(v); + v:=link(v); + end; + until not is_char_node(p); + end + else + begin case type(p) of + hlist_node: @; + ligature_node: @; + penalty_node,disp_node: @; + kern_node: if subtype(p)=explicit then insert_skip:=no_skip + else if subtype(p)=acc_kern then begin + { When we insert \.{\\xkanjiskip}, we first ignore accent (and kerns) and + insert \.{\\xkanjiskip}, then we recover the accent. } + if q=p then begin t:=link(p); + { if p is beginning on the list, we have only to ignore nodes. } + if is_char_node(t) then + if font_dir[font(t)]<>dir_default then t:=link(t); + p:=link(link(t)); + if font_dir[font(p)]<>dir_default then + begin p:=link(p); insert_skip:=after_wchar; end + else insert_skip:=after_schar; + end + else begin + a:=p; t:=link(p); + if is_char_node(t) then + if font_dir[font(t)]<>dir_default then t:=link(t); + t:=link(link(t)); link(q):=t; p:=t; + @; incr(i); + if (i>5)and pf then + begin if is_char_node(v) then + if font_dir[font(v)]<>dir_default then v:=link(v); + v:=link(v); + end; + if link(q)<>t then link(link(q)):=a else link(q):=a; + end; + end; + math_node: @; + mark_node,adjust_node,ins_node,whatsit_node: + {These nodes are vanished when typeset is done} + do_nothing; + othercases insert_skip:=no_skip; + endcases; + q:=p; p:=link(p); + end; + end; +if not is_char_node(q)and(type(q)=glue_node)and(subtype(q)=jfm_skip+1) then + begin fast_delete_glue_ref(glue_ptr(q)); + glue_ptr(q):=zero_glue; add_glue_ref(zero_glue); + end; +delete_glue_ref(u); delete_glue_ref(s); +if (v<>null)and pf and(i>5) then @; +exit: +end; + +@ @= +if font_dir[font(p)]<>dir_default then + begin KANJI(cx):=info(link(p)); + if insert_skip=after_schar then @; + p:=link(p); insert_skip:=after_wchar; + end +else + begin ax:=qo(character(p)); + if insert_skip=after_wchar then @; + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end + +@ @= +begin find_first_char:=true; first_char:=null; last_char:=null; +if shift_amount(p)=0 then + begin if check_box(list_ptr(p)) then + begin if first_char<>null then @; + if last_char<>null then + begin @; + end else insert_skip:=no_skip; + end else insert_skip:=no_skip; + end else insert_skip:=no_skip; +end + +@ @= +if type(first_char)=math_node then + begin ax:=qo("0"); + if insert_skip=after_wchar then @; + end +else if font_dir[font(first_char)]<>dir_default then + begin KANJI(cx):=info(link(first_char)); + if insert_skip=after_schar then @ + else if insert_skip=after_wchar then @; + end +else + begin ax:=qo(character(first_char)); + if insert_skip=after_wchar then @; + end; + +@ @= +if type(last_char)=math_node then + begin ax:=qo("0"); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end +else if font_dir[font(last_char)]<>dir_default then + begin insert_skip:=after_wchar; KANJI(cx):=info(link(last_char)); + if is_char_node(link(p))and(font_dir[font(link(p))]<>dir_default) then + begin @; p:=link(p); + end; + end +else + begin ax:=qo(character(last_char)); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end; + +@ @= +begin if (subtype(p)=before)and(insert_skip=after_wchar) then + begin ax:=qo("0"); @; + insert_skip:=no_skip; + end +else if subtype(p)=after then + begin ax:=qo("0"); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end +else insert_skip:=no_skip; +end + +@ @= +begin t:=lig_ptr(p); +if is_char_node(t) then + begin ax:=qo(character(t)); + if insert_skip=after_wchar then @; + while link(t)<>null do t:=link(t); + if is_char_node(t) then + begin ax:=qo(character(t)); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end; + end; +end + +@ @= +begin if is_char_node(link(p)) then + begin q:=p; p:=link(p); + if font_dir[font(p)]<>dir_default then + begin KANJI(cx):=info(link(p)); + if insert_skip=after_schar then @ + else if insert_skip=after_wchar then @; + p:=link(p); insert_skip:=after_wchar; + end + else + begin ax:=qo(character(p)); + if insert_skip=after_wchar then @; + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end; + end +end + +@ @= +begin + begin x:=get_inhibit_pos(cx,cur_pos); + if x<>no_entry then + if (inhibit_xsp_type(x)=inhibit_both)or + (inhibit_xsp_type(x)=inhibit_previous) then + do_ins:=false else do_ins:=true + else do_ins:=true; + end; +if do_ins then + begin z:=new_glue(s); subtype(z):=xkanji_skip_code+1; + link(z):=link(q); link(q):=z; q:=z; + end; +end + +@ @= +begin if (auto_xsp_code(ax) mod 2)=1 then + begin x:=get_inhibit_pos(cx,cur_pos); + if x<>no_entry then + if (inhibit_xsp_type(x)=inhibit_both)or + (inhibit_xsp_type(x)=inhibit_after) then + do_ins:=false else do_ins:=true + else do_ins:=true; + end +else do_ins:=false; +if do_ins then + begin z:=new_glue(s); subtype(z):=xkanji_skip_code+1; + link(z):=link(q); link(q):=z; q:=z; + end; +end + +@ @= +begin z:=new_glue(u); subtype(z):=kanji_skip_code+1; +link(z):=link(q); link(q):=z; q:=z; +end + +@ @= +begin z:=new_glue(u); subtype(z):=kanji_skip_code+1; +link(z):=link(p); link(p):=z; p:=link(z); q:=z; +end + +@ @= +begin q:=v; p:=link(v); +if is_char_node(v)and(font_dir[font(v)]<>dir_default) then + begin q:=p; p:=link(p); + end; +t:=q; s:=null; +@; +if s<>null then + begin s:=link(t); + if not is_char_node(s)and(type(s)=penalty_node) then + penalty(s):=penalty(s)+jchr_widow_penalty + else if jchr_widow_penalty<>0 then + begin s:=new_penalty(jchr_widow_penalty); subtype(s):=widow_pena; + link(s):=link(t); link(t):=s; t:=link(s); + while(not is_char_node(t)) do + begin if (type(t)=glue_node)or(type(t)=kern_node) then goto exit; + t:=link(t); + end; + z:=new_glue(u); subtype(z):=kanji_skip_code+1; + link(z):=link(s); link(s):=z; + end; + end; +end; + +@ @= +k:=0; +while(p<>null) do +begin if is_char_node(p) then + begin if font_dir[font(p)]<>dir_default then + begin KANJI(cx):=info(link(p)); i:=kcat_code(kcatcodekey(cx)); k:=0; + if (i=kanji)or(i=kana) then begin t:=q; s:=p; end; + p:=link(p); q:=p; + end + else begin k:=k+1; + if k>1 then begin q:=p; s:=null; end; + end; + end +else begin case type(p) of + penalty_node,mark_node,adjust_node,whatsit_node, + glue_node,kern_node,math_node,disp_node: + do_nothing; + othercases begin q:=p; s:=null; end; + endcases; + end; +p:=link(p); +end + +@ @= +procedure dir_out; +var @!this_box: pointer; {pointer to containing box} +begin this_box:=temp_ptr; + temp_ptr:=list_ptr(this_box); + if (type(temp_ptr)<>hlist_node)and(type(temp_ptr)<>vlist_node) then + confusion("dir_out"); + case abs(box_dir(this_box)) of + dir_yoko: + case abs(box_dir(temp_ptr)) of + dir_tate: {Tate in Yoko} + begin cur_v:=cur_v-height(this_box); cur_h:=cur_h+depth(temp_ptr) end; + dir_dtou: {DtoU in Yoko} + begin cur_v:=cur_v+depth(this_box); cur_h:=cur_h+height(temp_ptr) end; + endcases; + dir_tate: + case abs(box_dir(temp_ptr)) of + dir_yoko: {Yoko in Tate} + begin cur_v:=cur_v+depth(this_box); cur_h:=cur_h+height(temp_ptr) end; + dir_dtou: {DtoU in Tate} + begin + cur_v:=cur_v+depth(this_box)-height(temp_ptr); + cur_h:=cur_h+width(temp_ptr) + end; + endcases; + dir_dtou: + case abs(box_dir(temp_ptr)) of + dir_yoko: {Yoko in DtoU} + begin cur_v:=cur_v-height(this_box); cur_h:=cur_h+depth(temp_ptr) end; + dir_tate: {Tate in DtoU} + begin + cur_v:=cur_v+depth(this_box)-height(temp_ptr); + cur_h:=cur_h+width(temp_ptr) + end; + endcases; + endcases; + cur_dir_hv:=abs(box_dir(temp_ptr)); + if type(temp_ptr)=vlist_node then vlist_out@+else hlist_out; +end; + +@ These routines are used to output diagnostic which related direction. + +@ @= +procedure print_dir(@!dir:eight_bits); {prints |dir| data} +begin if dir=dir_yoko then print_char("Y") +else if dir=dir_tate then print_char("T") +else if dir=dir_dtou then print_char("D") +end; +@# +procedure print_direction(@!d:integer); {print the direction represented by d} +begin case abs(d) of +dir_yoko: print("yoko"); +dir_tate: print("tate"); +dir_dtou: print("dtou"); +end; +if d<0 then print("(math)"); +print(" direction"); +end; + +@ The procedure |set_math_kchar| is same as |set_math_char| which is +written in section 48. + +@= +procedure set_math_kchar(@!c:integer); +var p:pointer; {the new noad} +begin p:=new_noad; math_type(nucleus(p)):=math_jchar; +character(nucleus(p)):=qi(0); +math_kcode(p):=c; fam(nucleus(p)):=cur_jfam; +if font_dir[fam_fnt(fam(nucleus(p))+cur_size)]=dir_default then + begin print_err("Not two-byte family"); + help1("IGNORE.");@/ + error; + end; +type(p):=ord_noad; +link(tail):=p; tail:=p; +end; + +@ This section is a part of |main_control|. + +@= +if is_char_node(tail) then + begin if not( (last_jchr<>null) and (link(last_jchr)=tail) ) then + begin cx:=qo(character(tail)); @; + end; + end +else if type(tail)=ligature_node then + begin cx:=qo(character(lig_char(tail))); @; + end; +if direction=dir_tate then + begin if font_dir[main_f]=dir_tate then disp:=0 + else if font_dir[main_f]=dir_yoko then disp:=t_baseline_shift-y_baseline_shift + else disp:=t_baseline_shift; + main_f:=cur_tfont; + end +else + begin if font_dir[main_f]=dir_yoko then disp:=0 + else if font_dir[main_f]=dir_tate then disp:=y_baseline_shift-t_baseline_shift + else disp:=y_baseline_shift; + main_f:=cur_jfont; + end; +@; +ins_kp:=false; ligature_present:=false; +cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); +main_i:=orig_char_info(main_f)(qi(0)); +goto main_loop_j+3; +@# +main_loop_j+1: space_factor:=1000; + if main_f<>null_font then + begin if not disp_called then + begin prev_node:=tail; tail_append(get_node(small_node_size)); + type(tail):=disp_node; disp_dimen(tail):=0; disp_called:=true + end; + fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l; + link(tail):=main_p; tail:=main_p; last_jchr:=tail; + fast_get_avail(main_p); info(main_p):=KANJI(cur_chr); + link(tail):=main_p; tail:=main_p; + cx:=cur_chr; @; + end; + ins_kp:=false; +again_2: + get_next; + main_i:=orig_char_info(main_f)(cur_l); + case cur_cmd of + kanji,kana,other_kchar: begin + cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); goto main_loop_j+3; + end; + letter,other_char: begin ins_kp:=true; cur_l:=qi(0); goto main_loop_j+3; + end; + endcases; + x_token; + case cur_cmd of + kanji,kana,other_kchar: cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); + letter,other_char: begin ins_kp:=true; cur_l:=qi(0); end; + char_given: begin + if is_char_ascii(cur_chr) then + begin ins_kp:=true; cur_l:=qi(0); + end + else cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); + end; + char_num: begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then + begin ins_kp:=true; cur_l:=qi(0); + end + else cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); + end; + inhibit_glue: begin inhibit_glue_flag:=(cur_chr=0); goto again_2; end; + othercases begin ins_kp:=max_halfword; + cur_l:=qi(-1); cur_r:=non_char; lig_stack:=null; + end; + endcases; +@# +main_loop_j+3: + if ins_kp=true then @; + if main_f<>null_font then + begin @; + end + else inhibit_glue_flag:=false; + if ins_kp=false then begin { Kanji -> Kanji } + goto main_loop_j+1; + end else if ins_kp=true then begin { Kanji -> Ascii } + {@@;} + ins_kp:=false; goto main_loop; + end else begin { Kanji -> cs } + {@@;} + goto reswitch; + end; + +@ @= +begin if not is_char_node(tail)and(type(tail)=disp_node) then + begin if prev_disp=disp then + begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null; + end + else disp_dimen(tail):=disp; + end +else + if disp<>0 or not disp_called then + begin prev_node:=tail; tail_append(get_node(small_node_size)); + type(tail):=disp_node; disp_dimen(tail):=disp; prev_disp:=disp; + disp_called:=true + end; +end; + +@ @= +if disp<>0 then +begin if not is_char_node(tail)and(type(tail)=disp_node) then + begin disp_dimen(tail):=0; + end +else + begin prev_node:=tail; tail_append(get_node(small_node_size)); + type(tail):=disp_node; disp_dimen(tail):=0; prev_disp:=disp; + disp_called:=true + end; +end; + +@ @= +cur_q:=tail; +if inhibit_glue_flag<>true then + begin + if cur_lstop_flag then {huge glue/kern table rearranged} + begin main_k:=glue_kern_restart(main_f)(main_j); + main_j:=font_info[main_k].qqqq; + end; + loop@+begin if next_char(main_j)=cur_l then if skip_byte(main_j)<=stop_flag then + begin if op_byte(main_j)null then + begin while((type(gp)<>cur_r)and(link(gp)<>null)) do gp:=link(gp); + gq:=glue_ptr(gp); + end + else + begin gp:=get_node(small_node_size); font_glue[main_f]:=gp; + gq:=null; + end; + if gq=null then + begin type(gp):=cur_r; gq:=new_spec(zero_glue); + glue_ptr(gp):=gq; + main_k:=exten_base[main_f]+qi((qo(cur_r))*3); + width(gq):=font_info[main_k].sc; + stretch(gq):=font_info[main_k+1].sc; + shrink(gq):=font_info[main_k+2].sc; + add_glue_ref(gq); link(gp):=get_node(small_node_size); + gp:=link(gp); glue_ptr(gp):=null; link(gp):=null; + end; + tail_append(new_glue(gq)); subtype(tail):=jfm_skip+1; + goto skip_loop; + end + else begin + tail_append(new_kern(char_kern(main_f)(main_j))); + goto skip_loop; + end; + end; + if skip_byte(main_j)>=stop_flag then goto skip_loop; + main_k:=main_k+qo(skip_byte(main_j))+1; {SKIP property} + main_j:=font_info[main_k].qqqq; + end; + end; + end; +end +else + begin + if cur_l= +procedure print_kanji(@!s:KANJI_code); {prints a single character} +begin +if s>@"FF then + begin print_char(@"100+Hi(s)); print_char(@"100+Lo(s)); + end else print_char(s); +end; + +@ This procedure changes the direction of the page, if |page_contents| +is |empty| and ``recent contributions'' does not contain any boxes, +rules nor insertions. + +@= +procedure change_page_direction(@!d: halfword); +label done; +var p: pointer; flag:boolean; +begin flag:=(page_contents=empty); +if flag and (head<>tail) then begin + p:=link(head); + while p<>null do + case type(p) of + hlist_node,vlist_node,dir_node,rule_node,ins_node: + begin flag:=false; goto done; end; + { |glue_node|, |kern_node|, |penalty_node| are discarded } + othercases p:=link(p); + endcases; + done: do_nothing; +end; +if flag then begin direction:=d; page_dir:=d; end +else begin + print_err("Use `"); print_cmd_chr(cur_cmd,d); + print("' at top of the page"); + help3("You can change the direction of the page only when") + ("the current page and recent contributions consist of only") + ("marks and whatsits."); error; + end; +end; + +@ This procedure is used in printing the second line in showing contexts. +This part is not read by |get_next| yet, so we don't know which bytes +are part of Japaense characters when the procedure is called. + +@= +procedure print_unread_buffer_with_ptenc(@!f, @!l: integer); +{ print |buffer[f..l-1]| with code conversion } +var @!i,@!j: pool_pointer; @!p: integer; +begin + i:=f; + while i1 then + begin for j:=i to i+p-1 do + print_char(@"100+buffer[j]); + i:=i+p; end + else begin print(buffer[i]); incr(i); end; + end; +end; + +@* \[54] System-dependent changes. +@z diff --git a/Build/source/texk/web2c/uptexdir/ptex_version.h b/Build/source/texk/web2c/uptexdir/ptex_version.h new file mode 100644 index 00000000000..13e0f1467b3 --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/ptex_version.h @@ -0,0 +1 @@ +#define PTEX_VERSION "p4.1.1" diff --git a/Build/source/texk/web2c/uptexdir/zfmtcompress.test b/Build/source/texk/web2c/uptexdir/zfmtcompress.test new file mode 100755 index 00000000000..31b67dce06f --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/zfmtcompress.test @@ -0,0 +1,102 @@ +#!/bin/sh -vx +# $Id$ +# Public domain. Originally written by Hironori Kitagawa, 2019. +# This test is intended to be used in a suitable temporary directory +# after installing all engines. It should not be enabled in build stage. + +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} + +cat <<'EOF' > stress.tex +\let\origdump=\dump\let\dump\relax +\batchmode +\input plain.tex +\let\dump\origdump + +\count0=0 +\def\A{\ifnum\count0<450000 + \count1=1000000 \advance\count1\count0 + \edef\N{QW\the\count1} + \expandafter\xdef\csname HOGE\N\endcsname{ABCDEFGHI}% + \advance\count0 by1\let\next=\A\else\let\next\relax + \fi\next} +\A +\let\N\undefined +\count0=0 +\def\A{\ifnum\count0<199 + \count1=1000000 \advance\count1\count0 + \edef\N{\the\count1} + \font\S=cmr10 at \N sp\fontdimen39707\S=1sp + \advance\count0 by1\let\next=\A\else\let\next\relax + \fi\next} +\A +\dump +EOF + +cat <<'EOF' > test0.tex +\font\a=cmss10 at 1000000sp +\a qwertyuiopasdfghjkl$\int^\infty_0 e^{-x^2}\,dx$\end +EOF + + +test0() { + ENGINE=$1 + echo $ENGINE + $_engine=$BinDir/$ENGINE$ExeExt + if [ ! -e $_engine ]; then return 0; fi + rm -f stress-$ENGINE.fmt test0.dvi test0.xdv &>/dev/null + $_engine -ini -etex -progname=$ENGINE -jobname=stress-$ENGINE stress &>/dev/null + ls -l stress-$ENGINE.fmt + if [[ "$ENGINE" = "xetex" ]]; then + $_engine -fmt=./stress-$ENGINE.fmt -no-pdf test0.tex &>/dev/null + ls -l test0.xdv + else + $_engine -fmt=./stress-$ENGINE.fmt test0.tex &>/dev/null + ls -l test0.dvi + fi +} + +test0 tex +test0 etex +test0 pdftex +test0 ptex +test0 eptex +test0 uptex +test0 euptex +test0 xetex + +cat <<'EOF' > test1.tex +\documentclass{article} +\begin{document} +The \textit{quick} \textbf{brown} \textsc{fox} jumps over the lazy dog. +\[ + \frac{\pi}{2} = + \left( \int_{0}^{\infty} \frac{\sin x}{\sqrt{x}} dx \right)^2 = + \sum_{k=0}^{\infty} \frac{(2k)!}{2^{2k}(k!)^2} \frac{1}{2k+1} = + \prod_{k=1}^{\infty} \frac{4k^2}{4k^2 - 1} +\] +\end{document} +EOF + +test1() { + ENGINE=$1 + echo $ENGINE + $_engine=$BinDir/$ENGINE$ExeExt + if [ ! -e $_engine ]; then return 0; fi + rm -f latex-$ENGINE.fmt test1.dvi test1.xdv &>/dev/null + $_engine -ini -etex -progname=latex-dev -jobname=latex-$ENGINE latex.ini &>/dev/null + ls -l latex-$ENGINE.fmt + if [[ "$ENGINE" = "xetex" ]]; then + $_engine -fmt=./latex-$ENGINE.fmt -no-pdf test1.tex &>/dev/null + ls -l test1.xdv + else + $_engine -fmt=./latex-$ENGINE.fmt test1.tex &>/dev/null + ls -l test1.dvi + fi +} + +test1 etex +test1 pdftex +test1 eptex +test1 euptex +test1 xetex -- cgit v1.2.3