action.command
— Explicitly set the command to compile a file¶
Using this action plugin, one can explicitely set the command used to compile a file.
Note
Althought one can configure this plugin in the setup file or in the configuration file of a directory, so that it applies to every single file of this repository or directory, you should probably use action.autocommand — Compile file according to mime type or extension for this purpose.
Example¶
Let’s say file foo.tex
has the following configuration file foo.tex.evsconfig
.
[action]
plugin = command
[action.command]
targets = {basename}.pdf
command =
latex {basename}
dvipdf {basename}.dvi {basename}.pdf
The plugin
option in the [action]
section means that this plugin is to be used to compile this file. Then, in the [action.command]
section:
the
targets
option gives the name(s) of the compiled file(s);the
command
option defines the shell command to use to compile this file.
Note that strings are formatted.
Options¶
Here are the options of this plugin:
command
(""
): Command to run.strace
("false"
): If true, the command is run using strace to automatically find the dependencies of this file (the other files of this repository that are used to compile this file). Note that the compilation is slower, and this option is experimental.targets
(""
): Space-separated list of names of the compiled files. See Targets.depends
(""
): Space-separated list of names of the files that are used to compile this file. See Depends.
Example with action.autocommand¶
Imagine every single file of your repository is to be compiled with pdflatex
, excepted for that file foo.tex
that is to be compiled with latex+dvipdf
.
What you would do is:
In the setup file (or the configuration file of the root directory), use action.autocommand to specify that every LaTeX file should be compiled using
pdflatex
:[action.autocommand.latex] extensions = tex targets = {basename}.pdf command = pdflatex {basename}
In the configuration file of
foo.tex
(that is:foo.tex.evsconfig
), explicitely set the command to compile this file:[action] plugin = command [action.command] command = latex {basename} dvipdf {basename}
Since the configuration file for foo.tex
has precedence over the other configuration files, or the setup file itself, this will do the trick.