1

The following Linux command executes the program <program name> on all tex files in the current directory and subdirectories.

find . -name '*.tex' -exec `<program name>` -w $1 -- {} \;

How can arara be used to execute a program in a similar way?

For example, how would I run latexindent on all tex files without having to specify files as in:

% arara: indent: { overwrite : yes, files: [ chapter/foo.tex, header.tex ]  }

?

cfr
  • 198,882
anderstood
  • 2,196
  • 19
  • 35
  • 1
    +1 this question isn't necessarily about latexindent. You could equally ask, for example, how do I tell arara to compile all .tex files using pdflatex in a directory? – cmhughes Sep 21 '17 at 21:38
  • @cmhughes Right, I rewrote the question :) – anderstood Sep 21 '17 at 21:59
  • Why not use find? That is, why do you want to use arara which is really designed to work with single files, as I understand it. – cfr Sep 21 '17 at 23:21
  • @cfr Just to type one easy command (arara main) instead of two... That's basically the same reason why I use arara instead of pdflatex, then biber, then etc. – anderstood Sep 22 '17 at 00:31
  • I wasn't suggesting you do them one-by-one. find will handle them all. A shell script can handle the find, if need be. You don't need this all the time, do you? I think of arara invocations as best suited to the things I want to happen every time I compile a document. (Really, just the compilation command, it turns out, though I know some people are fussier and want the biblio and stuff every time, too. Or maybe they just have faster computers.) – cfr Sep 22 '17 at 00:37
  • @cfr My use would be batch indenting, so that dozens of tex files become indented. I usually compile with pdflatex, and in average every ten compilations, I use arara. I would like to indent my codes about as often as I call arara. Of course I could make a script calling find and also arara. I was just wondering whether it could be combined with arara (I agree it's not a big deal). – anderstood Sep 22 '17 at 03:17
  • Oh, I'm the opposite. I mostly compile with arara. I don't when I'm compiling TeX SE examples or am getting errors. (arara just runs the binary with relevant options - I've never got multiple arara lines in a single document to work, but I don't compile the bibliography and stuff as often anyway.) – cfr Sep 22 '17 at 03:27
  • The best way to do it would be to write your own custom rule. (Have a look at how the clean rule is implemented in clean.yaml.) I think arara shouldn't be able to execute any arbitrary command for security reasons. (Imagine if the same method was used with clean to find and delete all .tex files.) – Nicola Talbot Sep 22 '17 at 10:46

0 Answers0