| 1 |
Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr |
| 2 |
|
| 3 |
This file is part of the SyncTeX package. |
| 4 |
|
| 5 |
Latest Revision: Wed Jul 1 11:17:16 UTC 2009 |
| 6 |
|
| 7 |
License: |
| 8 |
-------- |
| 9 |
Permission is hereby granted, free of charge, to any person |
| 10 |
obtaining a copy of this software and associated documentation |
| 11 |
files (the "Software"), to deal in the Software without |
| 12 |
restriction, including without limitation the rights to use, |
| 13 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 14 |
copies of the Software, and to permit persons to whom the |
| 15 |
Software is furnished to do so, subject to the following |
| 16 |
conditions: |
| 17 |
|
| 18 |
The above copyright notice and this permission notice shall be |
| 19 |
included in all copies or substantial portions of the Software. |
| 20 |
|
| 21 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 22 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 23 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 24 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 25 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 26 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 27 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 28 |
OTHER DEALINGS IN THE SOFTWARE |
| 29 |
|
| 30 |
Except as contained in this notice, the name of the copyright holder |
| 31 |
shall not be used in advertising or otherwise to promote the sale, |
| 32 |
use or other dealings in this Software without prior written |
| 33 |
authorization from the copyright holder. |
| 34 |
|
| 35 |
Acknowledgments: |
| 36 |
---------------- |
| 37 |
The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh, |
| 38 |
and significant help from XeTeX developer Jonathan Kew |
| 39 |
|
| 40 |
Nota Bene: |
| 41 |
---------- |
| 42 |
If you include or use a significant part of the synctex package into a software, |
| 43 |
I would appreciate to be listed as contributor and see "SyncTeX" highlighted. |
| 44 |
|
| 45 |
Version 1 |
| 46 |
Thu Jun 19 09:39:21 UTC 2008 |
| 47 |
|
| 48 |
Notice: |
| 49 |
------- |
| 50 |
This file contains TeX changes for core synctex support. |
| 51 |
It is missing some implementation details that are deferred to either |
| 52 |
sync-pdftex.ch or sync-xetex.ch |
| 53 |
synctex.ch is based on tex.web after the eTeX changes have been applied. |
| 54 |
So it might not apply as is to pdftex.web due to some typographical changes. |
| 55 |
In the building process, one may have to apply some suitable tex.ch0 first. |
| 56 |
See pdftexdir for details. |
| 57 |
|
| 58 |
@x etex.ch l.3976 |
| 59 |
@<Reverse an hlist segment...@>= |
| 60 |
begin save_h:=cur_h; temp_ptr:=link(p); rule_wd:=width(p); |
| 61 |
free_node(p,small_node_size); |
| 62 |
@y |
| 63 |
@<Reverse an hlist segment...@>= |
| 64 |
begin save_h:=cur_h; temp_ptr:=link(p); rule_wd:=width(p); |
| 65 |
free_node(p,medium_node_size); {{\sl Sync\TeX}: p is a |math_node|} |
| 66 |
@z |
| 67 |
|
| 68 |
@x etex.ch l.4036 |
| 69 |
if type(p)=kern_node then if (rule_wd=0)or(l=null) then |
| 70 |
begin free_node(p,small_node_size); p:=l; |
| 71 |
end; |
| 72 |
@y |
| 73 |
if type(p)=kern_node then if (rule_wd=0)or(l=null) then |
| 74 |
begin free_node(p,medium_node_size); p:=l; |
| 75 |
end; |
| 76 |
@z |
| 77 |
|
| 78 |
@x etex.ch l.4088 |
| 79 |
@<Finish the reversed...@>= |
| 80 |
begin free_node(p,small_node_size); |
| 81 |
link(t):=q; width(t):=rule_wd; edge_dist(t):=-cur_h-rule_wd; goto done; |
| 82 |
end |
| 83 |
@y |
| 84 |
@<Finish the reversed...@>= |
| 85 |
begin free_node(p,medium_node_size); {{\sl Sync\TeX}: p is a |kern_node|} |
| 86 |
link(t):=q; width(t):=rule_wd; edge_dist(t):=-cur_h-rule_wd; goto done; |
| 87 |
end |
| 88 |
@z |
| 89 |
|
| 90 |
@x etex.ch l.4137 |
| 91 |
kern_node,math_node: begin r:=get_node(small_node_size); |
| 92 |
words:=small_node_size; |
| 93 |
end; |
| 94 |
glue_node: begin r:=get_node(small_node_size); add_glue_ref(glue_ptr(p)); |
| 95 |
glue_ptr(r):=glue_ptr(p); leader_ptr(r):=null; |
| 96 |
end; |
| 97 |
@y |
| 98 |
kern_node,math_node: begin |
| 99 |
words:=medium_node_size; {{\sl Sync\TeX}: proper size for math and kern} |
| 100 |
r:=get_node(words); |
| 101 |
end; |
| 102 |
glue_node: begin r:=get_node(medium_node_size); add_glue_ref(glue_ptr(p)); |
| 103 |
{{\sl Sync\TeX}: proper size for glue} |
| 104 |
glue_ptr(r):=glue_ptr(p); leader_ptr(r):=null; |
| 105 |
end; |
| 106 |
@z |
| 107 |
|
| 108 |
@x etex.ch l.4211 - Drop unused label |
| 109 |
procedure just_reverse(@!p:pointer); |
| 110 |
label found,done; |
| 111 |
@y |
| 112 |
procedure just_reverse(@!p:pointer); |
| 113 |
label done; |
| 114 |
@z |
| 115 |
|
| 116 |
@x etex.ch l.4234 |
| 117 |
found:width(t):=width(p); link(t):=q; free_node(p,small_node_size); |
| 118 |
@y |
| 119 |
width(t):=width(p); link(t):=q; free_node(p,small_node_size); |
| 120 |
@z |
| 121 |
|
| 122 |
@x etex.ch l.4241 |
| 123 |
begin type(p):=kern_node; incr(LR_problems); |
| 124 |
end |
| 125 |
else begin pop_LR; |
| 126 |
if n>min_halfword then |
| 127 |
begin decr(n); decr(subtype(p)); {change |after| into |before|} |
| 128 |
end |
| 129 |
else begin if m>min_halfword then decr(m)@+else goto found; |
| 130 |
type(p):=kern_node; |
| 131 |
end; |
| 132 |
end |
| 133 |
else begin push_LR(p); |
| 134 |
if (n>min_halfword)or(LR_dir(p)<>cur_dir) then |
| 135 |
begin incr(n); incr(subtype(p)); {change |before| into |after|} |
| 136 |
end |
| 137 |
else begin type(p):=kern_node; incr(m); |
| 138 |
end; |
| 139 |
end |
| 140 |
@y |
| 141 |
begin type(p):=kern_node; incr(LR_problems); |
| 142 |
{{\sl Sync\TeX} node size watch point: |math_node| size == |kern_node| size} |
| 143 |
end |
| 144 |
else begin pop_LR; |
| 145 |
if n>min_halfword then |
| 146 |
begin decr(n); decr(subtype(p)); {change |after| into |before|} |
| 147 |
end |
| 148 |
else begin if m>min_halfword then decr(m)@+else begin |
| 149 |
width(t):=width(p); link(t):=q; free_node(p,medium_node_size); |
| 150 |
{{\sl Sync\TeX}: no more "goto found", and proper node size} |
| 151 |
goto done; |
| 152 |
end; |
| 153 |
type(p):=kern_node; |
| 154 |
{{\sl Sync\TeX} node size watch point: |math_node| size == |kern_node| size} |
| 155 |
end; |
| 156 |
end |
| 157 |
else begin push_LR(p); |
| 158 |
if (n>min_halfword)or(LR_dir(p)<>cur_dir) then |
| 159 |
begin incr(n); incr(subtype(p)); {change |before| into |after|} |
| 160 |
end |
| 161 |
else begin type(p):=kern_node; incr(m); |
| 162 |
{{\sl Sync\TeX} node size watch point: |math_node| size == |kern_node| size} |
| 163 |
end; |
| 164 |
end |
| 165 |
@z |