summaryrefslogtreecommitdiff
path: root/support/arara/scripts/rules/fig2dev.yaml
blob: fd36069205cc2ec56763816d91d4ade32b0f895f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
!config
# Arara, the cool TeX automation tool
# Copyright (c) 2020, Island of TeX
# All rights reserved.
#
# This rule is part of arara.
identifier: fig2dev
name: fig2dev
authors:
- Island of TeX
commands:
- name: The fig2dev program
  command: >
    @{
        input = getBasename(reference).concat('.fig');
        return getCommand('fig2dev', language, magnification, font, size,
                          options, input, output);
    }
arguments:
- identifier: language
  flag: >
    @{
        if ([ 'box', 'cgm', 'epic', 'eepic', 'eepicemu', 'emf', 'eps', 'gif',
              'ibmgl', 'jpeg', 'latex', 'map', 'mf', 'mp', 'mmp', 'pcx',
              'pdf', 'pdftex', 'pdftex_t', 'pic', 'pictex', 'png', 'ppm',
              'ps', 'pstex', 'pstex_t', 'ptk', 'shape', 'sld', 'svg',
              'textyl', 'tiff', 'tk', 'tpic', 'xbm',
              'xpm' ].contains(parameters.language)) {
            return [ '-L', parameters.language ];
        }
        else {
            throwError('Invalid language, please refer to the manual.');
        }
    }
  required: true
- identifier: output
  flag: >
    @{
        return parameters.output;
    }
  required: true
- identifier: magnification
  flag: >
    @{
        return [ '-m', parameters.magnification ];
    }
- identifier: font
  flag: >
    @{
        return [ '-f', parameters.font ];
    }
- identifier: size
  flag: >
    @{
        return [ '-s', parameters.size ];
    }
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        }
        else {
            throwError('I was expecting a list of options.')
        }
    }