SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 365 forks source link

Arara Building #1123

Open AdsonBatista opened 7 years ago

AdsonBatista commented 7 years ago

Hello! Do you want to do a "Building arara"?

About arara: http://linorg.usp.br/CTAN/support/arara/doc/arara-usermanual.pdf

r-stein commented 7 years ago

What would you expect from arara support? I think you can just use the script builder to build with arara.

AdsonBatista commented 7 years ago

Yes it is possible to use the script builder to build on arara. I was reading about it. (I still can not make it work properly in the sublime.)

I had just thought of a build option in Ctrl + Shift + B.

I personally use arara only for latexindent.pl script and I see no other justifiable reasons.

r-stein commented 7 years ago

You can also create a build system, which will appear in the ctrl+shift+b menu. If you can run it from your command line it should work similiar with the script builder.

AdsonBatista commented 7 years ago

I'll try! If it works put the code here

ig0774 commented 7 years ago

Something like this should work (save it as LaTeX.sublime-build in your User folder):

{
    "target": "make_pdf",
    "selector": "text.tex.latex",

    "osx":
        {
            "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)"
        },

    "windows":
        {
            "file_regex": "^((?:.:)?[^:\n\r]*):([0-9]+):?([0-9]+)?:? (.*)$"
        },

    "linux":
        {
            "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)"
        },

     "variants":
        [
            {
                "name": "Arara",
                "script_commands": ["arara $file_base_name"] 
            }
        ]
}

This should give you a variant that is effectively the same as running arara <main_tex_file> from the command line.

Alternatively, in your project or general LaTeXTools.sublime-settings file, add something like this to the "builder_settings" block:

"osx": {
    "script_commands": ["arara $file_base_name"]
}

Substitute "windows" or "linux" in the above as appropriate.

I've considered adding built-in support for arara in the past, but since it's configured through directives and a YAML file, its a bit hard to ensure that it "just works" out of the box with LaTeXTools. In particular, there doesn't seem to be any way to ensure that specific command line flags are set (-interaction=nonstopmode being the really key one) or to override the job name or output directory, if they're set in arara (moreover, it would force us to somehow parse arara directives to figure out if these had been changed).