diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-11-08 14:05:38 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-11-08 14:05:38 +0000 |
commit | ef3fef63c3d02ea78d129958d822b330289d9793 (patch) | |
tree | 3437e2cf8cb9484bbf1cd51be868b3193a5c2dc5 /Build | |
parent | 5837044d0c98d013ee09ce38a1885e48e5759471 (diff) |
web2c/eptexdir, web2c/euptexdir: Add primitives \pdfshellescape and \lastnodechar (H. Kitagawa)
git-svn-id: svn://tug.org/texlive/trunk@35541 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/eptexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex.ech | 69 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/pdfutils.ch | 21 | ||||
-rw-r--r-- | Build/source/texk/web2c/euptexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/euptexdir/euptex.ch1 | 21 |
5 files changed, 110 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index 436bc76ce11..624e247f187 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -1,3 +1,8 @@ +2014-11-08 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> + + * pdfutils.ch, eptex.ech: Add primitives \pdfshellescape and + \lastnodechar to e-(u)ptex. + 2014-05-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp> 2014-05-06 Peter Breitenlohner <peb@mppmu.mpg.de> diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech index 23ab578bb05..761af8a7447 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.ech +++ b/Build/source/texk/web2c/eptexdir/eptex.ech @@ -1,6 +1,12 @@ % eptexdir/eptex.ech: changefile used to build e-pTeX, see eptexdir/eptex-base.ch for details. % Public domain. Originally written by Peter Breitenlohner <tex-live@tug.org>. +%% new primitives by e-pTeX +%% +%% \lastnodechar: the (internal) character code of the last node +%% -1: non-character or null + + @x e-pTeX: logo \def\eTeX{$\varepsilon$-\TeX} @y @@ -13,7 +19,7 @@ @y @d eTeX_version_string=='-2.6' {current \eTeX\ version} @# -@d epTeX_version_string=='-130605' +@d epTeX_version_string=='-141108' @z @x e-pTeX: banner @@ -53,7 +59,7 @@ In \epTeX\ the |subtype| field is |qi(8*box_lr+box_dir)|. @d set_box_dir(#) == subtype(#):=set_box_dir_end @y @d box_dir(#) == ((qo(subtype(#)))mod 8) {direction of a box} -@d set_box_dir(#) == subtype(#):=box_lr(#)*8+set_box_dir_end +@d set_box_dir(#) == subtype(#):=box_lr(#)*8+set_box_dir_end @z @x [26.413] l.8343 - e-pTeX: scan_something_internal @@ -63,6 +69,13 @@ label exit; var m:halfword; {|chr_code| part of the operand token} @z +@x +@d input_line_no_code=glue_val+2 {code for \.{\\inputlineno}} +@y +@d last_node_char_code=glue_val+2 {code for \.{\\lastnodechar}} +@d input_line_no_code=glue_val+3 {code for \.{\\inputlineno}} +@z + @x [26.420] l.8474 - pTeX: Fetch a box dimension: dir_node begin scan_eight_bit_int; q:=box(cur_val); @y @@ -99,6 +112,26 @@ if not is_char_node(tx) then @d find_effective_tail==find_effective_tail_epTeX @z +@x + 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 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; + if (tx=head)or(mode=0) then cur_val:=-1 + else if font_dir[font(tx)]<>dir_default then cur_val:=info(link(tx)) + else cur_val:=character(tx) + end + else cur_val_level:=cur_chr; +@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; @@ -110,6 +143,11 @@ if not is_char_node(tx) then else if cur_val>disp_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_char_code: + if ((type(tx)=glue_node) and (subtype(tx)=jfm_skip+1)) + or ((type(tx)=penalty_node) and (subtype(tx)=kinsoku_pena)) then + cur_val:=info(link(last_jchr)) + else cur_val:=-1; @z @x e-pTeX: if primitives - leave room for three e-TeX codes @@ -155,10 +193,10 @@ else last_node_type:=type(p)-1; {no |disp_node| in a vertical list} drop \.{\\beginM} \.{\\endM} pair and\slash or merge |disp_node| pair} q:=head; p:=null; r:=null; fm:=0; fd:=0; disp:=0; pdisp:=0; repeat s:=r; r:=p; p:=q; fm:=fm div 2; fd:=fd div 2; -if not is_char_node(q) then - if type(q)=disc_node then - begin for m:=1 to replace_count(q) do - begin p:=link(p); if p=tx then #; end +if not is_char_node(q) then + if type(q)=disc_node then + begin for m:=1 to replace_count(q) do + begin p:=link(p); if p=tx then #; end { |tx| might be a part of discretionary; in this case, nothing will be removed} end else if (type(q)=math_node)and(subtype(q)=begin_M_code) then fm:=2 @@ -240,6 +278,22 @@ if fm>0 then {drop \.{\\beginM} \.{\\endM} pair} @!fd,@!gd:integer; {same for |disp_node|} @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("lastnodechar",last_item,last_node_char_code); +@!@:last_node_char_}{\.{\\lastnodechar} primitive@> +@z + +@x +last_node_type_code: print_esc("lastnodetype"); +@y +last_node_type_code: print_esc("lastnodetype"); +last_node_char_code: print_esc("lastnodechar"); +@z @x e-pTeX: font_char_{wd,ht,dp,ic}_code l.27306 begin i:=char_info(q)(qi(cur_val)); @y @@ -261,7 +315,7 @@ 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 +@y begin g_order:=glue_order(this_box); g_sign:=glue_sign(this_box); disp:=revdisp; disped:=false; @z @@ -339,4 +393,3 @@ end; @# procedure print_direction(@!d:integer); {print the direction represented by d} @z - diff --git a/Build/source/texk/web2c/eptexdir/pdfutils.ch b/Build/source/texk/web2c/eptexdir/pdfutils.ch index 6252e3bf80d..fa978ac6348 100644 --- a/Build/source/texk/web2c/eptexdir/pdfutils.ch +++ b/Build/source/texk/web2c/eptexdir/pdfutils.ch @@ -1,6 +1,6 @@ %% Support for some primitives defined in pdfTeX %% -%% \pdfstrcmp: need for LaTeX3 +%% \pdfstrcmp: need for LaTeX3 %% In comparison, Japanese characters will be always encoded in UTF-8. %% %% \pdffilemoddate and co.: for standalone package @@ -9,6 +9,11 @@ %% \pdfsavepos and co. %% (\pdfsavepos, \pdfpage{width,height}, \pdflast{x,y}pos) %% papersize special automatically sets \pdfpage{width,height} (quick hack). +%% +%% \pdffiledump: for bmpsize package by Heiko Oberdiek +%% +%% \pdfshellescape: by doraTeX's request +%% @x @* \[12] Displaying boxes. @@ -48,12 +53,13 @@ pdf_page_height_code: print_esc("pdfpageheight"); @d badness_code=input_line_no_code+1 {code for \.{\\badness}} @d pdf_last_x_pos_code=badness_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}} @z @x @d eTeX_int=badness_code+1 {first of \eTeX\ codes for integers} @y -@d eTeX_int=pdf_last_y_pos_code+1 {first of \eTeX\ codes for integers} +@d eTeX_int=pdf_shell_escape_code+1 {first of \eTeX\ codes for integers} @z @x @@ -360,6 +366,8 @@ 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@> @z @x @@ -368,6 +376,7 @@ eTeX_version_code: print_esc("eTeXversion"); eTeX_version_code: print_esc("eTeXversion"); pdf_last_x_pos_code: print_esc("pdflastxpos"); pdf_last_y_pos_code: print_esc("pdflastypos"); +pdf_shell_escape_code: print_esc("pdfshellescape"); @z @x @@ -376,6 +385,14 @@ eTeX_version_code: cur_val:=eTeX_version; 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; @z @x diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog index eadc5cfd32d..fc1c92ce0d8 100644 --- a/Build/source/texk/web2c/euptexdir/ChangeLog +++ b/Build/source/texk/web2c/euptexdir/ChangeLog @@ -1,3 +1,8 @@ +2014-11-08 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> + + * euptex.ch1: Add primitives \pdfshellescape and \lastnodechar + to e-(u)ptex. + 2014-05-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp> 2014-05-06 Peter Breitenlohner <peb@mppmu.mpg.de> diff --git a/Build/source/texk/web2c/euptexdir/euptex.ch1 b/Build/source/texk/web2c/euptexdir/euptex.ch1 index e939c20772a..f8272cf1b35 100644 --- a/Build/source/texk/web2c/euptexdir/euptex.ch1 +++ b/Build/source/texk/web2c/euptexdir/euptex.ch1 @@ -6,6 +6,26 @@ @d banner_k==eupTeX_banner_k @z +@x + else if font_dir[font(tx)]<>dir_default then cur_val:=info(link(tx)) +@y + else if font_dir[font(tx)]<>dir_default then cur_val:=info(link(tx)) mod max_cjk_val +@z + +@x + last_node_char_code: + if ((type(tx)=glue_node) and (subtype(tx)=jfm_skip+1)) + or ((type(tx)=penalty_node) and (subtype(tx)=kinsoku_pena)) then + cur_val:=info(link(last_jchr)) + else cur_val:=-1; +@y + last_node_char_code: + if ((type(tx)=glue_node) and (subtype(tx)=jfm_skip+1)) + or ((type(tx)=penalty_node) and (subtype(tx)=kinsoku_pena)) then + cur_val:=info(link(last_jchr)) mod max_cjk_val + else cur_val:=-1; +@z + @x e-pTeX: ifcsname l.28620 begin buffer[m]:=Hi(info(p)); incr(m); end; @@ -22,4 +42,3 @@ begin buffer[m]:=info(p) mod max_char_val; incr(m); p:=link(p); end; @z - |