运行shell脚本/ bash的在崇高的文本乳胶构建命令不带任何参数的文件 [英] run shell script/bash commands in Sublime Text latex build without any file arguments

查看:139
本文介绍了运行shell脚本/ bash的在崇高的文本乳胶构建命令不带任何参数的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对乳胶运行一个崇高的文本生成系统。我使用一个shell脚本(不带参数)删除由乳胶产生的各种扩展。
问题是崇高的,本文认为filename.tex是参数的脚本。

I have a sublime text build system for running latex. I am using a shell script (with no arguments) to delete the various extensions that are generated by latex. The problem is that sublime-text thinks filename.tex is the argument to the script.

所以,我想下面的脚本:

So I tried the following script:

    {

// General settings
"target": "make_pdf",
"selector": "text.tex.latex",


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

"variants":
[

    { "cmd":["my_script.sh"],
      "name": "clean"
    }
  ]
}

在这里,我用来代替脚本的LS来说明。当我运行生成文件,它会尝试运行

Here I used ls in place of the script to illustrate. When I run the build-file, it tries to run

my_script.sh filename.tex

而不是仅仅my_script.sh。我能做些什么,从构建文件只是运行?

instead of just my_script.sh. What can I do to run just that from the build file ?

推荐答案

我一直在那里,这样做。 。 。那里,然后再返回。 。 。一次又一次访问。 。

I have been there and done that . . . there and back again . . . and visited again and again . . .

解决方案是使用自定义的插件(不一定依赖于一个 .sublime建造,但也是可能的),这样​​你可以参照*。 TEX文件是开放的。我有一些解决方案,您可能不知道,其中一个是我自己的,和一个在那里我修改流行插件LaTexTools。

The solution is to use a custom plugin (not necessarily relying upon a .sublime-build, but that is possible too) so that you can refer to the *.tex file that is open. I have some solutions you are probably unaware of, one of which is my own, and one where I modify the popular plugin LaTexTools.

latexmk用大-C(一切)或稍微-c(一些事情是$ P $对限定,并且附加的东西,可以是用户定义的)清除 - 所以没有必要使用单独的自定义脚本清洁

latexmk cleans with a big -C (everything) or a little -c (some things that are pre-defined, and additional things that can be user-defined) -- so there is no need to use a separate custom cleaner script.

https://github.com/lawlist/LaTexTools-Unofficial-Modification

https://github.com/lawlist/ST2-plugin- latexmk - 保存 - 构建清洁

FYI:我建议把乳胶(或类似的东西)的问题你的主题行 - 我几乎错过了你的问题。 。 。 ,只是碰巧看到了简短的总结和认识,我知道一些关于这个问题。

FYI: I recommend putting latex (or something like that) in your subject line of the question -- I almost missed your question . . . and just happened to see the short summary and realized I knew something about this issue.

样品 - 为设在这里MultiTaskBuild插件: https://github.com/bizoo/MultiTaskBuild

SAMPLE -- for MultiTaskBuild plugin located here: https://github.com/bizoo/MultiTaskBuild

{
    "cmd": {

        "latexmk -pvc . . .": {
            "cmd": ["latexmk", "-r", "/Users/HOME/.latexmkrc", "$file"]
        },

        "latexmk -pv . . .": {
            "cmd": ["latexmk",
        "-e", "\\$pdflatex = 'pdflatex -enable-write18 %O -interaction=nonstopmode -synctex=1 %S'",
         "-recorder-", "-pvc-", "-f", "-pdf", "-pv", "$file"]
        },

        "latexmk -c": {
            "cmd": ["latexmk", "-c", "$file"]           
        },

        "latexmk -C": {
            "cmd": ["latexmk", "-C", "$file"]
        }
    },
"path": "$PATH:/usr/texbin:/usr/local/bin",
    "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
    "selector": "text.tex.latex",
    "default_task": "latexmk -pv . . .",
    "target": "multi_task_exec"
}

这篇关于运行shell脚本/ bash的在崇高的文本乳胶构建命令不带任何参数的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆