I learned a lot in chat. Even if texinputs.yaml
could be made to set the TEXINPUTS
environment variable, this will have no affect on subsequent calls to the pdflatex
directive since each directive runs in a self contained environment. The problem with texinputs.yaml
as constructed is that in Linux export
is a special commands built into the Bash shell and therefore "confuses" arara
into thinking it is not a command.
The simplest, and possibly cleanest work around is to redefine the pdflatex.yaml
rule to take a texinputs
argument and then run pdflatex
in env
which allows setting of the environment variables. Specifically, the modified rule looks like
!config
# PDFLaTeX rule for arara
# author: Marco Daniel
# last edited by: Paulo Cereda
# requires arara 3.0+
identifier: pdflatex
name: PDFLaTeX
command: <arara> @{texinputs} pdflatex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}"
arguments:
- identifier: action
flag: <arara> --interaction=@{parameters.action}
- identifier: shell
flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")}
- identifier: synctex
flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")}
- identifier: draft
flag: <arara> @{isTrue(parameters.draft,"--draftmode")}
- identifier: options
flag: <arara> @{parameters.options}
- identifier: texinputs
flag: "env TEXINPUTS=@{parameters.texinputs}"
There are at least two problems with this approach: it ignores previously set values of TEXINPUTS
and cannot handle paths with spaces in them. It might be possible to work around both of these issues. A more general solution, but one that requires adding an additional script is to modify pdflatex.yaml
to be
!config
# PDFLaTeX rule for arara
# author: Marco Daniel
# last edited by: Paulo Cereda
# requires arara 3.0+
identifier: pdflatex
name: PDFLaTeX
commands:
- <arara> @{texinputs} '@{action} @{draft} @{shell} @{synctex} @{options} "@{file}"'
arguments:
- identifier: action
flag: <arara> --interaction=@{parameters.action}
- identifier: shell
flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")}
- identifier: synctex
flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")}
- identifier: draft
flag: <arara> @{isTrue(parameters.draft,"--draftmode")}
- identifier: options
flag: <arara> @{parameters.options}
- identifier: texinputs
flag: texinputs.sh "@{parameters.texinputs}"
default: pdflatex
and define a texinputs.sh
file as
#!/usr/bin/bash
TEMP=$(echo $1 | sed s#\"##g)
export TEXINPUTS=$TEMP:$TEXINPUTS
pdflatex $2
This handles the appending of a preexisting TEXINPUTS
as well as spaces in the path. I am hoping that there is a cleaner approach which handles a preexisting TEXINPUTS
as well as spaces and doesn't require an extra
script file.
First ensure that xindy
works with your distribution.
Even though an entry exists for Make Glossaries
in the build window (see figure below), it doesn't appear under the Commands
of Tools
menu:
There is no short cut available too. If somebody knows how to make use of this please feel free to edit the answer.
Alternative
You can define a user command:
Go To Options
→ Configure TeXstudio
. In the window that opens do the following:
Choose Build
and click.
Click Add
under User Commands
Fill : user1: Make Glossaries
and "C:/Program Files/MiKTeX 2.9/miktex/bin/makeglossaries.exe" %
. You can browse to the exe file also. Note that the path may be different for you. Don't forget the %
at the end.
Press OK
and come out
Now you will have a user menu for Make Glossaries
with a short cut:
Now you can pdflatex
Make Glossaries
and pdflatex
.
Happy Glossing :)
Additional note:
As noted by Speravir, you have to specify "texindy.bat" %.idx
instead of texindy.exe %.idx
as in the following window.
Edit:
There were some errors in your code. Try this:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[acronym,nomain,xindy]{glossaries}
\makeglossaries
\author{author}
\title{title}
\newacronym[longplural=Inmunoglobulinas]{IG}{IG}{Inmunoglobulina}
\begin{document}
test la \gls{IG} es vital en la protección del ternero hay 5 tipos de \glspl{IG}
\printglossaries
\end{document}
Best Answer
While arara comes with MiKTeX, the default rules do not. When I was calling
arara.exe
to the.tex
file, I was then instructing arara to callpdflatex
which corresponds to the default rulepdflatex.yaml
. Of course, since the default rules are not included in MiKTeX, this yielded an error. The simplest solution is to get the standalone version of arara from Github. You could perhaps also put a folder with the default rules inside the MiKTeX distribution file system, but I have not tested this.Once you have the standalone version installed, I recommend creating the user command in TeXstudio as:
Of course, customize the path to wherever you installed arara.
Cheers to Paulo Cereda and his crew for this wonderful tool!