summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/synctexdir/synctex-pdf-rec.ch2
blob: 41142b786b87412638b7900b1dd801fe3754caa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr

This file is part of the SyncTeX package.

Version 1
Latest Revision: Sat Apr 22 10:07:05 UTC 2017

License:
--------
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE

Except as contained in this notice, the name of the copyright holder  
shall not be used in advertising or otherwise to promote the sale,  
use or other dealings in this Software without prior written  
authorization from the copyright holder.

Acknowledgments:
----------------
The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
and significant help from XeTeX developer Jonathan Kew

Nota Bene:
----------
If you include or use a significant part of the synctex package into a software,
I would appreciate to be listed as contributor and see "SyncTeX" highlighted.

History:
--------

- the synctex hooks are changed to encapsulate Ship box |p| out
- if the pdf file is removed, the synctex file is removed too.

@x pdftex.web l.14550
@ @<Output the non-|char_node| |p| for |hlist_out|...@>=
@y
@ @<Output the non-|char_node| |p| for |hlist_out|...@>=
@z
@x
margin_kern_node,
kern_node: begin
@y
margin_kern_node:cur_h:=cur_h+width(p); {separate the |margin_kern_node| case in |hlist_out|}
kern_node: begin
@z

@x pdftex.web l.18491
procedure pdf_hlist_out; {output an |hlist_node| box}
@y
procedure pdf_hlist_out; {output an |hlist_node| box}
@z

@x pdftex.web l.18519
while p<>null do
    @<Output node |p| for |pdf_hlist_out| and move to the next node,
    maintaining the condition |cur_v=base_line|@>;
@y
@<Start hlist {\sl Sync\TeX} information record@>;
while p<>null do
    @<Output node |p| for |pdf_hlist_out| and move to the next node,
    maintaining the condition |cur_v=base_line|@>;
@<Finish hlist {\sl Sync\TeX} information record@>;
@z

@x pdftex.web l.18533
@ @<Output node |p| for |pdf_hlist_out|...@>=
@y
@ @<Output node |p| for |pdf_hlist_out|...@>=
@z

@x pdftex.web l.18544
  until not is_char_node(p);
@y
  until not is_char_node(p);
  @<Record current point {\sl Sync\TeX} information@>;
@z

@x
@ @<Output the non-|char_node| |p| for |pdf_hlist_out|...@>=
@y
@ @<Output the non-|char_node| |p| for |pdf_hlist_out|...@>=
@z

@x pdftex.web l.18557
margin_kern_node,
kern_node:cur_h:=cur_h+width(p);
@y
margin_kern_node:cur_h:=cur_h+width(p);
kern_node: begin
  @<Record |kern_node| {\sl Sync\TeX} information@>;
  cur_h:=cur_h+width(p);
end;
@z

@x
math_node: @<Handle a math node in |hlist_out|@>;
@y
math_node: begin
  @<Record |math_node| {\sl Sync\TeX} information@>;
  @<Handle a math node in |hlist_out|@>;
end;
@z

@x pdftex.web l.18566
move_past: cur_h:=cur_h+rule_wd;
@y
move_past: begin
  cur_h:=cur_h+rule_wd;
  @<Record horizontal |rule_node| or |glue_node| {\sl Sync\TeX} information@>;
end;
@z

@x
@ @<(\pdfTeX) Output a box in an hlist@>=
@y
@ @<(\pdfTeX) Output a box in an hlist@>=
@z

@x
if list_ptr(p)=null then cur_h:=cur_h+width(p)
@y
if list_ptr(p)=null then
  begin
    @<Record void list {\sl Sync\TeX} information@>;
    cur_h:=cur_h+width(p);
  end
@z

@x
@p procedure pdf_vlist_out; {output a |pdf_vlist_node| box}
@y
@p procedure pdf_vlist_out; {output a |pdf_vlist_node| box}
@z

@x pdftex.web l.18670
left_edge:=cur_h; cur_v:=cur_v-height(this_box); top_edge:=cur_v;
@y
left_edge:=cur_h;
@<Start vlist {\sl Sync\TeX} information record@>;
cur_v:=cur_v-height(this_box); top_edge:=cur_v;
@z

@x pdftex.web l.18673
while p<>null do
    @<Output node |p| for |pdf_vlist_out| and move to the next node,
    maintaining the condition |cur_h=left_edge|@>;
@y
while p<>null do
    @<Output node |p| for |pdf_vlist_out| and move to the next node,
    maintaining the condition |cur_h=left_edge|@>;
@<Finish vlist {\sl Sync\TeX} information record@>;
@z

@x pdftex.web l.18706
@ @<(\pdfTeX) Output a box in a vlist@>=
if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p)
@y
@ @<(\pdfTeX) Output a box in a vlist@>=
if list_ptr(p)=null then begin
  cur_v:=cur_v+height(p);
  @<Record void list {\sl Sync\TeX} information@>;
  cur_v:=cur_v+depth(p);
end
@z

@x pdftex.web l.18879
@<(\pdfTeX) Ship box |p| out@>;
@y
pdf_output_value:=pdf_output; {{\sl Sync\TeX}: we assume that |pdf_output| is properly set up}
if shipping_page then synctex_sheet(mag) @+else synctex_pdfxform(p);
@<(\pdfTeX) Ship box |p| out@>;
if shipping_page then synctex_teehs @+else synctex_mrofxfdp;
@z

@x
procedure close_files_and_terminate;
@y
procedure close_files_and_terminate;
@z

@x pdftex.web l.33072
        remove_pdffile;
@y
        remove_pdffile;
		synctex_abort(log_opened);
@z

@x pdftex.web l.36224
procedure out_form(p: pointer);
begin
@y
procedure out_form(p: pointer);
begin
  synctexpdfrefxform(pdf_xform_objnum(p));
@z