1Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr
2
3This file is part of the SyncTeX package.
4
5Latest Revision: Wed Jul  1 11:17:45 UTC 2009
6
7License:
8--------
9Permission is hereby granted, free of charge, to any person
10obtaining a copy of this software and associated documentation
11files (the "Software"), to deal in the Software without
12restriction, including without limitation the rights to use,
13copy, modify, merge, publish, distribute, sublicense, and/or sell
14copies of the Software, and to permit persons to whom the
15Software is furnished to do so, subject to the following
16conditions:
17
18The above copyright notice and this permission notice shall be
19included in all copies or substantial portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28OTHER DEALINGS IN THE SOFTWARE
29
30Except as contained in this notice, the name of the copyright holder
31shall not be used in advertising or otherwise to promote the sale,
32use or other dealings in this Software without prior written
33authorization from the copyright holder.
34
35Acknowledgments:
36----------------
37The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
38and significant help from XeTeX developer Jonathan Kew
39
40Nota Bene:
41----------
42If you include or use a significant part of the synctex package into a software,
43I would appreciate to be listed as contributor and see "SyncTeX" highlighted.
44
45Version 1
46Latest Revision: Wed Jul  1 08:11:50 UTC 2009
47
48History:
49--------
50
51- if the pdf file is removed, the synctex file is removed too.
52
53@x
54margin_kern_node,
55kern_node: begin
56@y
57margin_kern_node:cur_h:=cur_h+width(p); {separate the |margin_kern_node| case in |hlist_out|}
58kern_node: begin
59@z
60
61@x
62procedure pdf_hlist_out; {output an |hlist_node| box}
63@y
64procedure pdf_hlist_out; {output an |hlist_node| box}
65@z
66
67@x pdftex.web l.18367
68while p<>null do
69    @<Output node |p| for |pdf_hlist_out| and move to the next node,
70    maintaining the condition |cur_v=base_line|@>;
71@y
72@<Start hlist {\sl Sync\TeX} information record@>;
73while p<>null do
74    @<Output node |p| for |pdf_hlist_out| and move to the next node,
75    maintaining the condition |cur_v=base_line|@>;
76@<Finish hlist {\sl Sync\TeX} information record@>;
77@z
78
79@x
80@ @<Output node |p| for |pdf_hlist_out|...@>=
81@y
82@ @<Output node |p| for |pdf_hlist_out|...@>=
83@z
84
85@x pdftex.web l.18382
86  until not is_char_node(p);
87@y
88  until not is_char_node(p);
89  @<Record current point {\sl Sync\TeX} information@>;
90@z
91
92@x
93@ @<Output the non-|char_node| |p| for |pdf_hlist_out|...@>=
94@y
95@ @<Output the non-|char_node| |p| for |pdf_hlist_out|...@>=
96@z
97
98@x
99margin_kern_node,
100kern_node:cur_h:=cur_h+width(p);
101@y
102margin_kern_node:cur_h:=cur_h+width(p);
103kern_node: begin
104  @<Record |kern_node| {\sl Sync\TeX} information@>;
105  cur_h:=cur_h+width(p);
106end;
107@z
108
109@x
110math_node: @<Handle a math node in |hlist_out|@>;
111@y
112math_node: begin
113  @<Record |math_node| {\sl Sync\TeX} information@>;
114  @<Handle a math node in |hlist_out|@>;
115end;
116@z
117
118@x pdftex.web l.18411
119move_past: cur_h:=cur_h+rule_wd;
120@y
121move_past: begin
122  cur_h:=cur_h+rule_wd;
123  @<Record horizontal |rule_node| or |glue_node| {\sl Sync\TeX} information@>;
124end;
125@z
126
127@x
128@ @<(\pdfTeX) Output a box in an hlist@>=
129@y
130@ @<(\pdfTeX) Output a box in an hlist@>=
131@z
132
133@x
134if list_ptr(p)=null then cur_h:=cur_h+width(p)
135@y
136if list_ptr(p)=null then
137  begin
138    @<Record void list {\sl Sync\TeX} information@>;
139    cur_h:=cur_h+width(p);
140  end
141@z
142
143@x
144@p procedure pdf_vlist_out; {output a |pdf_vlist_node| box}
145@y
146@p procedure pdf_vlist_out; {output a |pdf_vlist_node| box}
147@z
148
149@x pdftex.web l.18521
150left_edge:=cur_h; cur_v:=cur_v-height(this_box); top_edge:=cur_v;
151@y
152left_edge:=cur_h;
153@<Start vlist {\sl Sync\TeX} information record@>;
154cur_v:=cur_v-height(this_box); top_edge:=cur_v;
155@z
156
157@x pdftex.web l.18523
158while p<>null do
159    @<Output node |p| for |pdf_vlist_out| and move to the next node,
160    maintaining the condition |cur_h=left_edge|@>;
161@y
162while p<>null do
163    @<Output node |p| for |pdf_vlist_out| and move to the next node,
164    maintaining the condition |cur_h=left_edge|@>;
165@<Finish vlist {\sl Sync\TeX} information record@>;
166@z
167
168@x pdftex.web l.18557
169@ @<(\pdfTeX) Output a box in a vlist@>=
170if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p)
171@y
172@ @<(\pdfTeX) Output a box in a vlist@>=
173if list_ptr(p)=null then begin
174  cur_v:=cur_v+height(p);
175  @<Record void list {\sl Sync\TeX} information@>;
176  cur_v:=cur_v+depth(p);
177end
178@z
179
180@x
181@p procedure pdf_ship_out(p: pointer; shipping_page: boolean); {output the box |p|}
182@y
183@p procedure pdf_ship_out(p: pointer; shipping_page: boolean); {output the box |p|}
184@z
185
186@x pdftex.web l.18680
187pdf_last_resources: integer; {pointer to most recently generated Resources object}
188@y
189pdf_last_resources: integer; {pointer to most recently generated Resources object}
190begin @<Start sheet {\sl Sync\TeX} information record@>;
191@z
192
193@x pdftex.web l.18699
194@<Flush the box from memory, showing statistics if requested@>;
195end;
196@y
197@<Flush the box from memory, showing statistics if requested@>;
198end;
199@<Finish sheet {\sl Sync\TeX} information record@>;
200end;
201@z
202
203@x
204procedure close_files_and_terminate;
205@y
206procedure close_files_and_terminate;
207@z
208
209@x
210        remove_pdffile;
211@y
212        remove_pdffile;
213		synctex_abort(log_opened);
214@z
215
216@x
217synctex_sheet(mag);
218@y
219pdf_output_value:=pdf_output; {{\sl Sync\TeX}: we assume that |pdf_output| is properly set up}
220synctex_sheet(mag);
221@z
222