diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-26 22:27:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-26 22:27:35 +0000 |
commit | 2456710acb7b4369eabd67ab4b31297ae142bb6a (patch) | |
tree | 66c53381f19ebc027fba14323ad9195555ee2858 /Master/texmf-dist/scripts/arara/rules | |
parent | 3465548e0c1d39b187bc8b5427001d0c9c5d1e4f (diff) |
arara (26feb21)
git-svn-id: svn://tug.org/texlive/trunk@57953 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/arara/rules')
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-animate.yaml (renamed from Master/texmf-dist/scripts/arara/rules/animate.yaml) | 1 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-asymptote.yaml (renamed from Master/texmf-dist/scripts/arara/rules/asymptote.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-authorindex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/authorindex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-bib2gls.yaml (renamed from Master/texmf-dist/scripts/arara/rules/bib2gls.yaml) | 6 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-biber.yaml (renamed from Master/texmf-dist/scripts/arara/rules/biber.yaml) | 9 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-bibtex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/bibtex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-bibtex8.yaml (renamed from Master/texmf-dist/scripts/arara/rules/bibtex8.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-bibtexu.yaml (renamed from Master/texmf-dist/scripts/arara/rules/bibtexu.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-clean.yaml (renamed from Master/texmf-dist/scripts/arara/rules/clean.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-context.yaml (renamed from Master/texmf-dist/scripts/arara/rules/context.yaml) | 3 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-convert.yaml (renamed from Master/texmf-dist/scripts/arara/rules/convert.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml | 36 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-csplain.yaml (renamed from Master/texmf-dist/scripts/arara/rules/csplain.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-datatooltk.yaml (renamed from Master/texmf-dist/scripts/arara/rules/datatooltk.yaml) | 7 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-detex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/detex.yaml) | 7 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-dvipdfm.yaml (renamed from Master/texmf-dist/scripts/arara/rules/dvipdfm.yaml) | 9 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-dvipdfmx.yaml (renamed from Master/texmf-dist/scripts/arara/rules/dvipdfmx.yaml) | 9 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-dvips.yaml (renamed from Master/texmf-dist/scripts/arara/rules/dvips.yaml) | 9 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-dvipspdf.yaml (renamed from Master/texmf-dist/scripts/arara/rules/dvipspdf.yaml) | 9 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-dvisvgm.yaml | 57 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-etex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/etex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-fig2dev.yaml (renamed from Master/texmf-dist/scripts/arara/rules/fig2dev.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-frontespizio.yaml (renamed from Master/texmf-dist/scripts/arara/rules/frontespizio.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-ghostscript.yaml | 44 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-gnuplot.yaml | 46 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-halt.yaml (renamed from Master/texmf-dist/scripts/arara/rules/halt.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-indent.yaml (renamed from Master/texmf-dist/scripts/arara/rules/indent.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-knitr.yaml (renamed from Master/texmf-dist/scripts/arara/rules/knitr.yaml) | 12 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-latex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/latex.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-latexmk.yaml (renamed from Master/texmf-dist/scripts/arara/rules/latexmk.yaml) | 12 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-llmk.yaml | 57 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-ltx2any.yaml | 110 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-luahbtex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/luahbtex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-lualatex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/lualatex.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-luatex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/luatex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-make.yaml (renamed from Master/texmf-dist/scripts/arara/rules/make.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-makeglossaries.yaml (renamed from Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml) | 4 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-makeglossarieslite.yaml (renamed from Master/texmf-dist/scripts/arara/rules/makeglossarieslite.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-makeindex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/makeindex.yaml) | 4 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-metapost.yaml (renamed from Master/texmf-dist/scripts/arara/rules/metapost.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml | 39 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-nomencl.yaml (renamed from Master/texmf-dist/scripts/arara/rules/nomencl.yaml) | 7 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pbibtex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/pbibtex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcrop.yaml | 132 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcsplain.yaml (renamed from Master/texmf-dist/scripts/arara/rules/pdfcsplain.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pdflatex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/pdflatex.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pdftex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/pdftex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pdftk.yaml (renamed from Master/texmf-dist/scripts/arara/rules/pdftk.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-perltex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/perltex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-platex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/platex.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-ps2pdf.yaml (renamed from Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml) | 9 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-ptex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/ptex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-pythontex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/pythontex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-qpdf.yaml (renamed from Master/texmf-dist/scripts/arara/rules/qpdf.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-sage.yaml | 59 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-sketch.yaml (renamed from Master/texmf-dist/scripts/arara/rules/sketch.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-songidx.yaml (renamed from Master/texmf-dist/scripts/arara/rules/songidx.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-spix.yaml (renamed from Master/texmf-dist/scripts/arara/rules/dvisvgm.yaml) | 16 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-tex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/tex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-texcount.yaml (renamed from Master/texmf-dist/scripts/arara/rules/texcount.yaml) | 1 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-texindy.yaml (renamed from Master/texmf-dist/scripts/arara/rules/texindy.yaml) | 6 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-tikzmake.yaml (renamed from Master/texmf-dist/scripts/arara/rules/tikzmake.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-upbibtex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/upbibtex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-uplatex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/uplatex.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-uptex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/uptex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-xdvipdfmx.yaml (renamed from Master/texmf-dist/scripts/arara/rules/xdvipdfmx.yaml) | 23 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-xelatex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/xelatex.yaml) | 2 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-xetex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/xetex.yaml) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-xindex.yaml (renamed from Master/texmf-dist/scripts/arara/rules/xindex.yaml) | 14 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-xindy.yaml (renamed from Master/texmf-dist/scripts/arara/rules/xindy.yaml) | 6 |
70 files changed, 671 insertions, 108 deletions
diff --git a/Master/texmf-dist/scripts/arara/rules/animate.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-animate.yaml index 769ceaecee1..4e7acc9bfb0 100644 --- a/Master/texmf-dist/scripts/arara/rules/animate.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-animate.yaml @@ -13,7 +13,6 @@ commands: - name: The Convert program command: > @{ - prefix = []; input = getBasename(reference.getName()).concat('.pdf'); output = getBasename(reference.getName()).concat('.gif'); return getCommand(program, '-delay', delay, '-loop', diff --git a/Master/texmf-dist/scripts/arara/rules/asymptote.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-asymptote.yaml index 232213f73d4..232213f73d4 100644 --- a/Master/texmf-dist/scripts/arara/rules/asymptote.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-asymptote.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/authorindex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-authorindex.yaml index a7e32141a97..a7e32141a97 100644 --- a/Master/texmf-dist/scripts/arara/rules/authorindex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-authorindex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/bib2gls.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-bib2gls.yaml index 513a7207f76..aaff9986ff1 100644 --- a/Master/texmf-dist/scripts/arara/rules/bib2gls.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-bib2gls.yaml @@ -12,7 +12,7 @@ commands: - name: The Bib2Gls software command: > @{ - if (isNotEmpty(clean)) + if (!clean.isEmpty()) { prefix = []; if (isUnix()) { @@ -31,9 +31,9 @@ commands: java.util.regex.Pattern.compile( "\\\\glsxtr@resource\\{.*\\}\\{([^\\}]+)\\}"); - if (isNotEmpty(trans)) + if (!trans.isEmpty()) { - if (trans == getOriginalFile()) + if (trans[0] == getOriginalFile()) { throwError('I cannot remove the main file reference.'); } diff --git a/Master/texmf-dist/scripts/arara/rules/biber.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-biber.yaml index 6399df64fbb..98c294a4998 100644 --- a/Master/texmf-dist/scripts/arara/rules/biber.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-biber.yaml @@ -12,7 +12,7 @@ commands: - name: The Biber reference management software command: > @{ - if (tool) { + if (isTrue(tool[0])) { return getCommand('biber', '--tool', options); } else { @@ -24,12 +24,9 @@ arguments: - identifier: tool flag: > @{ - return isTrue(parameters.tool); - } - default: > - @{ - return false; + return parameters.tool; } + default: false - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/bibtex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-bibtex.yaml index a8457584406..a8457584406 100644 --- a/Master/texmf-dist/scripts/arara/rules/bibtex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-bibtex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/bibtex8.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-bibtex8.yaml index 2526c82b5a4..2526c82b5a4 100644 --- a/Master/texmf-dist/scripts/arara/rules/bibtex8.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-bibtex8.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/bibtexu.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-bibtexu.yaml index 708a3ebfb6d..708a3ebfb6d 100644 --- a/Master/texmf-dist/scripts/arara/rules/bibtexu.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-bibtexu.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/clean.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-clean.yaml index aa07560cb90..aa07560cb90 100644 --- a/Master/texmf-dist/scripts/arara/rules/clean.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-clean.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/context.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-context.yaml index bf5b1c5b041..49dc9e5f609 100644 --- a/Master/texmf-dist/scripts/arara/rules/context.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-context.yaml @@ -47,7 +47,7 @@ arguments: return p.get(parameters.purge); } else { - throwError('Invalid value, expected either partial or all.'); + throwError('Invalid value, expected partial, result or all.'); } } - identifier: modules @@ -168,4 +168,3 @@ arguments: throwError('I was expecting a list of options.'); } } - diff --git a/Master/texmf-dist/scripts/arara/rules/convert.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-convert.yaml index 7a2140d0a77..7a2140d0a77 100644 --- a/Master/texmf-dist/scripts/arara/rules/convert.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-convert.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml new file mode 100644 index 00000000000..b43ef1e28ac --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml @@ -0,0 +1,36 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: copy +name: Copy +authors: +- Island of TeX +commands: +- name: The OS copy call + command: > + @{ + prefix = []; + if (isUnix()) { + prefix = [ 'cp', '-f' ]; + } + else { + prefix = [ 'cmd', '/c', 'copy', '/Y' ]; + } + t = isList(target) ? target[0] : target; + f = toFile(t).getCanonicalFile(); + if (getOriginalReference().equals(f)) { + throwError('I cannot overwrite the main file reference.'); + } + return getCommand(prefix, reference, t); + } +arguments: +- identifier: target + flag: > + @{ + return parameters.target; + } + required: true + diff --git a/Master/texmf-dist/scripts/arara/rules/csplain.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-csplain.yaml index 720cd0cc8fe..720cd0cc8fe 100644 --- a/Master/texmf-dist/scripts/arara/rules/csplain.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-csplain.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/datatooltk.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-datatooltk.yaml index 13526dbc130..16c84dc439d 100644 --- a/Master/texmf-dist/scripts/arara/rules/datatooltk.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-datatooltk.yaml @@ -73,12 +73,9 @@ arguments: - identifier: noconsole flag: > @{ - [ '--noconsole-action', parameters.noconsole ] - } - default: > - @{ - [ '--noconsole-action', 'gui'] + [ '--noconsole-action', isEmpty(parameters.noconsole, 'gui', parameters.noconsole) ] } + default: '' - identifier: probsoln flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/detex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-detex.yaml index f94c7a274e8..94fa359f833 100644 --- a/Master/texmf-dist/scripts/arara/rules/detex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-detex.yaml @@ -1,6 +1,6 @@ !config # Arara, the cool TeX automation tool -# Copyright (c) 2020, Island of TeX +# Copyright (c) 2020, Island of TeX # All rights reserved. # # This rule is part of arara. @@ -14,13 +14,13 @@ commands: @{ c = getCommand('detex', references, mode, follow, math, spaces, words, environments, reference.getName()); - if (isEmpty(output)) { + if (output.isEmpty()) { return c; } else { p = unsafelyExecuteSystemCommand(c); if (p.first == 0) { - return writeToFile(toFile(output), p.second, false); + return writeToFile(toFile(output[0]), p.second, false); } else { return false; @@ -79,4 +79,3 @@ arguments: @{ return parameters.output; } - diff --git a/Master/texmf-dist/scripts/arara/rules/dvipdfm.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvipdfm.yaml index c4f44309b86..0f603a1a263 100644 --- a/Master/texmf-dist/scripts/arara/rules/dvipdfm.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvipdfm.yaml @@ -13,19 +13,16 @@ commands: command: > @{ base = getBasename(reference.getName()).concat('.dvi'); - out = getBasename(output).concat('.pdf'); + out = getBasename(output[0]).concat('.pdf'); return getCommand('dvipdfm', base, '-o', out, options); } arguments: - identifier: output flag: > @{ - parameters.output - } - default: > - @{ - reference.getName() + isEmpty(parameters.output, reference.getName(), parameters.output) } + default: '' - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/dvipdfmx.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvipdfmx.yaml index b9b73319e3f..b4d8e19afa5 100644 --- a/Master/texmf-dist/scripts/arara/rules/dvipdfmx.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvipdfmx.yaml @@ -13,19 +13,16 @@ commands: command: > @{ base = getBasename(reference.getName()).concat('.dvi'); - out = getBasename(output).concat('.pdf'); + out = getBasename(output[0]).concat('.pdf'); return getCommand('dvipdfmx', base, '-o', out, options); } arguments: - identifier: output flag: > @{ - parameters.output - } - default: > - @{ - reference.getName() + isEmpty(parameters.output, reference.getName(), parameters.output) } + default: '' - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/dvips.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvips.yaml index 78a2cff58dd..4cde26fa991 100644 --- a/Master/texmf-dist/scripts/arara/rules/dvips.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvips.yaml @@ -13,19 +13,16 @@ commands: command: > @{ base = getBasename(reference.getName()).concat('.dvi'); - out = getBasename(output).concat('.ps'); + out = getBasename(output[0]).concat('.ps'); return getCommand('dvips', base, '-o', out, options); } arguments: - identifier: output flag: > @{ - parameters.output - } - default: > - @{ - reference.getName() + isEmpty(parameters.output, reference.getName(), parameters.output) } + default: '' - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/dvipspdf.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvipspdf.yaml index 68c12dde345..d7e331873c4 100644 --- a/Master/texmf-dist/scripts/arara/rules/dvipspdf.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvipspdf.yaml @@ -20,19 +20,16 @@ commands: command: > @{ base = getBasename(reference.getName()).concat('.ps'); - out = getBasename(output).concat('.pdf'); + out = getBasename(output[0]).concat('.pdf'); return getCommand('ps2pdf', options2, base, '-o', out); } arguments: - identifier: output flag: > @{ - parameters.output - } - default: > - @{ - reference.getName() + isEmpty(parameters.output, reference.getName(), parameters.output) } + default: '' - identifier: options1 flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-dvisvgm.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvisvgm.yaml new file mode 100644 index 00000000000..92c7b4ea683 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-dvisvgm.yaml @@ -0,0 +1,57 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: dvisvgm +name: DVISVGM +authors: +- samcarter +- Pablo González +commands: +- name: The dvisvgm program + command: > + @{ + base = getBasename(reference.getName()). + concat('.').concat(entry[0]); + return getCommand('dvisvgm', getOrNull(entry, 1), pages, + options, base); + } +arguments: +- identifier: pages + flag: > + @{ + if (isList(parameters.pages)) { + q = []; + foreach (p : parameters.pages) q.add(p.toString()); + return [ '--page='.concat(String.join(',', q)) ]; + } + else { + throwError('I was expecting a list of pages.'); + } + } +- identifier: entry + flag: > + @{ + formats = [ 'dvi' : [ 'dvi' ], 'xdv' : [ 'xdv' ], + 'pdf' : [ 'pdf', '--pdf' ], + 'eps' : [ 'eps', '--eps' ] ]; + if (formats.keySet().contains(parameters.entry)) { + return formats.get(parameters.entry); + } + else { + throwError('The valid formats are: ' + formats.keySet()); + } + } + default: dvi +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/etex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-etex.yaml index e039b143dad..e039b143dad 100644 --- a/Master/texmf-dist/scripts/arara/rules/etex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-etex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/fig2dev.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-fig2dev.yaml index 4e796e5c4d6..4e796e5c4d6 100644 --- a/Master/texmf-dist/scripts/arara/rules/fig2dev.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-fig2dev.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/frontespizio.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-frontespizio.yaml index 2cabec38a0d..2cabec38a0d 100644 --- a/Master/texmf-dist/scripts/arara/rules/frontespizio.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-frontespizio.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-ghostscript.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-ghostscript.yaml new file mode 100644 index 00000000000..7d3f26c6be7 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-ghostscript.yaml @@ -0,0 +1,44 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: ghostscript +name: GhostScript +authors: +- Island of TeX +commands: +- name: The command line tool + command: > + @{ + return getCommand(program, device, output, options); + } +arguments: +- identifier: program + flag: > + @{ + return parameters.program; + } + default: 'gs' +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } + required: true +- identifier: device + flag: > + @{ + return '-sDEVICE='.concat(parameters.device); + } +- identifier: output + flag: > + @{ + return '-sOutputFile='.concat(parameters.output); + } diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-gnuplot.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-gnuplot.yaml new file mode 100644 index 00000000000..e670099535e --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-gnuplot.yaml @@ -0,0 +1,46 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: gnuplot +name: The Gnuplot program +authors: +- Island of TeX +commands: +- name: Gnuplot + command: > + @{ + c = []; + foreach (entry : input) { + c.add(getCommand('gnuplot', persist, default, commands, entry)); + } + return c; + } +arguments: +- identifier: persist + flag: > + @{ + return isTrue(parameters.persist, '--persist'); + } +- identifier: default + flag: > + @{ + return isTrue(parameters.default, '--default'); + } +- identifier: commands + flag: > + @{ + return [ '-e', parameters.commands ]; + } +- identifier: input + flag: > + @{ + if (isList(parameters.input)) { + return parameters.input; + } else { + throwError('I was expecting a list of input files.'); + } + } + required: true diff --git a/Master/texmf-dist/scripts/arara/rules/halt.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-halt.yaml index 3ac9106e909..3ac9106e909 100644 --- a/Master/texmf-dist/scripts/arara/rules/halt.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-halt.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/indent.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-indent.yaml index b6dce8b2d53..b6dce8b2d53 100644 --- a/Master/texmf-dist/scripts/arara/rules/indent.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-indent.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/knitr.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-knitr.yaml index a2e5fcd7bf5..2385589615a 100644 --- a/Master/texmf-dist/scripts/arara/rules/knitr.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-knitr.yaml @@ -14,14 +14,14 @@ commands: command: > @{ elements = []; - if (!isEmpty(tangle)) elements.add('tangle = ' + tangle); - if (!isEmpty(quiet)) elements.add('quiet = ' + quiet); - elements.add('envir = ' + envir); - elements.add('encoding = ' + encoding); + if (!tangle.isEmpty()) elements.add('tangle = ' + tangle[0]); + if (!quiet.isEmpty()) elements.add('quiet = ' + quiet[0]); + out = output.isEmpty() ? 'NULL' : '"' + output[0] + '"'; + elements.add('envir = ' + envir[0]); + elements.add('encoding = ' + encoding[0]); return getCommand('Rscript', '-e', 'library(knitr); knit("' + reference.getName() + '", ' + - 'output = ' + isEmpty(output, 'NULL', '"' + output + '"') + ', ' + - String.join(', ', elements) + ')'); + 'output = ' + out + ', ' + String.join(', ', elements) + ')'); } arguments: - identifier: output diff --git a/Master/texmf-dist/scripts/arara/rules/latex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-latex.yaml index fc96395c233..519e609a278 100644 --- a/Master/texmf-dist/scripts/arara/rules/latex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-latex.yaml @@ -26,7 +26,7 @@ arguments: throwError('The valid branch values are: ' + engines.keySet()); } } - default: 'latex' + default: 'stable' - identifier: interaction flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/latexmk.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-latexmk.yaml index 455f942fdb1..2b02e622b62 100644 --- a/Master/texmf-dist/scripts/arara/rules/latexmk.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-latexmk.yaml @@ -12,12 +12,12 @@ commands: - name: Tool LaTeXmk command: > @{ - if (isNotEmpty(clean)) { + if (!clean.isEmpty()) { return getCommand('latexmk', clean, options); } else { - return getCommand('latexmk', isEmpty(program, engine, - program), options, reference.getName()); + return getCommand('latexmk', isTrue(program.isEmpty(), + engine, program), options, reference.getName()); } } arguments: @@ -47,7 +47,11 @@ arguments: if ([ 'latex', 'pdflatex', 'xelatex', 'lualatex' ].contains(parameters.engine)) { flags = [ 'latex' : '-dvi', 'pdflatex' : '-pdf', - 'xelatex' : '-xelatex', 'lualatex' : '-lualatex' ]; + 'xelatex' : '-xelatex', 'lualatex' : '-lualatex', + 'latex-dev' : [ '-dvi', '-e', "$latex='latex-dev'" ], + 'pdflatex-dev' : [ '-pdf', '-e', "$pdflatex='pdflatex-dev'" ], + 'xelatex-dev' : [ '-xelatex', '-e', "$xelatex='xelatex-dev'" ], + 'lualatex-dev' : [ '-lualatex', '-e', "$lualatex='lualatex-dev'" ] ]; return flags[parameters.engine]; } else { diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-llmk.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-llmk.yaml new file mode 100644 index 00000000000..1a6864225ae --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-llmk.yaml @@ -0,0 +1,57 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: llmk +name: LLMK +authors: +- Island of TeX +commands: +- name: The automation tool + command: > + @{ + return getCommand('llmk', clean, debug, dry, + mode, reference.getName()); + } +arguments: +- identifier: clean + flag: > + @{ + goals = [ 'partial' : '--clean', 'all' : '--clobber' ]; + if (goals.keySet().contains(parameters.clean)) { + return goals.get(parameters.clean); + } + else { + throwError('The provided value is invalid.'); + } + } +- identifier: debug + flag: > + @{ + if (parameters.debug.equals('all')) { + return '-D'; + } + else { + return [ '-d', parameters.debug ]; + } + } +- identifier: dry + flag: > + @{ + return isTrue(parameters.dry, '--dry-run'); + } +- identifier: mode + flag: > + @{ + modes = [ 'quiet' : '-q', 'silent' : '-s', + 'verbose' : '-v' ]; + if (modes.keySet().contains(parameters.mode)) { + return modes.get(parameters.mode); + } + else { + throwError('Invalid mode name.'); + } + } + diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-ltx2any.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-ltx2any.yaml new file mode 100644 index 00000000000..e60ff8902d4 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-ltx2any.yaml @@ -0,0 +1,110 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: ltx2any +name: LTX2any +authors: +- Island of TeX +commands: +- name: The automation tool + command: > + @{ + return getCommand('ltx2any', clean, engine, parameters, + tikzimages, jobname, logname, logformat, + loglevel, frequency, directory, synctex, + options, reference.getName()); + } +arguments: +- identifier: clean + flag: > + @{ + return isTrue(parameters.clean, '-c'); + } +- identifier: engine + flag: > + @{ + return [ '-e', parameters.engine ]; + } +- identifier: parameters + flag: > + @{ + if (isList(parameters.parameters)) { + return [ '-ep', String.join(' ', + parameters.parameters) ]; + } + else { + throwError('I was execting a list of parameters.'); + } + } +- identifier: tikzimages + flag: > + @{ + if (isList(parameters.tikzimages)) { + return [ '-ir', String.join(':', + parameters.tikzimages) ]; + } + else { + throwError('I was expecting a list of images.'); + } + } +- identifier: jobname + flag: > + @{ + return [ '-j', parameters.jobname ]; + } +- identifier: logname + flag: > + @{ + return [ '-l', parameters.logname ]; + } +- identifier: logformat + flag: > + @{ + fts = [ 'raw' : 'raw', 'markdown' : 'md', + 'pdf' : 'pdf' ]; + if (fts.keySet().contains(parameters.logformat)) { + return [ '-lf', fts.get(parameters.logformat) ]; + } + else { + throw('Invalid log format.'); + } + } +- identifier: loglevel + flag: > + @{ + ll = [ 'error', 'warning', 'info' ]; + if (ll.contains(parameters.loglevel)) { + return [ '-ll', parameters.loglevel ]; + } + else { + throwError('Invalid log level.'); + } + } +- identifier: frequency + flag: > + @{ + return [ '-n', parameters.frequency ]; + } +- identifier: directory + flag: > + @{ + return [ '-t', parameters.directory ]; + } +- identifier: synctex + flag: > + @{ + return isTrue(parameters.synctex, '-synctex'); + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/luahbtex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-luahbtex.yaml index cf4fde56e4e..cf4fde56e4e 100644 --- a/Master/texmf-dist/scripts/arara/rules/luahbtex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-luahbtex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/lualatex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-lualatex.yaml index de68a48b8ff..4eed7972c67 100644 --- a/Master/texmf-dist/scripts/arara/rules/lualatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-lualatex.yaml @@ -26,7 +26,7 @@ arguments: throwError('The valid branch values are: ' + engines.keySet()); } } - default: 'lualatex' + default: 'stable' - identifier: interaction flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/luatex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-luatex.yaml index 03a726fa643..03a726fa643 100644 --- a/Master/texmf-dist/scripts/arara/rules/luatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-luatex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/make.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-make.yaml index afc83a6e9ca..26f2183c70a 100644 --- a/Master/texmf-dist/scripts/arara/rules/make.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-make.yaml @@ -12,7 +12,7 @@ commands: - name: The Make program command: > @{ - if (isNotEmpty(targets)) { + if (!targets.isEmpty()) { tasks = []; for (target : targets) { tasks.add(getCommand('make', target, options)); diff --git a/Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-makeglossaries.yaml index 7cb47cc5df8..fe39fa534a7 100644 --- a/Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-makeglossaries.yaml @@ -12,7 +12,7 @@ commands: - name: The MakeGlossaries software command: > @{ - if (isEmpty(clean)) + if (clean.isEmpty()) { return getCommand('makeglossaries', options, getBasename(reference.getName())); @@ -38,7 +38,7 @@ commands: "\\\\@newglossary\\{.*\\}\\{(.*)\\}\\{(.*)\\}\\{(.*)\\}"); java.util.regex.Pattern istPattern = - (clean == 'partial' ? null : + (clean[0] == 'partial' ? null : java.util.regex.Pattern.compile("\\\\@istfilename\\{(.*)\\}")); foreach (line: lines) diff --git a/Master/texmf-dist/scripts/arara/rules/makeglossarieslite.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-makeglossarieslite.yaml index c384179f44f..c384179f44f 100644 --- a/Master/texmf-dist/scripts/arara/rules/makeglossarieslite.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-makeglossarieslite.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/makeindex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-makeindex.yaml index 25b9e44c902..c0bf7a36c84 100644 --- a/Master/texmf-dist/scripts/arara/rules/makeindex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-makeindex.yaml @@ -14,8 +14,8 @@ commands: @{ base = getBasename(reference.getName()); infile = base.concat('.').concat(input); - outfile = [ '-o', base.concat('.').concat(output) ]; - logfile = [ '-t', base.concat('.').concat(log) ]; + outfile = [ '-o', base.concat('.').concat(output[0]) ]; + logfile = [ '-t', base.concat('.').concat(log[0]) ]; return getCommand('makeindex', german, style, order, options, logfile, infile, outfile); } diff --git a/Master/texmf-dist/scripts/arara/rules/metapost.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-metapost.yaml index e334210ce5e..e334210ce5e 100644 --- a/Master/texmf-dist/scripts/arara/rules/metapost.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-metapost.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml new file mode 100644 index 00000000000..d11365ada0b --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml @@ -0,0 +1,39 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: move +name: Move +authors: +- Island of TeX +commands: +- name: The OS move call + command: > + @{ + prefix = []; + if (isUnix()) { + prefix = [ 'mv', '-f' ]; + } + else { + prefix = [ 'cmd', '/c', 'move', '/Y' ]; + } + if (getOriginalReference() == reference) { + throwError('I cannot move the main file reference.'); + } + t = isList(target) ? target[0] : target; + f = toFile(t).getCanonicalFile(); + if (getOriginalReference().equals(f)) { + throwError('I cannot overwrite the main file reference.'); + } + return getCommand(prefix, reference, t); + } +arguments: +- identifier: target + flag: > + @{ + return parameters.target; + } + required: true + diff --git a/Master/texmf-dist/scripts/arara/rules/nomencl.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-nomencl.yaml index 4672cb4ea98..8d66acdb303 100644 --- a/Master/texmf-dist/scripts/arara/rules/nomencl.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-nomencl.yaml @@ -20,12 +20,9 @@ arguments: - identifier: style flag: > @{ - [ '-s', parameters.style ] - } - default: > - @{ - [ '-s', 'nomencl.ist' ] + [ '-s', isEmpty(parameters.style, 'nomencl.ist', parameters.style) ] } + default: '' - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/pbibtex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pbibtex.yaml index a313b7fe922..a313b7fe922 100644 --- a/Master/texmf-dist/scripts/arara/rules/pbibtex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pbibtex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcrop.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcrop.yaml new file mode 100644 index 00000000000..8ad93fd513b --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcrop.yaml @@ -0,0 +1,132 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: pdfcrop +name: PDFCrop +authors: +- Island of TeX +commands: +- name: The cropping tool + command: > + @{ + base = getBasename(reference.getName()); + input = base.concat('.pdf'); + return getCommand('pdfcrop', verbose, debug, engine, + margins, clip, hires, ini, restricted, papersize, + resolution, bbox, uncompress, options, input, output); + } +arguments: +- identifier: output + flag: > + @{ + return isEmpty(parameters.output, + getBasename(reference.getName()). + concat('-crop.pdf'), + parameters.output); + } + default: '' +- identifier: verbose + flag: > + @{ + return isTrue(parameters.verbose, '--verbose', '--noverbose'); + } +- identifier: debug + flag: > + @{ + return isTrue(parameters.debug, '--debug', '--nodebug'); + } +- identifier: engine + flag: > + @{ + engines = [ 'pdftex', 'xetex', 'luatex' ]; + if (engines.contains(parameters.engine)) { + return '--'.concat(parameters.engine); + } + else { + throwError('The provided engine is invalid.'); + } + } +- identifier: margins + flag: > + @{ + if (isList(parameters.margins)) { + if (parameters.margins.size() != 4) { + throwError('Margins require 4 elements.'); + } + else { + ms = []; + foreach (m : parameters.margins) + ms.add(m.toString()); + return [ '--margins', String.join(' ', ms) ]; + } + } + else { + throwError('I was expecting a list.'); + } + } +- identifier: clip + flag: > + @{ + return isTrue(parameters.clip, '--clip', '--noclip'); + } +- identifier: hires + flag: > + @{ + return isTrue(parameters.hires, '--hires', '--nohires'); + } +- identifier: ini + flag: > + @{ + return isTrue(parameters.ini, '--ini', '--noini'); + } +- identifier: restricted + flag: > + @{ + return isTrue(parameters.restricted, '--restricted'); + } +- identifier: papersize + flag: > + @{ + return [ '--papersize', parameters.papersize ]; + } +- identifier: resolution + flag: > + @{ + return [ '--resolution', parameters.resolution ]; + } +- identifier: bbox + flag: > + @{ + if (isList(parameters.bbox)) { + if (parameters.bbox.size() != 4) { + throwError('Bounding box require 4 elements.'); + } + else { + ms = []; + foreach (m : parameters.bbox) + ms.add(m.toString()); + return [ '--margins', String.join(' ', ms) ]; + } + } + else { + throwError('I was expecting a list.'); + } + } +- identifier: uncompress + flag: > + @{ + return isTrue(parameters.uncompress, '--uncompress'); + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/pdfcsplain.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcsplain.yaml index 079440628a3..079440628a3 100644 --- a/Master/texmf-dist/scripts/arara/rules/pdfcsplain.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdfcsplain.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/pdflatex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdflatex.yaml index c1ee2f90773..2056885281d 100644 --- a/Master/texmf-dist/scripts/arara/rules/pdflatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdflatex.yaml @@ -26,7 +26,7 @@ arguments: throwError('The valid branch values are: ' + engines.keySet()); } } - default: 'pdflatex' + default: 'stable' - identifier: interaction flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/pdftex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdftex.yaml index c6699b7dca4..c6699b7dca4 100644 --- a/Master/texmf-dist/scripts/arara/rules/pdftex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdftex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/pdftk.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdftk.yaml index a457d67d531..a457d67d531 100644 --- a/Master/texmf-dist/scripts/arara/rules/pdftk.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pdftk.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/perltex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-perltex.yaml index 09a838153d6..09a838153d6 100644 --- a/Master/texmf-dist/scripts/arara/rules/perltex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-perltex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/platex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-platex.yaml index edf5d4864ba..41fca5d771c 100644 --- a/Master/texmf-dist/scripts/arara/rules/platex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-platex.yaml @@ -26,7 +26,7 @@ arguments: throwError('The valid branch values are: ' + engines.keySet()); } } - default: 'platex' + default: 'stable' - identifier: interaction flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-ps2pdf.yaml index dcc49f87b9d..3469a57d390 100644 --- a/Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-ps2pdf.yaml @@ -13,19 +13,16 @@ commands: command: > @{ infile = getBasename(reference.getName()).concat('.ps'); - outfile = getBasename(output).concat('.pdf'); + outfile = getBasename(output[0]).concat('.pdf'); return getCommand('ps2pdf', options, infile, outfile); } arguments: - identifier: output flag: > @{ - parameters.output - } - default: > - @{ - reference.getName() + isEmpty(parameters.output, reference.getName(), parameters.output) } + default: '' - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/ptex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-ptex.yaml index 9367704cb9e..9367704cb9e 100644 --- a/Master/texmf-dist/scripts/arara/rules/ptex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-ptex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/pythontex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-pythontex.yaml index 671d4abe34a..671d4abe34a 100644 --- a/Master/texmf-dist/scripts/arara/rules/pythontex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-pythontex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/qpdf.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-qpdf.yaml index c2cb852a7d9..c2cb852a7d9 100644 --- a/Master/texmf-dist/scripts/arara/rules/qpdf.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-qpdf.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-sage.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-sage.yaml new file mode 100644 index 00000000000..15e89a6a4ef --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-sage.yaml @@ -0,0 +1,59 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: sage +name: Sage +authors: +- Island of TeX +commands: +- name: The command line tool + command: > + @{ + base = getBasename(reference.getName()); + e = isList(extension) ? extension[0] : extension; + input = base.concat('.').concat(e); + return getCommand(program, command, dotsage, + options, input); + } +arguments: +- identifier: program + flag: > + @{ + return parameters.program; + } + default: 'sage' +- identifier: extension + flag: > + @{ + exts = [ 'sage', 'py', 'spyx' ]; + if (exts.contains(parameters.extension)) { + return parameters.extension; + } + else { + throwError('The provided extension is invalid.'); + } + } + default: 'sage' +- identifier: command + flag: > + @{ + return [ '-c', parameters.command ]; + } +- identifier: dotsage + flag: > + @{ + return isFalse(parameters.dotsage, '--nodotsage'); + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/sketch.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-sketch.yaml index e7bae9b329b..e7bae9b329b 100644 --- a/Master/texmf-dist/scripts/arara/rules/sketch.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-sketch.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/songidx.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-songidx.yaml index a1cadae4310..7d5fa870deb 100644 --- a/Master/texmf-dist/scripts/arara/rules/songidx.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-songidx.yaml @@ -13,7 +13,7 @@ commands: - name: The SongIDX Lua script command: > @{ - infile = getBasename(input).concat('.sxd'); + infile = getBasename(input[0]).concat('.sxd'); return getCommand('texlua', script, options, infile); } arguments: diff --git a/Master/texmf-dist/scripts/arara/rules/dvisvgm.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-spix.yaml index d0bae984de0..f19345cec2e 100644 --- a/Master/texmf-dist/scripts/arara/rules/dvisvgm.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-spix.yaml @@ -4,18 +4,22 @@ # All rights reserved. # # This rule is part of arara. -identifier: dvisvgm -name: DVISVGM +identifier: spix +name: SpiX authors: -- samcarter +- Island of TeX commands: -- name: The dvisvgm program +- name: The automation tool command: > @{ - base = getBasename(reference.getName()).concat('.dvi'); - return getCommand('dvisvgm', base, options); + return getCommand('spix', dry, options, reference.getName()); } arguments: +- identifier: dry + flag: > + @{ + return isTrue(parameters.dry, '--dry-run'); + } - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/tex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-tex.yaml index d036e5cb0dc..d036e5cb0dc 100644 --- a/Master/texmf-dist/scripts/arara/rules/tex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-tex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/texcount.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-texcount.yaml index 694ac6d481b..85e26c42c6e 100644 --- a/Master/texmf-dist/scripts/arara/rules/texcount.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-texcount.yaml @@ -72,4 +72,3 @@ arguments: throwError('I was expecting a list of options.'); } } - diff --git a/Master/texmf-dist/scripts/arara/rules/texindy.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-texindy.yaml index 45c4637889c..6e27dfd90e8 100644 --- a/Master/texmf-dist/scripts/arara/rules/texindy.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-texindy.yaml @@ -13,9 +13,9 @@ commands: command: > @{ base = getBasename(reference.getName()); - infile = base.concat('.').concat(input); - outfile = [ '-o', base.concat('.').concat(output) ]; - logfile = [ '-t', base.concat('.').concat(log) ]; + infile = base.concat('.').concat(input[0]); + outfile = [ '-o', base.concat('.').concat(output[0]) ]; + logfile = [ '-t', base.concat('.').concat(log[0]) ]; return getCommand('texindy', quiet, markup, modules, codepage, language, logfile, outfile, options, infile); } diff --git a/Master/texmf-dist/scripts/arara/rules/tikzmake.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-tikzmake.yaml index 69e72c48852..69e72c48852 100644 --- a/Master/texmf-dist/scripts/arara/rules/tikzmake.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-tikzmake.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/upbibtex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-upbibtex.yaml index bb32250c6c6..bb32250c6c6 100644 --- a/Master/texmf-dist/scripts/arara/rules/upbibtex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-upbibtex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/uplatex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-uplatex.yaml index c2690d11052..18e2edb28e5 100644 --- a/Master/texmf-dist/scripts/arara/rules/uplatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-uplatex.yaml @@ -26,7 +26,7 @@ arguments: throwError('The valid branch values are: ' + engines.keySet()); } } - default: 'uplatex' + default: 'stable' - identifier: interaction flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/uptex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-uptex.yaml index fb7a2282fdb..fb7a2282fdb 100644 --- a/Master/texmf-dist/scripts/arara/rules/uptex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-uptex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/xdvipdfmx.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-xdvipdfmx.yaml index 6c569ef31c5..12c88da3298 100644 --- a/Master/texmf-dist/scripts/arara/rules/xdvipdfmx.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-xdvipdfmx.yaml @@ -12,20 +12,29 @@ commands: - name: The XDVIPDFMX program command: > @{ - infile = getBasename(reference.getName()).concat('.dvi'); - outfile = getBasename(output).concat('.pdf'); + infile = getBasename(reference.getName()). + concat('.').concat(entry[0]); + outfile = getBasename(output[0]).concat('.pdf'); return getCommand('xdvipdfmx', infile, '-o', outfile, options); } arguments: -- identifier: output +- identifier: entry flag: > @{ - parameters.output + if ([ 'dvi', 'xdv' ].contains(parameters.entry)) { + return parameters.entry; + } + else { + throwError('I was expecting either DVI or XDV.'); + } } - default: > + default: dvi +- identifier: output + flag: > @{ - reference.getName() + isEmpty(parameters.output, reference.getName(), parameters.output) } + default: '' - identifier: options flag: > @{ @@ -33,6 +42,6 @@ arguments: return parameters.options; } else { - throwError('I was expecting a list of options.') + throwError('I was expecting a list of options.'); } } diff --git a/Master/texmf-dist/scripts/arara/rules/xelatex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-xelatex.yaml index 021f4cea6fd..f05da86dada 100644 --- a/Master/texmf-dist/scripts/arara/rules/xelatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-xelatex.yaml @@ -26,7 +26,7 @@ arguments: throwError('The valid branch values are: ' + engines.keySet()); } } - default: 'xelatex' + default: 'stable' - identifier: interaction flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/xetex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-xetex.yaml index 687b08f200e..687b08f200e 100644 --- a/Master/texmf-dist/scripts/arara/rules/xetex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-xetex.yaml diff --git a/Master/texmf-dist/scripts/arara/rules/xindex.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-xindex.yaml index 8ec73cf0688..26ade80d238 100644 --- a/Master/texmf-dist/scripts/arara/rules/xindex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-xindex.yaml @@ -23,21 +23,15 @@ arguments: - identifier: config flag: > @{ - return [ '-c', parameters.config ]; - } - default: > - @{ - return [ '-c', 'cfg' ]; + return [ '-c', isEmpty(parameters.config, 'cfg', parameters.config) ]; } + default: '' - identifier: language flag: > @{ - return [ '-l', parameters.language ]; - } - default: > - @{ - return [ '-l', 'en' ]; + return [ '-l', isEmpty(parameters.language, 'en', parameters.language) ]; } + default: '' - identifier: options flag: > @{ diff --git a/Master/texmf-dist/scripts/arara/rules/xindy.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-xindy.yaml index 161ae60158f..a55576c1f51 100644 --- a/Master/texmf-dist/scripts/arara/rules/xindy.yaml +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-xindy.yaml @@ -13,9 +13,9 @@ commands: command: > @{ base = getBasename(reference.getName()); - infile = base.concat('.').concat(input); - outfile = [ '-o', base.concat('.').concat(output) ]; - logfile = [ '-t', base.concat('.').concat(log) ]; + infile = base.concat('.').concat(input[0]); + outfile = [ '-o', base.concat('.').concat(output[0]) ]; + logfile = [ '-t', base.concat('.').concat(log[0]) ]; return getCommand('xindy', quiet, markup, modules, codepage, language, logfile, outfile, options, infile); } |