Using pipes in arara command?
up vote
0
down vote
favorite
I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).
This is my first attempt:
!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:
When I try to use it, however, I get this:
cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE
So it seems like the pipe character and the pdflatex
command are being passed as arguments to cat
, instead of the cat
output being redirected to pdflatex
(as when I run something like cat preamble.tex file.tex | pdflatex
from the command line, for instance).
So is there a way to make the command redirection work with arara?
arara
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
up vote
0
down vote
favorite
I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).
This is my first attempt:
!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:
When I try to use it, however, I get this:
cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE
So it seems like the pipe character and the pdflatex
command are being passed as arguments to cat
, instead of the cat
output being redirected to pdflatex
(as when I run something like cat preamble.tex file.tex | pdflatex
from the command line, for instance).
So is there a way to make the command redirection work with arara?
arara
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
1
You can always put it in a script and run the script.
– cfr
May 31 at 23:51
@cfr Ah, I should have thought of that, haha. 🤦🏻♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35
4
The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26
@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).
This is my first attempt:
!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:
When I try to use it, however, I get this:
cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE
So it seems like the pipe character and the pdflatex
command are being passed as arguments to cat
, instead of the cat
output being redirected to pdflatex
(as when I run something like cat preamble.tex file.tex | pdflatex
from the command line, for instance).
So is there a way to make the command redirection work with arara?
arara
I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).
This is my first attempt:
!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:
When I try to use it, however, I get this:
cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE
So it seems like the pipe character and the pdflatex
command are being passed as arguments to cat
, instead of the cat
output being redirected to pdflatex
(as when I run something like cat preamble.tex file.tex | pdflatex
from the command line, for instance).
So is there a way to make the command redirection work with arara?
arara
arara
edited Jun 1 at 4:59
asked May 31 at 23:05
dbmrq
554213
554213
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
1
You can always put it in a script and run the script.
– cfr
May 31 at 23:51
@cfr Ah, I should have thought of that, haha. 🤦🏻♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35
4
The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26
@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58
add a comment |
1
You can always put it in a script and run the script.
– cfr
May 31 at 23:51
@cfr Ah, I should have thought of that, haha. 🤦🏻♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35
4
The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26
@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58
1
1
You can always put it in a script and run the script.
– cfr
May 31 at 23:51
You can always put it in a script and run the script.
– cfr
May 31 at 23:51
@cfr Ah, I should have thought of that, haha. 🤦🏻♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35
@cfr Ah, I should have thought of that, haha. 🤦🏻♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35
4
4
The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26
The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26
@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58
@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:
https://github.com/dbmrq/solo
There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:
!config
identifier: solo
name: Solo
command:
- solo "@{file}"
arguments:
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:
https://github.com/dbmrq/solo
There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:
!config
identifier: solo
name: Solo
command:
- solo "@{file}"
arguments:
add a comment |
up vote
0
down vote
This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:
https://github.com/dbmrq/solo
There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:
!config
identifier: solo
name: Solo
command:
- solo "@{file}"
arguments:
add a comment |
up vote
0
down vote
up vote
0
down vote
This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:
https://github.com/dbmrq/solo
There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:
!config
identifier: solo
name: Solo
command:
- solo "@{file}"
arguments:
This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:
https://github.com/dbmrq/solo
There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:
!config
identifier: solo
name: Solo
command:
- solo "@{file}"
arguments:
answered Jun 2 at 22:45
dbmrq
554213
554213
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f434410%2fusing-pipes-in-arara-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You can always put it in a script and run the script.
– cfr
May 31 at 23:51
@cfr Ah, I should have thought of that, haha. 🤦🏻♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35
4
The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26
@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58