Sublime Text – How to Compile a Complex Document in Sublime Text 3 with LaTeXTools Like in TeXstudio with TeXLive

sublime-textsumatrapdf

I am having trouble in configuring the Sublime Text Latextools package to meet my Texstudio config.

So I was trying to compile a really complex document on Latex thanks to LatexTools in Sublime Text 3. But it wasn't easy as I had a bibliography, glossary, nomenclature and such things that make a normal compilation not strong enough. But as you may know, latex is good with complexe documents, so …

Anyway, the things I needed to duplicate from Texstudio were :

  • In Compilation, choose the PDFLaTeX compilation parameter : pdflatex.exe -synctex=1 -interaction=nonstopmode -shell-escape %.tex
  • In Production, choose Biber as the default bibliography engine.
  • Remember to press F9 to update the glossary when it is modified before compiling.
  • Remember also to create a user command "Make Nomenclature". : makeindex -s nomencl.ist -t %.nlg -o %.nls %.nlo (https://www.youtube.com/watch?v=kW97Yv0-QC4)
  • Compile with F5 to compile and view. The compilation can be launched several times to take into account the bibliography, wait until it is indicated: system returned with code 1 Process completed normally. Otherwise, check the logs and correct the errors.

But I can't manage to get the script builder to make the nomenclature with my commands. Any help ?

Best Answer

Make sure to have Texlive, Summatra PDF, and ImageMagick (read the Latextools doc for more informations or possibilities).

And in Sublime, you just need to go to Preferences > Package settings > Latextools > Reset user settings to default.

And you'll then make these changes :

  • Change the distro from miktex to texlive.

  • Texpath should have been auto added but you can edit it to your conveniance if the Check System function doesn't tell you that everything is available.

  • Go down to builder and select "script".

  • In builder setings, add a "script_commands" inside your OS with these lines :

    "windows" : { // See README or third-party documentation "script_commands" : [ "pdflatex -synctex=1 -interaction=nonstopmode -shell-escape", "biber", "makeindex -s nomencl.ist -t $file_base_name.nlg -o $file_base_name.nls $file_base_name.nlo", "makeglossaries", "pdflatex -synctex=1 -interaction=nonstopmode -shell-escape", "pdflatex -synctex=1 -interaction=nonstopmode -shell-escape" ] },

  • Then add the option inside builder settings (not inside your OS there) : "options" : ["--shell-escape"],

That's it ! You should be able to compile with ctrl+b or ctrl+shift+b and using the "Latex - Script Builder".

If you want then to have a simpler and faster compilation system, select the "basic" builder and add the option "program": "pdflatex", inside your builder_settings.

More informations available here : https://latextools.readthedocs.io/en/latest/install/