# Can I have TeXworks run my command line argument?

I am using a solution to an issue I am having with generating a glossary found here:

List of glossaries not displaying

As part of the solution, Christian Hupfer suggests compiling with the following command pipeline

pdflatex foo

makeindex -s foo.ist -o foo.gls foo.glo

pdflatex foo


I noticed that when I am trying to compile in TeXworks using the pdfLaTeX + makeindex + bibtex command, that it fails to generate the glossary because it is missing the foo.ist, foo.gls, foo.gls files.

To solve this, I simply wrote a one line batch file:

makeindex -s workingpaper.ist -o workingpaper.gls workingpaper.glo


which I run prior to compiling my document with the aforementioned pdfLaTeX + makeindex + bibtex option.

However, looking through the TeXworks preferences under typesetting options, I get the sense that I don't need the batch file at all and I can set TeXworks to do it for me without the need to rewrite the batch file for every paper I have that I intend to include a glossary (i.e., substituting "foo" with the appropriate file name).

I've tried editing some of the existing processing tools in the preference menu to get an idea of how I might do this, but the syntax is sufficiently foreign to me that I am completely lost.

I am running MikTeX 2.9 incase this is helpful information.

• You can also use the makeglossaries script. Since I am Linux user by 'birth' I am accustomed to use command line in order to get my work done. I see that Windows user are 'forced' to use such 'tools' like TexWorks, however. I believe, that those tools often use %f or similar in the tools configuration dialogs in order to indicate the name of the .tex file – user31729 Dec 30 '18 at 17:28
• The pdflatex+makeindex+bibtex command uses texify and passing options to it is imho quite a pain. Better create a new tool in the preferences that calls makeglossaries and pass the file name with $basename. – Ulrike Fischer Dec 30 '18 at 17:35 • @UlrikeFischer After some googling with what was suggested, I still cannot figure out how to do this. I tried creating a tool in the tool configuration using the program:makeglossaries.exe with three arguments: "-s %.ist", "-o %.gls %.glo" and "$basename". When I try to run this tool it returns the error "Requested style file '%.ist' doesn't exist. – Echan Dec 30 '18 at 18:14
• replace the % by \$basename – Ulrike Fischer Dec 30 '18 at 18:15