summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/synctexdir
diff options
context:
space:
mode:
authorJérôme Laurens <jerome.laurens@u-bourgogne.fr>2017-04-23 10:46:51 +0000
committerJérôme Laurens <jerome.laurens@u-bourgogne.fr>2017-04-23 10:46:51 +0000
commit3d6fd65e13366ed225a9cab19637d6d85233a0a5 (patch)
tree9d6552fb02443ab8a7b60b4f5b74da916e815006 /Build/source/texk/web2c/synctexdir
parentbc6749a7225f3fd8a0a0f25644bd427078c41618 (diff)
Adding SyncTeX support to \pdfxform. For pdftex only but EVERY TeX engine is concerned. OK on OSX, untested on windows and other platforms. The synctex command line tool will be updated soon.
git-svn-id: svn://tug.org/texlive/trunk@43989 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/synctexdir')
-rw-r--r--Build/source/texk/web2c/synctexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/synctexdir/man1/synctex.125
-rw-r--r--Build/source/texk/web2c/synctexdir/man5/synctex.595
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex-pdf-rec.ch270
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex-pdftex.h35
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex.c753
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex.defines12
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex.h26
8 files changed, 695 insertions, 326 deletions
diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog
index d581a7e439f..a79bb8867bb 100644
--- a/Build/source/texk/web2c/synctexdir/ChangeLog
+++ b/Build/source/texk/web2c/synctexdir/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-22 Jerome Laurens
+ <jerome.laurens@u-bourgogne.fr>
+
+ * man5/synctex.1, man5/synctex.5, synctex-pdf-rec.ch2, synctex-pdftex.h, synctex-rec.ch0, synctex.c, synctex.defines, synctex.h: add support for \pdfxform
+
2016-03-04 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* synctex-ep-mem.ch1, synctex-p-mem.ch1: Adapt to changes in
diff --git a/Build/source/texk/web2c/synctexdir/man1/synctex.1 b/Build/source/texk/web2c/synctexdir/man1/synctex.1
index 958266fccc7..f292502b4a8 100644
--- a/Build/source/texk/web2c/synctexdir/man1/synctex.1
+++ b/Build/source/texk/web2c/synctexdir/man1/synctex.1
@@ -1,4 +1,4 @@
-.Dd 06/26/2013 \" DATE
+.Dd 04/23/2017 \" DATE
.Dt synctex 1 \" Program name and manual section number
.Sh NAME
.Nm synctex
@@ -13,17 +13,34 @@ which means to navigate from the source document to the typeset material
and vice versa.
.Pp
Run `synctex help' to access the built-in tool documentation.
-.Sh SEE ALSO
+.Sh TEX ENGINE OPTION -synctex=NUMBER
+.It
+.Li If NUMBER=0 or no option is given, no synctex file is created.
+.It
+.Li If NUMBER<0, synctex files are text files.
+.It
+.Li If NUMBER>0, synctex files are compressed with gz.
+.It
+.Li If NUMBER&2, no .gz extension is used.
+.It
+.Li If NUMBER&4, activate form support, useful for pdftex.
+.It
+.Li If NUMBER&8, better file compression.
+.Pp
+Use for example `pdftex -synctex=15 foo.tex' to activate all the options.
+.Pp
+Notice that LuaTeX option is `--synctex=NUMBER' with two dashes.
+.Sh SEE ALSO
.\" List links in ascending order by section, alphabetically within a section.
.\" Please do not reference files that do not exist without filing a bug report
-.Xr synctex 5
+.Xr synctex 5
.Xr tex 1
.Sh AUTHOR
The Synchronize TeXnology is essentially due to Jerome Laurens,
with useful suggestions by some well known actors of the TeX world.
.\" .Sh BUGS \" Document known, unremedied bugs
.Sh HISTORY \" Document history if command behaves in a unique manner
-This document has never been updated.
+Revised on Sun Apr 23 09:54:20 UTC 2017.
.\" nroff -man synctex.1 | less
.\"groff -man -Tascii synctex.1 | less
.\"To convert a man page to plain pre-formatted text (e.g for spell checking) use:
diff --git a/Build/source/texk/web2c/synctexdir/man5/synctex.5 b/Build/source/texk/web2c/synctexdir/man5/synctex.5
index 3b331efe0bd..0ada3af96b4 100644
--- a/Build/source/texk/web2c/synctexdir/man5/synctex.5
+++ b/Build/source/texk/web2c/synctexdir/man5/synctex.5
@@ -1,4 +1,4 @@
-.Dd Mar 13, 2012
+.Dd Apr 22, 2017
.Dt SYNCTEX 5
.Os "Independant"
.\"
@@ -13,8 +13,7 @@ Synchronize TeXnology help file
.Pq synctexs
are text files that help input/output synchronization during document preparation with the TeX typesetting system.
.Sh BASICS
-The structure of this file should not be considered public, in the sense that no one should need to parse its contents, except the synctex command line utility, and the synctex_parser library.
-Unless it is absolutely not avoidable, access to the contents of the synctex file should only be made through requests made to the synctex command line utility.
+The structure of this file should not be considered public, in the sense that no one should need to parse its contents, except the synctex command line utility, and the synctex_parser library which are both publicly available. Unless it is absolutely not avoidable, access to the contents of the synctex file should only be made through requests made to the synctex command line utility.
.\"
.Sh STRUCTURE
The element structure of a synctex file is a list of text line records as follows.
@@ -94,19 +93,21 @@ In the following definitions, we do not mention the section ending condition.
.Qq Content:
<EOL>
.It
+.Li (<Form(k)>|<Input Line>)*
+.It
.Li <sheet(1)>
.It
-.Li <Input Line>*
+.Li (<Form(k)>|<Input Line>)*
.It
.Li <sheet(2)>
.It
-.Li <Input Line>*
+.Li (<Form(k)>|<Input Line>)*
.It
.Li ...
.It
.Li <sheet(N)>
.It
-.Li <Input Line>*
+.Li (<Form(k)>|<Input Line>)*
.El
.It
.Li <byte offset record> ::=
@@ -123,17 +124,37 @@ In the following definitions, we do not mention the section ending condition.
.Li <byte offset record>
.It
.Qq \&{
-<the integer n> <end of record>/
+<the integer n> <end of record>
.It
-.Li <box content>*
+.Li <vbox section>|<hbox section>
.It
.Li <byte offset record>
.It
.Qq \&}
<the integer n> <end of record>
.El
+.It
+.Li <Form> ::=
+.Bl -item -offset indent
+.It
+.Li <byte offset record>
+.It
+.Qq \&<
+<form tag> <end of record>
+.It
+.Li <vbox section>|<hbox section>
+.It
+.Li <byte offset record>
+.It
+.Qq \&>
+<end of record>
+.El
+.It
+.Li <form tag> ::= <integer>
.El
.Pp
+Forms are available with pdfTeX.
+All the numbers are integers encoded using the decimal representation with "C" locale.
The <box content> describes what is inside a box.
It is either a vertical or horizontal box,
with some records related to glue, kern or math nodes.
@@ -146,7 +167,9 @@ with some records related to glue, kern or math nodes.
.It
.Li |<void vbox record>|<void hbox record>
.It
-.Li |<current record>|<glue record>|<kern record>|<math record>
+.Li |<current record>|<glue record>|<kern record>
+.It
+.Li |<math record>|<form ref record>|<Form>
.El
.It
.Li <vbox section> ::=
@@ -201,6 +224,27 @@ Void boxes:
.Qq \&:
<size> <end of record>
.It
+.Li <link> ::= <tag>
+.Qq \&,
+<line>(
+.Qq \&,
+<column>)?
+.It
+.Li <point> ::= <full point>|<compressed point>
+.It
+.Li <full point> ::=
+<integer>
+.Qq \&,
+<integer>
+.It
+.Li <compressed point> ::=
+<integer>
+.Qq \&,=
+.It
+.Li <line> ::= <integer>
+.It
+.Li <column> ::= <integer>
+.It
.Li <size> ::= <Width>
.Qq \&,
<Height>
@@ -212,16 +256,6 @@ Void boxes:
.Li <Height> ::= <integer>
.It
.Li <Depth> ::= <integer>
-.It
-.Li <link> ::= <tag>
-.Qq \&,
-<line>(
-.Qq \&,
-<column>)?
-.It
-.Li <line> ::= <integer>
-.It
-.Li <column> ::= <integer>
.El
.Pp
The forthcoming records are basic one liners.
@@ -252,6 +286,12 @@ The forthcoming records are basic one liners.
<link>
.Qq \&:
<point> <end of record>
+.It
+.Li <form ref record> ::=
+.Qq f
+<form tag>
+.Qq \&:
+<point> <end of record>
.El
.Pp
.\" .Sx underline, .Dq double quotes, .Pq enclosed in parenthesis
@@ -308,7 +348,22 @@ All the numbers are encoded using the decimal representation with "C" locale.
.Sh USAGE
.Pp
The <current record> is used to compute the visible size of hbox's.
-The byte offset is an implicit anchor to navigate the synctex file from sheet to sheet.
+The byte offset is an implicit anchor to navigate the synctex file from sheet to sheet. The second coordinate of
+a compressed point has been replaced by a
+.Qq =
+character which means that it is the second coordinate of the
+last full point available above.
+.Sh SEE ALSO
+.\" List links in ascending order by section, alphabetically within a section.
+.\" Please do not reference files that do not exist without filing a bug report
+.Xr synctex 1
+.Xr tex 1
+.Sh AUTHOR
+The Synchronize TeXnology is essentially due to Jerome Laurens,
+with useful suggestions by some well known actors of the TeX world.
+.\" .Sh BUGS \" Document known, unremedied bugs
+.Sh HISTORY \" Document history if command behaves in a unique manner
+This document has been updated on Sat Apr 22 09:57:20 UTC 2017 to include \\pdfxform support.
.\" nroff -man synctex.5 | less
.\"groff -man -Tascii synctex.5 | less
.\"To convert a man page to plain pre-formatted text (e.g for spell checking) use:
diff --git a/Build/source/texk/web2c/synctexdir/synctex-pdf-rec.ch2 b/Build/source/texk/web2c/synctexdir/synctex-pdf-rec.ch2
index 34ba6a79bc8..41142b786b8 100644
--- a/Build/source/texk/web2c/synctexdir/synctex-pdf-rec.ch2
+++ b/Build/source/texk/web2c/synctexdir/synctex-pdf-rec.ch2
@@ -1,8 +1,9 @@
-Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr
+Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
-Latest Revision: Wed Jul 1 11:17:45 UTC 2009
+Version 1
+Latest Revision: Sat Apr 22 10:07:05 UTC 2017
License:
--------
@@ -42,14 +43,17 @@ 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.
-Version 1
-Latest Revision: Wed Jul 1 08:11:50 UTC 2009
-
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
@@ -58,13 +62,13 @@ margin_kern_node:cur_h:=cur_h+width(p); {separate the |margin_kern_node| case in
kern_node: begin
@z
-@x
+@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.18367
+@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|@>;
@@ -76,13 +80,13 @@ while p<>null do
@<Finish hlist {\sl Sync\TeX} information record@>;
@z
-@x
+@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.18382
+@x pdftex.web l.18544
until not is_char_node(p);
@y
until not is_char_node(p);
@@ -95,7 +99,7 @@ while p<>null do
@ @<Output the non-|char_node| |p| for |pdf_hlist_out|...@>=
@z
-@x
+@x pdftex.web l.18557
margin_kern_node,
kern_node:cur_h:=cur_h+width(p);
@y
@@ -115,7 +119,7 @@ math_node: begin
end;
@z
-@x pdftex.web l.18411
+@x pdftex.web l.18566
move_past: cur_h:=cur_h+rule_wd;
@y
move_past: begin
@@ -146,7 +150,7 @@ if list_ptr(p)=null then
@p procedure pdf_vlist_out; {output a |pdf_vlist_node| box}
@z
-@x pdftex.web l.18521
+@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;
@@ -154,7 +158,7 @@ left_edge:=cur_h;
cur_v:=cur_v-height(this_box); top_edge:=cur_v;
@z
-@x pdftex.web l.18523
+@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|@>;
@@ -165,7 +169,7 @@ while p<>null do
@<Finish vlist {\sl Sync\TeX} information record@>;
@z
-@x pdftex.web l.18557
+@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
@@ -177,27 +181,13 @@ if list_ptr(p)=null then begin
end
@z
-@x
-@p procedure pdf_ship_out(p: pointer; shipping_page: boolean); {output the box |p|}
-@y
-@p procedure pdf_ship_out(p: pointer; shipping_page: boolean); {output the box |p|}
-@z
-
-@x pdftex.web l.18680
-pdf_last_resources: integer; {pointer to most recently generated Resources object}
-@y
-pdf_last_resources: integer; {pointer to most recently generated Resources object}
-begin @<Start sheet {\sl Sync\TeX} information record@>;
-@z
-
-@x pdftex.web l.18699
-@<Flush the box from memory, showing statistics if requested@>;
-end;
+@x pdftex.web l.18879
+@<(\pdfTeX) Ship box |p| out@>;
@y
-@<Flush the box from memory, showing statistics if requested@>;
-end;
-@<Finish sheet {\sl Sync\TeX} information record@>;
-end;
+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
@@ -206,16 +196,18 @@ procedure close_files_and_terminate;
procedure close_files_and_terminate;
@z
-@x
+@x pdftex.web l.33072
remove_pdffile;
@y
remove_pdffile;
synctex_abort(log_opened);
@z
-@x
-synctex_sheet(mag);
+@x pdftex.web l.36224
+procedure out_form(p: pointer);
+begin
@y
-pdf_output_value:=pdf_output; {{\sl Sync\TeX}: we assume that |pdf_output| is properly set up}
-synctex_sheet(mag);
+procedure out_form(p: pointer);
+begin
+ synctexpdfrefxform(pdf_xform_objnum(p));
@z
diff --git a/Build/source/texk/web2c/synctexdir/synctex-pdftex.h b/Build/source/texk/web2c/synctexdir/synctex-pdftex.h
index 7c7251d742b..dd61943ec5d 100644
--- a/Build/source/texk/web2c/synctexdir/synctex-pdftex.h
+++ b/Build/source/texk/web2c/synctexdir/synctex-pdftex.h
@@ -1,9 +1,10 @@
/*
-Copyright (c) 2008, 2009, 2010, 2011 jerome DOT laurens AT u-bourgogne DOT fr
+Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
-Latest Revision: Fri Apr 15 19:10:57 UTC 2011
+Version 1
+Latest Revision: Sat Apr 22 10:07:05 UTC 2017
License:
--------
@@ -43,16 +44,28 @@ 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.
-Version 1
-Thu Jun 19 09:39:21 UTC 2008
-
*/
# include "pdftexd.h"
-/* We observe pdfoutputvalue in order to determine whether output mode is
- * pdf or dvi.
- * We will assume that pdf_output_value equals pdf_output before entering
- * the synctex_sheet function below, in the including synctex.c file. */
-# define SYNCTEX_OFFSET_IS_PDF (pdfoutputvalue>0)
-# define SYNCTEX_OUTPUT ((pdfoutputvalue>0)?"pdf":"dvi")
+/* We observe pdfoutputvalue in order to determine whether output mode is
+ * pdf or dvi.
+ * We will assume that pdf_output_value equals pdf_output entering
+ * the synctex_sheet function below, in the including synctex.c file.
+ */
+# define SYNCTEX_OFFSET_IS_PDF (pdfoutputvalue>0)
+# define SYNCTEX_OUTPUT ((pdfoutputvalue>0)?"pdf":"dvi")
+
+/* Adding support for pdf forms
+ */
+# define SYNCTEX_SUPPORT_PDF_FORM (1)
+# define SYNCTEX_PDF_CUR_FORM (pdfcurform)
+
+/* these messages should be sent to record information
+ * for a form node (\pdfrefxform).
+ * No engine discrimination.
+ */
+extern void synctexpdfxform(halfword p);
+extern void synctexmrofxfdp();
+extern void synctexpdfrefxform(int objnum);
+
diff --git a/Build/source/texk/web2c/synctexdir/synctex.c b/Build/source/texk/web2c/synctexdir/synctex.c
index c01e4480245..f07f13a1c25 100644
--- a/Build/source/texk/web2c/synctexdir/synctex.c
+++ b/Build/source/texk/web2c/synctexdir/synctex.c
@@ -1,9 +1,10 @@
/*
- Copyright (c) 2008, 2009, 2010, 2011 jerome DOT laurens AT u-bourgogne DOT fr
+ Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
- Latest Revision: Fri Apr 15 19:10:57 UTC 2011
+ Version 1
+ Latest Revision: Sat Apr 22 10:07:05 UTC 2017
License:
--------
@@ -109,7 +110,7 @@
is producing the expected file named <my file.synctex>, (the '<' and '>' are not part of the name)
whereas running the command line
pdftex --synctex=-1 "my file.tex"
- was producing the unexpected file named <"my file".synctex> where the two '"' chracters were part of the name.
+ was producing the unexpected file named <"my file".synctex> where the two '"' characters were part of the name.
Of course, that was breaking the typesetting mechanism when pdftex was involved.
To solve this problem, we prefer to rely on the output_file_name instead of the jobname.
In the case when no output_file_name is available, we use jobname and test if the file name
@@ -118,7 +119,7 @@
There is some conditional coding.
Version 1
- Latest Revision: Wed Jul 1 08:15:44 UTC 2009
+ Latest Revision: Sat Apr 22 09:10:30 UTC 2017
*/
@@ -338,6 +339,10 @@ static int fsyscp_remove(char *name);
# include "synctex.h"
+# if !defined(SYNCTEX_SUPPORT_PDF_FORM)
+# define SYNCTEX_SUPPORT_PDF_FORM 0
+# endif
+
# define SYNCTEX_YES (1)
# define SYNCTEX_NO (0)
# define SYNCTEX_NO_ERROR (0)
@@ -394,7 +399,11 @@ static struct {
integer curh, curv; /* current point */
integer magnification; /* The magnification as given by \mag */
integer unit; /* The unit, defaults to 1, use 8192 to produce shorter but less accurate info */
- integer total_length; /* The total length of the bytes written since the last check point */
+ integer total_length; /* The total length of the bytes written since the last check point */
+ integer options; /* unsigned options */
+ integer lastv; /* compression trick if
+ |synctex_options&4|>0. */
+ integer form_depth; /* pdf forms are an example of nested sheets */
struct _flags {
unsigned int option_read:1; /* Command line option read (in case of problem or at the end) */
unsigned int off:1; /* Definitely turn off synctex, corresponds to cli option -synctex=0 */
@@ -406,7 +415,7 @@ static struct {
unsigned int reserved:SYNCTEX_BITS_PER_BYTE*sizeof(int)-7; /* Align */
} flags;
} synctex_ctxt = {
- NULL, NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, {0,0,0,0,0,0,0,0}};
+ NULL, NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, {0,0,0,0,0,0,0,0}}; /* last_v_recorded is initialized to -1. */
# define SYNCTEX_FILE synctex_ctxt.file
# define SYNCTEX_IS_OFF (synctex_ctxt.flags.off)
@@ -415,6 +424,13 @@ static struct {
# define SYNCTEX_WARNING_DISABLE (synctex_ctxt.flags.warn)
# define SYNCTEX_fprintf (*synctex_ctxt.fprintf)
+# define SYNCTEX_IS_READY (synctex_ctxt.flags.ready)
+
+# define SYNCTEX_NO_GZ_AUX_NAME\
+ (SYNCTEX_NO_GZ||((synctex_ctxt.options)&2)!=0)
+# define SYNCTEX_WITH_FORMS (((synctex_ctxt.options)&4)!=0)
+# define SYNCTEX_H_COMPRESS (((synctex_ctxt.options)&8)!=0)
+
/* Initialize the options, synchronize the variables.
* This is sent by *tex.web before any TeX macro is used.
* */
@@ -429,13 +445,17 @@ void synctexinitcommand(void)
SYNCTEX_VALUE = 0;
} else if (synctex_options == 0) {
/* -synctex=0 was given: SyncTeX must be definitely disabled,
- * any subsequent \synctex=1 will have no effect at all */
+ * any subsequent \synctex=N will have no effect at all */
SYNCTEX_IS_OFF = SYNCTEX_YES;
SYNCTEX_VALUE = 0;
} else {
/* the command line options are not ignored */
if (synctex_options < 0) {
SYNCTEX_NO_GZ = SYNCTEX_YES;
+ synctex_ctxt.options = -synctex_options;
+ } else {
+ SYNCTEX_NO_GZ = SYNCTEX_NO;
+ synctex_ctxt.options = synctex_options;
}
/* Initialize the content of the \synctex primitive */
SYNCTEX_VALUE = synctex_options;
@@ -544,6 +564,9 @@ static int fsyscp_rename(char *s1, char *s2)
#define rename fsyscp_rename
#endif
+static inline int synctex_record_content(void);
+static inline int synctex_record_settings(void);
+
/* synctex_dot_open ensures that the foo.synctex file is open.
* In case of problem, it definitely disables synchronization.
* Now all the output synchronization info is gathered in only one file.
@@ -551,6 +574,7 @@ static int fsyscp_rename(char *s1, char *s2)
* plus 1 for the control but the overall benefits are not so clear.
* For example foo-i.synctex would contain input synchronization
* information for page i alone.
+ * Options given through \synctex=Number are managed here too.
*/
static void *synctex_dot_open(void)
{
@@ -566,6 +590,18 @@ static void *synctex_dot_open(void)
if (SYNCTEX_FILE) {
return SYNCTEX_FILE; /* synchronization is already enabled */
}
+ if (synctex_options < 0) {
+ SYNCTEX_NO_GZ = SYNCTEX_YES;
+ synctex_ctxt.options = -synctex_options;
+ } else if (synctex_options == 0) {
+ /* \synctex=0 was given: SyncTeX must be definitely disabled,
+ * any subsequent \synctex=N will have no effect at all */
+ SYNCTEX_IS_OFF = SYNCTEX_YES;
+ SYNCTEX_VALUE = 0;
+ } else {
+ SYNCTEX_NO_GZ = SYNCTEX_NO;
+ synctex_ctxt.options = synctex_options;
+ }
# if SYNCTEX_DEBUG
printf("\nwarning: Synchronize DEBUG: synctex_dot_open 1\n");
# endif
@@ -579,12 +615,11 @@ static void *synctex_dot_open(void)
if (len>0) {
/* jobname was set by the \jobname command on the *TeX side */
char *the_busy_name = xmalloc((size_t)
- ( len
- + strlen(synctex_suffix)
- + strlen(synctex_suffix_gz)
- + strlen(synctex_suffix_busy)
- + 1
- + (output_directory?strlen(output_directory) + strlen(DIR_SEP_STRING):0)));
+ ( len
+ + strlen(synctex_suffix)
+ + strlen(synctex_suffix_busy)
+ + 1
+ + (output_directory?strlen(output_directory) + strlen(DIR_SEP_STRING):0)));
if (!the_busy_name) {
SYNCTEX_FREE(tmp);
tmp = NULL;
@@ -620,8 +655,9 @@ static void *synctex_dot_open(void)
tmp = NULL;
strcat(the_busy_name, synctex_suffix);
/* Initialize SYNCTEX_NO_GZ with the content of \synctex to let the user choose the format. */
- SYNCTEX_NO_GZ = SYNCTEX_VALUE < 0 ? SYNCTEX_YES : SYNCTEX_NO;
- if (!SYNCTEX_NO_GZ) {
+#define SYNCTEX_GZ_LEN(WHAT)\
+(SYNCTEX_NO_GZ_AUX_NAME?0:strlen(WHAT))
+ if (!SYNCTEX_NO_GZ_AUX_NAME) {
strcat(the_busy_name, synctex_suffix_gz);
}
strcat(the_busy_name, synctex_suffix_busy);
@@ -656,7 +692,10 @@ static void *synctex_dot_open(void)
# endif
SYNCTEX_FREE(the_busy_name);
the_busy_name = NULL;
- return SYNCTEX_FILE;
+ if ((SYNCTEX_NO_ERROR == synctex_record_settings())
+ && (SYNCTEX_NO_ERROR == synctex_record_content())) {
+ return SYNCTEX_FILE;
+ }
} else {
printf("\nSyncTeX warning: no synchronization, problem with %s\n",
the_busy_name);
@@ -798,9 +837,11 @@ void synctexterminate(boolean log_opened)
# endif
if (log_opened && (tmp = SYNCTEX_GET_LOG_NAME())) {
/* In version 1, the jobname was used but it caused problems regarding spaces in file names. */
- the_real_syncname = xmalloc((unsigned)
- (strlen(tmp) + strlen(synctex_suffix) +
- strlen(synctex_suffix_gz) + 1));
+ the_real_syncname =
+ xmalloc((unsigned)(strlen(tmp)
+ + strlen(synctex_suffix)
+ + SYNCTEX_GZ_LEN(synctex_suffix_gz)
+ + 1));
if (!the_real_syncname) {
SYNCTEX_FREE(tmp);
synctexabort(0);
@@ -822,7 +863,9 @@ void synctexterminate(boolean log_opened)
if (!SYNCTEX_NO_GZ) {
/* Remove any uncompressed synctex file, from a previous build. */
remove(the_real_syncname);
- strcat(the_real_syncname, synctex_suffix_gz);
+ if (!SYNCTEX_NO_GZ_AUX_NAME) {
+ strcat(the_real_syncname, synctex_suffix_gz);
+ }
}
/* allways remove the synctex output file before renaming it, windows requires it. */
if (0 != remove(the_real_syncname) && errno == EACCES) {
@@ -852,12 +895,12 @@ void synctexterminate(boolean log_opened)
#ifdef W32UPTEXSYNCTEX
{
char *stmp = chgto_oem(tmp);
- printf((synctex_ctxt.flags.quoted ? "\nSyncTeX written on \"%s\"" : "\nSyncTeX written on %s."),
+ printf((synctex_ctxt.flags.quoted ? "SyncTeX written on \"%s\"" : "\nSyncTeX written on %s.\n"),
stmp);
free(stmp);
}
#else
- printf((synctex_ctxt.flags.quoted ? "\nSyncTeX written on \"%s\"" : "\nSyncTeX written on %s."),
+ printf((synctex_ctxt.flags.quoted ? "SyncTeX written on \"%s\"\n" : "SyncTeX written on %s.\n"),
tmp);
#endif
tmp = NULL;
@@ -878,7 +921,7 @@ void synctexterminate(boolean log_opened)
remove(synctex_ctxt.busy_name);
}
}
- if (SYNCTEX_NO_GZ) {
+ if (SYNCTEX_NO_GZ || SYNCTEX_NO_GZ_AUX_NAME) {
/* Remove any compressed synctex file, from a previous build. */
strcat(the_real_syncname, synctex_suffix_gz);
remove(the_real_syncname);
@@ -889,8 +932,10 @@ void synctexterminate(boolean log_opened)
We just try to remove existing synctex output files
including the busy one. */
the_real_syncname = xmalloc((size_t)
- (len + strlen(synctex_suffix)
- + strlen(synctex_suffix_gz) + 1));
+ (len
+ + strlen(synctex_suffix)
+ + SYNCTEX_GZ_LEN(synctex_suffix_gz)
+ + 1));
if (!the_real_syncname) {
SYNCTEX_FREE(tmp);
synctexabort(0);
@@ -935,8 +980,6 @@ void synctexterminate(boolean log_opened)
synctexabort(0);
}
-static inline int synctex_record_content(void);
-static inline int synctex_record_settings(void);
static inline int synctex_record_sheet(integer sheet);
/* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at
@@ -967,11 +1010,6 @@ void synctexsheet(integer mag)
if (mag > 0) {
synctex_ctxt.magnification = mag;
}
- if (SYNCTEX_NO_ERROR != synctex_record_settings()
- || SYNCTEX_NO_ERROR != synctex_record_content()) {
- synctexabort(0);
- return;
- }
}
synctex_record_sheet(SYNCTEX_GET_TOTAL_PAGES()+1);
}
@@ -981,6 +1019,7 @@ void synctexsheet(integer mag)
return;
}
+static inline int synctex_record_anchor(void);
static inline int synctex_record_teehs(integer sheet);
/* Recording the "}..." line. In *tex.web, use synctex_teehs at
@@ -1002,7 +1041,216 @@ void synctexteehs(void)
return;
}
-static inline void synctex_record_vlist(halfword p);
+/* The SYNCTEX_IGNORE macro is used to detect unproperly initialized nodes. See
+ * details in the implementation of the functions below. */
+# define SYNCTEX_IGNORE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE || (synctex_ctxt.form_depth>0 && !SYNCTEX_WITH_FORMS)
+#define SYNCTEX_RECORD_LEN_OR_RETURN_ERR do {\
+if (len > 0) {\
+synctex_ctxt.total_length += len;\
+++synctex_ctxt.count;\
+} else {\
+return -1;\
+} } while(false)
+#define SYNCTEX_RECORD_LEN_AND_RETURN_NOERR do {\
+if (len > 0) {\
+synctex_ctxt.total_length += len;\
+++synctex_ctxt.count;\
+return SYNCTEX_NOERR;\
+} } while(false)
+
+/* Recording a "}..." or a ">" line */
+static inline int synctex_record_teehs(integer sheet)
+{
+# if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_teehs\n");
+# endif
+ if (SYNCTEX_NOERR == synctex_record_anchor()) {
+ int len = SYNCTEX_fprintf(SYNCTEX_FILE, "}%i\n", sheet);
+ SYNCTEX_RECORD_LEN_AND_RETURN_NOERR;
+ }
+ synctexabort(0);
+ return -1;
+}
+
+# define SYNCTEX_CTXT_CURH \
+(synctex_ctxt.curh)
+# define SYNCTEX_CTXT_CURV \
+(synctex_ctxt.curv)
+# define SYNCTEX_SHOULD_COMPRESS_V \
+SYNCTEX_H_COMPRESS && (synctex_ctxt.lastv == SYNCTEX_CTXT_CURV)
+
+#if SYNCTEX_SUPPORT_PDF_FORM
+
+static inline int synctex_record_pdfxform(halfword form);
+
+/* glue code, this message is sent whenever a pdf form will ship out
+ See pdftex.web: procedure out_form(p: pointer); */
+void synctexpdfxform(halfword p)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexpdfxform\n");
+# endif
+ if (SYNCTEX_IS_OFF) {
+ if (SYNCTEX_VALUE && !SYNCTEX_WARNING_DISABLE) {
+ SYNCTEX_WARNING_DISABLE = SYNCTEX_YES;
+ printf
+ ("\nSyncTeX warning: Synchronization was disabled from\nthe command line with -synctex=0\nChanging the value of \\synctex has no effect.");
+ }
+ return;
+ }
+ if (SYNCTEX_FILE
+ || (SYNCTEX_VALUE && (SYNCTEX_NO_ERROR != synctex_dot_open()))) {
+ synctex_record_pdfxform(p);
+ }
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexpdfxform END\n");
+# endif
+ return;
+}
+
+static inline int synctex_record_mrofxfdp(void);
+
+/* glue code, this message is sent whenever a pdf form did ship out */
+void synctexmrofxfdp(void)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexmrofxfdp\n");
+# endif
+ synctex_record_mrofxfdp();
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexmrofxfdp END\n");
+# endif
+ return;
+}
+
+static inline int synctex_record_node_pdfrefxform(int formout);
+
+/* glue code, this message is sent whenever a pdf form ref will ship out
+ See pdftex.web: procedure out_form(p: pointer); */
+void synctexpdfrefxform(int objnum)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexpdfrefxform\n");
+# endif
+ if (SYNCTEX_WITH_FORMS) {
+ synctex_record_node_pdfrefxform(objnum);
+ }
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexpdfrefxform END\n");
+# endif
+ return;
+}
+
+/* Recording a "<..." line */
+static inline int synctex_record_pdfxform(halfword form)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctex_record_pdfxform\n");
+# endif
+ if (SYNCTEX_IGNORE(nothing)) {
+ return SYNCTEX_NO_ERROR;
+ } else {
+ ++synctex_ctxt.form_depth;
+ if (SYNCTEX_WITH_FORMS) {
+ int len = SYNCTEX_fprintf(SYNCTEX_FILE, "<%i\n",
+ SYNCTEX_PDF_CUR_FORM);
+ SYNCTEX_RECORD_LEN_AND_RETURN_NOERR;
+ } else {
+ return SYNCTEX_NO_ERROR;
+ }
+ }
+ synctexabort(0);
+ return -1;
+}
+
+/* Recording a ">" line */
+static inline int synctex_record_mrofxfdp(void)
+{
+# if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_mrofxfpd\n");
+# endif
+ if (SYNCTEX_NOERR == synctex_record_anchor()) {
+ --synctex_ctxt.form_depth;
+ if (SYNCTEX_WITH_FORMS) {
+ int len = SYNCTEX_fprintf(SYNCTEX_FILE, ">\n",
+ SYNCTEX_PDF_CUR_FORM);
+ SYNCTEX_RECORD_LEN_AND_RETURN_NOERR;
+ } else {
+ return SYNCTEX_NO_ERROR;
+ }
+ }
+ synctexabort(0);
+ return -1;
+}
+
+/* Recording a "f..." line */
+static inline int synctex_record_node_pdfrefxform(int objnum)//UNUSED form JL
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctex_record_node_pdfrefxform\n");
+# endif
+ synctex_ctxt.curh = SYNCTEX_CURH;
+ synctex_ctxt.curv = SYNCTEX_CURV;
+ if (SYNCTEX_IGNORE(nothing)) {
+ return SYNCTEX_NO_ERROR;
+ } else if (synctex_ctxt.form_depth>0 && !SYNCTEX_WITH_FORMS) {
+ return SYNCTEX_NO_ERROR;
+ } else {
+ int len = 0;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "f%i:%i,=\n",
+ objnum,
+ SYNCTEX_CURH UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "f%i:%i,%i\n",
+ objnum,
+ SYNCTEX_CURH UNIT,
+ SYNCTEX_CURV UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CURV;
+ }
+ SYNCTEX_RECORD_LEN_AND_RETURN_NOERR;
+ }
+ synctexabort(0);
+ return -1;
+}
+#else
+/* DO NOTHING functions.
+ Any engine will have these functions, even when not using pdf xforms.
+ One shoud be able to replace these void implementaions with an alternation in the header file.
+ */
+void synctexpdfxform(halfword p)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: DO NOTHING synctexpdfxform\n");
+# endif
+ return;
+}
+void synctexmrofxfdp(void)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: DO NOTHING synctexmrofxfdp END\n");
+# endif
+ return;
+}
+void synctexpdfrefxform(int objnum)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+# if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: DO NOTHING synctexpdfrefxform\n");
+# endif
+ return;
+}
+#endif
+/*#if SYNCTEX_SUPPORT_PDF_FORM*/
+
+static inline void synctex_record_node_vlist(halfword p);
/* When an hlist ships out, it can contain many different kern/glue nodes with
* exactly the same sync tag and line. To reduce the size of the .synctex
@@ -1012,16 +1260,12 @@ static inline void synctex_record_vlist(halfword p);
* consecutive nodes, as far as possible. This tricky part uses a "recorder",
* which is the address of the routine that knows how to write the
* synchronization info to the .synctex file. It also uses criteria to detect
- * a change in the context, this is the macro SYNCTEX_???_CONTEXT_DID_CHANGE. The
- * SYNCTEX_IGNORE macro is used to detect unproperly initialized nodes. See
- * details in the implementation of the functions below. */
-# define SYNCTEX_IGNORE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE
-
+ * a change in the context, this is the macro SYNCTEX_???_CONTEXT_DID_CHANGE.*/
/* This message is sent when a vlist will be shipped out, more precisely at
* the beginning of the vlist_out procedure in *TeX.web. It will be balanced
* by a synctex_tsilv, sent at the end of the vlist_out procedure. p is the
- * address of the vlist We assume that p is really a vlist node! */
+ * address of the vlist. We assume that p is really a vlist node! */
void synctexvlist(halfword this_box)
{
SYNCTEX_RETURN_IF_DISABLED;
@@ -1037,10 +1281,10 @@ void synctexvlist(halfword this_box)
synctex_ctxt.line = SYNCTEX_LINE_MODEL(this_box,box);
synctex_ctxt.curh = SYNCTEX_CURH;
synctex_ctxt.curv = SYNCTEX_CURV;
- synctex_record_vlist(this_box);
+ synctex_record_node_vlist(this_box);
}
-static inline void synctex_record_tsilv(halfword p);
+static inline void synctex_record_node_tsilv(halfword p);
/* Recording a "f" line ending a vbox: this message is sent whenever a vlist
* has been shipped out. It is used to close the vlist nesting level. It is
@@ -1062,10 +1306,10 @@ void synctextsilv(halfword this_box)
synctex_ctxt.curh = SYNCTEX_CURH;
synctex_ctxt.curv = SYNCTEX_CURV;
synctex_ctxt.recorder = NULL;
- synctex_record_tsilv(this_box);
+ synctex_record_node_tsilv(this_box);
}
-static inline void synctex_record_void_vlist(halfword p);
+static inline void synctex_record_node_void_vlist(halfword p);
/* This message is sent when a void vlist will be shipped out.
* There is no need to balance a void vlist. */
@@ -1084,7 +1328,7 @@ void synctexvoidvlist(halfword p, halfword this_box __attribute__ ((unused)))
synctex_ctxt.curh = SYNCTEX_CURH;
synctex_ctxt.curv = SYNCTEX_CURV;
synctex_ctxt.recorder = NULL; /* reset */
- synctex_record_void_vlist(p);
+ synctex_record_node_void_vlist(p);
}
static inline void synctex_record_hlist(halfword p);
@@ -1111,7 +1355,7 @@ void synctexhlist(halfword this_box)
synctex_record_hlist(this_box);
}
-static inline void synctex_record_tsilh(halfword p);
+static inline void synctex_record_node_tsilh(halfword p);
/* Recording a ")" line ending an hbox this message is sent whenever an hlist
* has been shipped out it is used to close the hlist nesting level. It is
@@ -1133,10 +1377,10 @@ void synctextsilh(halfword this_box)
synctex_ctxt.curh = SYNCTEX_CURH;
synctex_ctxt.curv = SYNCTEX_CURV;
synctex_ctxt.recorder = NULL; /* reset */
- synctex_record_tsilh(this_box);
+ synctex_record_node_tsilh(this_box);
}
-static inline void synctex_record_void_hlist(halfword p);
+static inline void synctex_record_node_void_hlist(halfword p);
/* This message is sent when a void hlist will be shipped out.
* There is no need to balance a void hlist. */
@@ -1160,11 +1404,12 @@ void synctexvoidhlist(halfword p, halfword this_box __attribute__ ((unused)))
synctex_ctxt.curh = SYNCTEX_CURH;
synctex_ctxt.curv = SYNCTEX_CURV;
synctex_ctxt.recorder = NULL; /* reset */
- synctex_record_void_hlist(p);
+ synctex_record_node_void_hlist(p);
}
/* With LuaTeX we have to consider other node sizes than medium ones */
# define SYNCTEX_IGNORE_NODE(NODE,TYPE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE \
+|| (synctex_ctxt.form_depth>0 && !SYNCTEX_WITH_FORMS) \
|| (0 >= SYNCTEX_TAG_MODEL(NODE,TYPE)) \
|| (0 >= SYNCTEX_LINE_MODEL(NODE,TYPE))
/* This macro will detect a change in the synchronization context. As long as
@@ -1175,7 +1420,7 @@ void synctexvoidhlist(halfword p, halfword this_box __attribute__ ((unused)))
|| (SYNCTEX_TAG_MODEL(NODE,TYPE) != synctex_ctxt.tag)\
|| (SYNCTEX_LINE_MODEL(NODE,TYPE) != synctex_ctxt.line))
-void synctex_math_recorder(halfword p);
+void synctex_record_node_math(halfword p);
/* glue code, this message is sent whenever an inline math node will ship out
See: @ @<Output the non-|char_node| |p| for... */
@@ -1198,12 +1443,12 @@ void synctexmath(halfword p, halfword this_box __attribute__ ((unused)))
synctex_ctxt.curh = SYNCTEX_CURH;
synctex_ctxt.curv = SYNCTEX_CURV;
synctex_ctxt.recorder = NULL;/* no need to record once more */
- synctex_math_recorder(p);/* always record synchronously */
+ synctex_record_node_math(p);/* always record synchronously */
}
-static inline void synctex_record_glue(halfword p);
-static inline void synctex_record_kern(halfword p);
-static inline void synctex_record_rule(halfword p);
+static inline void synctex_record_node_glue(halfword p);
+static inline void synctex_record_node_rule(halfword p);
+static inline void synctex_record_node_kern(halfword p);
/* this message is sent whenever an horizontal glue node or rule node ships out
See: move_past:... */
@@ -1216,7 +1461,7 @@ void synctexhorizontalruleorglue(halfword p, halfword this_box
{
SYNCTEX_RETURN_IF_DISABLED;
# if SYNCTEX_DEBUG
- printf("\nSynchronize DEBUG: synctexglue\n");
+ printf("\nSynchronize DEBUG: synctexhorizontalruleorglue\n");
# endif
switch (SYNCTEX_TYPE(p)) {
case rule_node:
@@ -1245,25 +1490,23 @@ void synctexhorizontalruleorglue(halfword p, halfword this_box
case rule_node:
synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,rule);
synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,rule);
- synctex_record_rule(p); /* always record synchronously: maybe some text is outside the box */
+ synctex_record_node_rule(p); /* always record synchronously: maybe some text is outside the box */
break;
case glue_node:
synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,glue);
synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,glue);
- synctex_record_glue(p); /* always record synchronously: maybe some text is outside the box */
+ synctex_record_node_glue(p); /* always record synchronously: maybe some text is outside the box */
break;
case kern_node:
synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,kern);
synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,kern);
- synctex_record_kern(p); /* always record synchronously: maybe some text is outside the box */
+ synctex_record_node_kern(p); /* always record synchronously: maybe some text is outside the box */
break;
default:
printf("\nSynchronize ERROR: unknown node type %i\n", SYNCTEX_TYPE(p));
}
}
-void synctex_kern_recorder(halfword p);
-
/* this message is sent whenever a kern node ships out
See: @ @<Output the non-|char_node| |p| for... */
void synctexkern(halfword p, halfword this_box)
@@ -1286,7 +1529,7 @@ void synctexkern(halfword p, halfword this_box)
synctex_ctxt.node = p;
synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,kern);
synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,kern);
- synctex_ctxt.recorder = &synctex_kern_recorder;
+ synctex_ctxt.recorder = &synctex_record_node_kern;
} else {
synctex_ctxt.node = p;
synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,kern);
@@ -1294,14 +1537,14 @@ void synctexkern(halfword p, halfword this_box)
synctex_ctxt.recorder = NULL;
/* always record when the context has just changed
* and when not the first node */
- synctex_kern_recorder(p);
+ synctex_record_node_kern(p);
}
} else {
/* just update the geometry and type (for future improvements) */
synctex_ctxt.node = p;
synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,kern);
synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,kern);
- synctex_ctxt.recorder = &synctex_kern_recorder;
+ synctex_ctxt.recorder = &synctex_record_node_kern;
}
}
@@ -1311,7 +1554,7 @@ void synctexkern(halfword p, halfword this_box)
# define SYNCTEX_IGNORE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE \
|| (synctex_ctxt.count>2000)
-void synctex_char_recorder(halfword p);
+void synctex_record_node_char(halfword p);
/* this message is sent whenever a char node ships out */
void synctexchar(halfword p, halfword this_box __attribute__ ((unused)))
@@ -1332,10 +1575,10 @@ void synctexchar(halfword p, halfword this_box __attribute__ ((unused)))
synctex_ctxt.line = 0;
synctex_ctxt.recorder = NULL;
/* always record when the context has just changed */
- synctex_char_recorder(p);
+ synctex_record_node_char(p);
}
-void synctex_node_recorder(halfword p);
+void synctex_record_node_unknown(halfword p);
# undef SYNCTEX_IGNORE
# define SYNCTEX_IGNORE(NODE) (SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE)
@@ -1352,7 +1595,7 @@ void synctexnode(halfword p, halfword this_box __attribute__ ((unused)))
return;
}
/* always record, not very usefull yet */
- synctex_node_recorder(p);
+ synctex_record_node_unknown(p);
}
/* this message should be sent to record information
@@ -1366,9 +1609,18 @@ void synctexcurrent(void)
if (SYNCTEX_IGNORE(nothing)) {
return;
} else {
- int len = SYNCTEX_fprintf(SYNCTEX_FILE, "x%i,%i:%i,%i\n",
+ int len = 0;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "x%i,%i:%i,=\n",
+ synctex_ctxt.tag,synctex_ctxt.line,
+ SYNCTEX_CURH UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "x%i,%i:%i,%i\n",
synctex_ctxt.tag,synctex_ctxt.line,
- SYNCTEX_CURH UNIT,SYNCTEX_CURV UNIT);
+ SYNCTEX_CURH UNIT,
+ SYNCTEX_CURV UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CURV;
+ }
if (len > 0) {
synctex_ctxt.total_length += len;
return;
@@ -1409,7 +1661,9 @@ static inline int synctex_record_preamble(void)
printf("\nSynchronize DEBUG: synctex_record_preamble\n");
# endif
len =
- SYNCTEX_fprintf(SYNCTEX_FILE, "SyncTeX Version:%i\n", SYNCTEX_VERSION);
+ SYNCTEX_fprintf(SYNCTEX_FILE, "SyncTeX Version:%i\n",
+ synctex_ctxt.options>SYNCTEX_VERSION?
+ synctex_ctxt.options:SYNCTEX_VERSION);
if (len > 0) {
synctex_ctxt.total_length = len;
return SYNCTEX_NOERR;
@@ -1475,116 +1729,121 @@ static inline int synctex_record_sheet(integer sheet)
# endif
if (SYNCTEX_NOERR == synctex_record_anchor()) {
int len = SYNCTEX_fprintf(SYNCTEX_FILE, "{%i\n", sheet);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return SYNCTEX_NOERR;
- }
- }
- synctexabort(0);
- return -1;
-}
-
-/* Recording a "}..." line */
-static inline int synctex_record_teehs(integer sheet)
-{
-# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_teehs\n");
-# endif
- if (SYNCTEX_NOERR == synctex_record_anchor()) {
- int len = SYNCTEX_fprintf(SYNCTEX_FILE, "}%i\n", sheet);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return SYNCTEX_NOERR;
- }
+ SYNCTEX_RECORD_LEN_AND_RETURN_NOERR;
}
synctexabort(0);
return -1;
}
/* Recording a "v..." line */
-static inline void synctex_record_void_vlist(halfword p)
+static inline void synctex_record_node_void_vlist(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_void_vlist\n");
-# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "v%i,%i:%i,%i:%i,%i,%i\n",
- SYNCTEX_TAG_MODEL(p,box),
- SYNCTEX_LINE_MODEL(p,box),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_WIDTH(p) UNIT,
- SYNCTEX_HEIGHT(p) UNIT,
- SYNCTEX_DEPTH(p) UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
- }
+ printf("\nSynchronize DEBUG: synctex_record_node_void_vlist\n");
+# endif
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "v%i,%i:%i,=:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "v%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
+ }
+# define SYNCTEX_RECORD_LEN_AND_RETURN do {\
+ if (len > 0) {\
+ synctex_ctxt.total_length += len;\
+ ++synctex_ctxt.count;\
+ return;\
+ } } while(false)
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "[..." line */
-static inline void synctex_record_vlist(halfword p)
+static inline void synctex_record_node_vlist(halfword p)
{
int len = 0;
SYNCTEX_NOT_VOID = SYNCTEX_YES;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_vlist\n");
-# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "[%i,%i:%i,%i:%i,%i,%i\n",
- SYNCTEX_TAG_MODEL(p,box),
- SYNCTEX_LINE_MODEL(p,box),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_WIDTH(p) UNIT,
- SYNCTEX_HEIGHT(p) UNIT,
- SYNCTEX_DEPTH(p) UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ printf("\nSynchronize DEBUG: synctex_record_node_vlist\n");
+# endif
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "[%i,%i:%i,=:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "[%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "]..." line */
-static inline void synctex_record_tsilv(halfword p __attribute__ ((unused)))
+static inline void synctex_record_node_tsilv(halfword p __attribute__ ((unused)))
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_tsilv\n");
+ printf("\nSynchronize DEBUG: synctex_record_node_tsilv\n");
# endif
len = SYNCTEX_fprintf(SYNCTEX_FILE, "]\n");
- if (len > 0) {
- synctex_ctxt.total_length += len;
- return;
- }
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "h..." line */
-static inline void synctex_record_void_hlist(halfword p)
+static inline void synctex_record_node_void_hlist(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_void_hlist\n");
-# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "h%i,%i:%i,%i:%i,%i,%i\n",
- SYNCTEX_TAG_MODEL(p,box),
- SYNCTEX_LINE_MODEL(p,box),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_WIDTH(p) UNIT,
- SYNCTEX_HEIGHT(p) UNIT,
- SYNCTEX_DEPTH(p) UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ printf("\nSynchronize DEBUG: synctex_record_node_void_hlist\n");
+# endif
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "h%i,%i:%i,=:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "h%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
@@ -1597,35 +1856,39 @@ static inline void synctex_record_hlist(halfword p)
# if SYNCTEX_DEBUG > 999
printf("\nSynchronize DEBUG: synctex_record_hlist\n");
# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "(%i,%i:%i,%i:%i,%i,%i\n",
- SYNCTEX_TAG_MODEL(p,box),
- SYNCTEX_LINE_MODEL(p,box),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_WIDTH(p) UNIT,
- SYNCTEX_HEIGHT(p) UNIT,
- SYNCTEX_DEPTH(p) UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "(%i,%i:%i,=:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "(%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box),
+ SYNCTEX_LINE_MODEL(p,box),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a ")..." line */
-static inline void synctex_record_tsilh(halfword p __attribute__ ((unused)))
+static inline void synctex_record_node_tsilh(halfword p __attribute__ ((unused)))
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_tsilh\n");
+ printf("\nSynchronize DEBUG: synctex_record_node_tsilh\n");
# endif
len = SYNCTEX_fprintf(SYNCTEX_FILE, ")\n");
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
- }
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
@@ -1671,141 +1934,149 @@ static inline int synctex_record_postamble(void)
}
/* Recording a "g..." line */
-static inline void synctex_record_glue(halfword p)
+static inline void synctex_record_node_glue(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_glue_recorder\n");
+ printf("\nSynchronize DEBUG: synctex_record_node_glue\n");
# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "g%i,%i:%i,%i\n",
- SYNCTEX_TAG_MODEL(p,glue),
- SYNCTEX_LINE_MODEL(p,glue),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "g%i,%i:%i,=\n",
+ SYNCTEX_TAG_MODEL(p,glue),
+ SYNCTEX_LINE_MODEL(p,glue),
+ SYNCTEX_CTXT_CURH UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "g%i,%i:%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,glue),
+ SYNCTEX_LINE_MODEL(p,glue),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "k..." line */
-static inline void synctex_record_kern(halfword p)
+static inline void synctex_record_node_kern(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_kern_recorder\n");
-# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "k%i,%i:%i,%i:%i\n",
- SYNCTEX_TAG_MODEL(p,glue),
- SYNCTEX_LINE_MODEL(p,glue),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_WIDTH(p) UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ printf("\nSynchronize DEBUG: synctex_record_node_kern\n");
+# endif
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "k%i,%i:%i,=:%i\n",
+ SYNCTEX_TAG_MODEL(p,glue),
+ SYNCTEX_LINE_MODEL(p,glue),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_WIDTH(p) UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "k%i,%i:%i,%i:%i\n",
+ SYNCTEX_TAG_MODEL(p,glue),
+ SYNCTEX_LINE_MODEL(p,glue),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_WIDTH(p) UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "r..." line */
-static inline void synctex_record_rule(halfword p)
+static inline void synctex_record_node_rule(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_record_tsilh\n");
-# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "r%i,%i:%i,%i:%i,%i,%i\n",
- SYNCTEX_TAG_MODEL(p,rule),
- SYNCTEX_LINE_MODEL(p,rule),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_RULE_WD UNIT, SYNCTEX_RULE_HT UNIT, SYNCTEX_RULE_DP UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ printf("\nSynchronize DEBUG: synctex_record_node_tsilh\n");
+# endif
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "r%i,%i:%i,=:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,rule),
+ SYNCTEX_LINE_MODEL(p,rule),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_RULE_WD UNIT, SYNCTEX_RULE_HT UNIT, SYNCTEX_RULE_DP UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "r%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,rule),
+ SYNCTEX_LINE_MODEL(p,rule),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_RULE_WD UNIT, SYNCTEX_RULE_HT UNIT, SYNCTEX_RULE_DP UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "$..." line */
-void synctex_math_recorder(halfword p)
-{
- int len = 0;
-# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_math_recorder\n");
-# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "$%i,%i:%i,%i\n",
- SYNCTEX_TAG_MODEL(p, math),
- SYNCTEX_LINE_MODEL(p, math),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
- }
- synctexabort(0);
- return;
-}
-
-/* Recording a "k..." line */
-void synctex_kern_recorder(halfword p)
+void synctex_record_node_math(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_kern_recorder\n");
+ printf("\nSynchronize DEBUG: synctex_record_node_math\n");
# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "k%i,%i:%i,%i:%i\n",
- SYNCTEX_TAG_MODEL(p, kern),
- SYNCTEX_LINE_MODEL(p, kern),
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_WIDTH(p) UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "$%i,%i:%i,=\n",
+ SYNCTEX_TAG_MODEL(p, math),
+ SYNCTEX_LINE_MODEL(p, math),
+ SYNCTEX_CTXT_CURH UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "$%i,%i:%i,%i\n",
+ SYNCTEX_TAG_MODEL(p, math),
+ SYNCTEX_LINE_MODEL(p, math),
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "c..." line */
-void synctex_char_recorder(halfword p __attribute__ ((unused)))
+void synctex_record_node_char(halfword p __attribute__ ((unused)))
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_char_recorder\n");
+ printf("\nSynchronize DEBUG: synctex_record_node_char\n");
# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "c%i,%i\n",
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT);
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "c%i,=\n",
+ SYNCTEX_CTXT_CURH UNIT);
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "c%i,%i\n",
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT);
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
/* Recording a "?..." line, type, subtype and position */
-void synctex_node_recorder(halfword p)
+void synctex_record_node_unknown(halfword p)
{
int len = 0;
# if SYNCTEX_DEBUG > 999
- printf("\nSynchronize DEBUG: synctex_node_recorder(0x%x)\n", p);
+ printf("\nSynchronize DEBUG: synctex_record_node_unknown(0x%x)\n", p);
# endif
- len = SYNCTEX_fprintf(SYNCTEX_FILE, "?%i,%i:%i,%i\n",
- synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
- SYNCTEX_TYPE(p), SYNCTEX_SUBTYPE(p));
- if (len > 0) {
- synctex_ctxt.total_length += len;
- ++synctex_ctxt.count;
- return;
+ if (SYNCTEX_SHOULD_COMPRESS_V) {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "?%i,=:%i,%i\n",
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_TYPE(p), SYNCTEX_SUBTYPE(p));
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE, "?%i,%i:%i,%i\n",
+ SYNCTEX_CTXT_CURH UNIT,
+ SYNCTEX_CTXT_CURV UNIT,
+ SYNCTEX_TYPE(p), SYNCTEX_SUBTYPE(p));
+ synctex_ctxt.lastv = SYNCTEX_CTXT_CURV;
}
+ SYNCTEX_RECORD_LEN_AND_RETURN;
synctexabort(0);
return;
}
diff --git a/Build/source/texk/web2c/synctexdir/synctex.defines b/Build/source/texk/web2c/synctexdir/synctex.defines
index 89487670c68..159861b0f3a 100644
--- a/Build/source/texk/web2c/synctexdir/synctex.defines
+++ b/Build/source/texk/web2c/synctexdir/synctex.defines
@@ -1,9 +1,10 @@
{
-Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr
+Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
-Latest Revision: Wed Jul 1 11:18:05 UTC 2009
+Version 1
+Latest Revision: Sat Apr 22 10:07:05 UTC 2017
License:
--------
@@ -43,9 +44,6 @@ 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.
-Version 1
-Latest Revision: Wed Jul 1 08:17:41 UTC 2009
-
Notice:
-------
This file is an interface to the synctex system for web2c.
@@ -74,5 +72,9 @@ from web to c (See the convert shell script).
@define procedure synctexcurrent;
@define procedure synctexhorizontalruleorglue();
+@define procedure synctexpdfxform();
+@define procedure synctexmrofxfdp;
+@define procedure synctexpdfrefxform();
+
{ end of synctex.defines }
{ vim: set syntax=web : }
diff --git a/Build/source/texk/web2c/synctexdir/synctex.h b/Build/source/texk/web2c/synctexdir/synctex.h
index 96e03c84cd9..4fcf5d65c42 100644
--- a/Build/source/texk/web2c/synctexdir/synctex.h
+++ b/Build/source/texk/web2c/synctexdir/synctex.h
@@ -1,9 +1,12 @@
/* synctex.h
-Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr
+Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
+Version 1
+Lates Revision: Sat Apr 22 10:07:05 UTC 2017
+
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
@@ -35,9 +38,6 @@ 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.
-Version 1
-Latest Revision: Wed Jul 1 08:17:50 UTC 2009
-
*/
# ifndef __SYNCTEX_HEADER__
@@ -53,14 +53,24 @@ extern void synctexstartinput(void);
/* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at
* the very beginning of the ship_out procedure.
-*/
+ */
extern void synctexsheet(integer mag);
/* Recording the "}..." line. In *tex.web, use synctex_teehs at
* the very end of the ship_out procedure.
-*/
+ */
extern void synctexteehs(void);
+/* Recording the "<..." line. In pdftex.web, use synctex_pdfxform(p) at
+ * the very beginning of the pdf_ship_out procedure.
+ */
+extern void synctexpdfxform(halfword p);
+
+/* Recording the ">" line. In pdftex.web, use synctex_mrofxfdp at
+ * the very end of the ship_out procedure.
+ */
+extern void synctexmrofxfdp(void);
+
/* This message is sent when a vlist will be shipped out, more precisely at
* the beginning of the vlist_out procedure in *TeX.web. It will be balanced
* by a synctex_tsilv, sent at the end of the vlist_out procedure. p is the
@@ -100,6 +110,10 @@ extern void synctexhorizontalruleorglue(halfword p, halfword this_box);
/* Send this message whenever a kern node will ship out. */
extern void synctexkern(halfword p, halfword this_box);
+/* Recording the "f" line. In pdftex.web, use synctex_pdfrefxform when \pfdrefxform si used.
+ */
+extern void synctexpdfrefxform(int objnum);
+
/* this message is sent whenever a char node ships out */
extern void synctexchar(halfword p, halfword this_box);