Sublime Forum

Build System env Option

#1

Hi,

I try to make the following build system to work (XeLatex with MikTex).

{
 // General settings; DO NOT MODIFY!!!
 "target": "make_pdf",
 "selector": "text.tex.latex",

 // Windows-specific settings
 // -------------------------
 "windows":
  {
   "cmd": "texify",
    "-b", "-p","--run-viewer","--clean",
    "--viewer-option=\"-reuse-instance\"",
    "--tex-option=\"--synctex=1\""
   ],

   "env": { "PDFLATEX":"xelatex",
        "TEXINPUTS":"Q:\\@Administration\\@Include;Q:\\@Documents\\@Include;",
        "BIBINPUTS":"Q:\\@Documents\\@Bibs",
        "MIKTEX_VIEW_pdf":"K:\\Apps\\SumatraPDFPortable\\SumatraPDF.exe %f"
       },

   "path": "K:\\Apps\\MikTex\\miktex\\bin;$PATH",
   "file_regex": "^((?:.:)?^:\n\r]*):([0-9]+):?([0-9]+)?(think) (.*)$"
  }
}

It uses the “env” option, that seems to be unrecognized.

run() got an unexpected keyword argument 'env'

I discovered this option on this page: sublimetext.info/docs/en/referen … nvironment

Am I doing something wrong or did something change to achieve this ?
I use the build 2175 on Windows

Thank you

0 Likes

#2

I have tried it and it does not work for me neither. It would be great to have a xelatex compiler wihtout to change the environment for the portable version…
If someone find howto please post the answer…

0 Likes

#3

In the example above, “target”=“make_pdf” is overriding the “exec” command used by default. “exec” takes an “env” parameter, but it seems your “make_pdf” custom command doesn’t.

If “make_pdf” is an executable file as opposed to a Sublime Text command, just use “cmd”:“make_pdf” instead.

0 Likes

#4

To clarify, “make_pdf” receives all data in the .sublime-build file; what to do with that data is up to “make_pdf”. “exec” is simply a default implementation of what to do with the .sublime-build data.

0 Likes

#5

It make perfect sense, thank you for your answer !
In this case, make_pdf is a python script from the ST2 package “LaTexTools”. I guess I’ll try editing it to make it understand this option.

0 Likes