Configure LaTeXTools plugin custom compilation

After Sublime Text installs the LaTeXTools plugin, the default compilation tool is latexmk (TeXLive). In most cases, latexmk should be enough. It can determine the number of times to compile, including the references cited by bibtex. But sometimes there is a need to customize the compilation engine or order.

The following takes the compilation of pdflatex+bibtex+pdflatex*2 as an example to illustrate how to customize LaTeX compilation.

(referenced from LaTeXTools )

There is a default configuration file LaTeXTools.sublime-settings in the installation directory of LaTeXTools (the default is ~/Library/Application Support/Sublime Text 3/Packages/LaTeXTools under Mac), copy it to the Use folder in the upper directory of the installation directory Down. The configuration files in the installation directory are not recommended to be modified, but they are copied to the User directory and used as user-defined configurations for modification. Open the configuration file which can be seen in the build engine settings section

// Build engine settings
// ------------------------------------------------------------------

        // OPTION: "builder"
        // Specifies a build engine
        // Possible values:
        //
        // "default" or ""      the default built-in build engine; currently
        //                                      this is the same as "traditional"
        //
        // "simple"                     invokes pdflatex 1x or 2x as needed, then
        //                                      bibtex and pdflatex again if needed;
        //                                      intended mainly as a simple example for
        //                                      people writing their own build engines.
        //
        // "traditional"        replicates the 'old' system based on
        //                                      latexmk (TeXLive) / texify (MiKTeX)
        //
        // "script"                     external script: invokes the set of commands
        //                                      specified in the "script_commands" setting
        //                                      in the platform-specific part of the
        //                                      "builder_settings"
        //
        // custom name          you can also use third-party build engines;
        //                                      if so, set the "builder_path" option below
        //
        // NOTE: custom builders CANNOT have the same name as an existing
        // built-in build engine (including "default")

        "builder": "traditional",

The default compilation engine is "traditional", which is latexmk (TeXLive). Compilation can be customized by setting the compilation engine to "script" and then setting the desired "script_commands". To realize the compilation of pdflatex+bibtex+pdflatex*2, you need to add the compilation command to the corresponding platform entry of "builder_settings", for example, I am under Mac:

...
"osx" : {
        // See README or third-party documentation
        "script_commands": [
            "pdflatex -synctex=1 -interaction=nonstopmode",
            "bibtex",
            "pdflatex -synctex=1 -interaction=nonstopmode",
            "pdflatex -synctex=1 -interaction=nonstopmode"
        ]
},
...

save document. When compiling the tex file again, the default is to compile pdflatex+bibtex+pdflatex*2.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325482942&siteId=291194637