@@ -16,8 +16,8 @@ class LatexSynctexHandler(APIHandler):
16
16
A handler that runs synctex on the server.
17
17
"""
18
18
19
- def initialize (self , notebook_dir ):
20
- self .notebook_dir = notebook_dir
19
+ def initialize (self , root_dir ):
20
+ self .root_dir = root_dir
21
21
22
22
23
23
def build_synctex_cmd (self , base_name , ext ):
@@ -79,7 +79,7 @@ def build_synctex_edit_cmd(self, pdf_name, pos):
79
79
"""
80
80
c = LatexConfig (config = self .config )
81
81
82
- pdf_path = os .path .join (self .notebook_dir , pdf_name + ".pdf" )
82
+ pdf_path = os .path .join (self .root_dir , pdf_name + ".pdf" )
83
83
84
84
cmd = (
85
85
c .synctex_command ,
@@ -107,8 +107,8 @@ def build_synctex_view_cmd(self, tex_name, pos):
107
107
108
108
"""
109
109
c = LatexConfig (config = self .config )
110
- pdf_path = os .path .join (self .notebook_dir , tex_name + ".pdf" )
111
- tex_path = os .path .join (self .notebook_dir , tex_name + ".tex" )
110
+ pdf_path = os .path .join (self .root_dir , tex_name + ".pdf" )
111
+ tex_path = os .path .join (self .root_dir , tex_name + ".tex" )
112
112
113
113
cmd = (
114
114
c .synctex_command ,
@@ -145,6 +145,7 @@ def run_synctex(self, cmd):
145
145
there.
146
146
147
147
"""
148
+ self .log .debug (f'jupyterlab-latex: run: { " " .join (cmd )} (CWD: { os .getcwd ()} )' )
148
149
code , output = yield run_command (cmd )
149
150
if code != 0 :
150
151
self .set_status (500 )
@@ -176,7 +177,7 @@ def get(self, path = ''):
176
177
# Parse the path into the base name and extension of the file
177
178
relative_file_path = str (Path (path .strip ('/' )))
178
179
relative_base_path = os .path .splitext (relative_file_path )[0 ]
179
- full_file_path = os .path .join (self .notebook_dir , relative_file_path )
180
+ full_file_path = os .path .join (self .root_dir , relative_file_path )
180
181
workdir = os .path .dirname (full_file_path )
181
182
base_name , ext = os .path .splitext (os .path .basename (full_file_path ))
182
183
0 commit comments