SyncTeX-js

SyncTeX-js.png SyncTeX is a new method in TeXLive 2008 for enabling synchronization between source TeX files and the resulting PDF file. This repository contains a JavaScript implementation of for SyncTeX. It has been originally developed for \BlueLaTex , an open-source LaTeX editor for the Web. SyncTeX-js is now used in LaTeX Workshop as the main SyncTex parser for 330,905 installs.

Output

{
  "offset": {
    "x": 0,
    "y": 0
  },
  "version": "1",
  "files": {
    "1": {
      "path": "/home/thomas/blueData/papers/x4dcc87de752e4b86/./main.tex",
      "name": "main.tex"
    },
    "2": {
      "path": "/usr/share/texlive/texmf-dist/tex/latex/base/article.cls",
      "name": "article.cls"
    }
  },
  "pages": {
    "1": {
      "page": 1, // page number
      "blocks": [
        {
          "type": "vertical",
          "parent": "<ref to parent>",
          "fileNumber": 1,
          "file": "<ref to file>",
          "line": 27,
          "left": 71.99998905471669,
          "bottom": 765.1950023836396,
          "width": 483.30710519146953,
          "height": 693.1950133289229,
          "depth": 0,
          "blocks": [
            {
              "type": "vertical",
              "parent": "<ref to parent>",
              "fileNumber": 1,
              "file": "<ref to file>",
              "line": 27,
              "left": 56.69290392959994,
              "bottom": 765.1950023836396,
              "width": 498.6141903165863,
              "height": 745.3638668226573,
              "depth": 0,
              "blocks": [...],
              "elements": [...],
              "page": 1
            }
          ],
          "elements": [],
          "page": 1
        }
      ],
      "type": "page"
    }
  },
  "blockNumberLine": {
    "main.tex": { // file name
      "20": { // line number
        "1": [ // block in page
          { // element in the line
            "type": "k",
            "parent": "<ref to parent>",
            "fileNumber": 1,
            "file": "<ref to file>",
            "line": 27,
            "left": 555.3070942461862,
            "bottom": 765.1950023836396,
            "height": 6.39113334760274,
            "width": 246.8170356037905,
            "page": 1
          }
        ]
      }
    }
  },
  "hBlocks": [ // all horizontal block of the document
  ],
  "numberPages": 1
}
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
Last Updated: 31/05/2022