使用乳胶而不是来自LaTeXTools插件的pdflatex运行Sublime Text构建

时间:2012-12-26 00:28:12

标签: build makefile latex sublimetext2

在Sublime Text的LatexTools插件提供的构建文件中,我修改了语句

"cmd": ["latexmk", "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'", "-f", "-pdf"]

用latex替换pdflatex的第二个实例。 我的问题是,如何指定是否要使用" dvipdfm"或者" dvi2ps + ps2pdf"。

如果有人可以为此目的提供样本构建文件,那将是最有帮助的。

1 个答案:

答案 0 :(得分:0)

经过一些试验和错误后,我终于让以下构建文件正常工作了。这允许我在pdflatex和latex之间做出选择,也可以在dvipdfm和“dvi2ps + ps2pdf”之间进行选择

    // Compilation settings
    // ====================
    //
// The actual magic happens in the make_pdf command
// I stick to the format of standard ST2 sublime-build files
// with minor variations.
// NOTE: the viewer is NOT configured from here! 
// As of 5/24/11, it cannot be changed, but I will introduce a setting later

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

    //-----------------------
    // Linux-specific settings
    // ----------------------
    // If  linux/os variable is used, then command palette does not show variant names

        // Linux texification settings
        // -------------------------
        // Personalize this, IF you know what you are doing!
        // e.g. change 'pdflatex...' to 'xelatex...'
        // Refer to the documentation for latexmk
        //
        // Note: do NOT include $file or similar!!!
        // Only configure the compilation parameters you need, MINUS the
        // actual file to be compiled
        // 
        // By default, latexmk is told to use pdflatex, with synctex on for
        // backward/forward search, forcing compilation (e.g. even if no bib file is found)
        // and producing pdf rather than dvi output



        "cmd": ["latexmk",
                "-e","\\$dvipdf = 'dvipdfmx %O -o %D %S'", "-e", "\\$latex = 'latex %O -interaction=nonstopmode -synctex=1 %S'",
                "-f", "-pdfdvi"],


        "variants":
        [

        { "cmd": ["latexmk",
                "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",
                "-f", "-pdf"],
          "name": "Run"
        },


        { "cmd": ["latexmk",
                "-e", "\\$latex = 'latex %O -interaction=nonstopmode -synctex=1 %S'",
                "-f", "-pdfps"],
          "name": "LaTeX_PS_PDF"
        },

        {"cmd": ["latexmk", "-e",  "\\$clean_ext = 'aux fls fdb_latexmk dvi ps synctex.gz'", "-c"],
         "name" : "Clean "
        }

        ]       
}