2

I need my build system run makeglossaries with "main" as the ONLY argument, but sublime always appends the current filename as final parameter. How can I prevent this?

The execution command looks like this (under command line):

$: makeglossaries main

My current .sublime-build file looks like this:

{
    // General settings; DO NOT MODIFY!!!
    "target": "make_pdf",
    "selector": "text.tex.latex",

    // Windows-specific settings
    // -------------------------
    "windows":
        {

            "cmd": ["texify", 
                    "-b", "-p",
                    "--tex-option=\"--synctex=1\""
            ],

            "cmd": ["makeglossaries",
                    "main"
            ],

            "cmd": ["texify", 
                    "-b", "-p",
                    "--tex-option=\"--synctex=1\""
            ],          

            "path": "",

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

}

If you ask why I want to call texify twice, it's because makeglossaries needs to have a prebuild tex version on which it can inject the glossary. After injecting I want to get the final result.

Unfortunatelly, it does't work as I want. Hope you can help me.

Adrian
  • 55
  • 4

1 Answers1

3

Assuming you're running on OSX/Linux, you can make a quick bash script that just ignores any additional arguments, and use that script as your "cmd". Save the following in ~/bin as makeglossaries_main.sh:

#!/bin/bash
/path/to/makeglossaries main

then change the relevant line in your build system to:

"cmd": ["/home/adrian/bin/makeglossaries_main.sh"]

and you should be all set.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • But how can I keep the feature I get from the original call of texify: `"cmd": ["texify", "-b", "-p", "--tex-option=\"--synctex=1\""]`. It enables jumping to the position which has been last modified in your tex document. Will it be kept even by using the script? – Adrian Jun 17 '13 at 14:17
  • I'm not sure, since I don't know the full details of your build system. Feel free to update your question with the full contents of your `.sublime-build` file and I can take a look at it. – MattDMo Jun 17 '13 at 15:25
  • edited my question and extended it with the sublime-build file – Adrian Jun 18 '13 at 08:29
  • does your build system still work when you make the changes I suggested? – MattDMo Jun 18 '13 at 12:01
  • 1
    I created my own Makefile which I called easily by `"cmd": ["make", "all"]`. This solved my problem. Anyway, thanks for your time and your advice. – Adrian Jun 19 '13 at 08:39