5

Following this answer, I fully installed arara from Github, then I tried to run the user command Arara from Texstudio menu on this simple code but I got an error

Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided.

what is the missing step?

% arara: pdflatex
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
Diaa
  • 9,599
  • 1
    Arara is installed as part of TeX Live, at least. Don't know about MikTeX. Why did you want the GitHub version especially? – cfr Jun 08 '16 at 00:26
  • I googled the way I can install arara, and I came across this answer. Unfortunately, I found this error not popular. What do you advise me to do now? – Diaa Jun 08 '16 at 00:29
  • Did you try on the command line? Did you try arara? Usually, it is arara unless it is specially capitalised for Windows. Are you using MikTeX? It is very strange if that answer is right as it would break Arara for every MikTeX user. Possible, of course. – cfr Jun 08 '16 at 00:30
  • I am very new to arara, I just want to use latexindent, and after some research, I found that arara can provide an easy way to do so. So, basically, this is my first time to come across arara. For your question, yes, I use MikTex, but I don't know know how to test arara.exe through command window. I am so sorry for lacking this info. – Diaa Jun 08 '16 at 00:34
  • I am sorry, I think I don't know how to use it. In this section https://github.com/cereda/arara#basic-use, I created this simple file, and I ran the user command then I got this error message. But I just noticed this sentence (Now when you run arara my-file, that directive (% arara: ...) will be seen and carried out as described by the pdflatex rule.). So, did I make it wrong or right way by running the user command directly on the file? – Diaa Jun 08 '16 at 00:48
  • 1
    I am sorry. I use arara but I don't know what a user command is. Maybe it is a Windows thing and you will need somebody who knows Windows to help you. The file looks right. I would then run arara <filename> or arara <filename.tex. arara is the command installed by TeX Live in my case. As I say, I'm just not familiar with the terminology. On the systems I use, something is a command or not. – cfr Jun 08 '16 at 00:59
  • The solution was very simple yet tricky. But I wonder how arara configuration file wasn't provided in the first place with the default installation files. – Diaa Jun 08 '16 at 19:38
  • Have you reported it to MikTeX? – cfr Jun 08 '16 at 22:08
  • Actually no; I think it is something associated with arara installation package itself, since even when I downloaded the arara installation file from its own website, I found this weird drawback of lacking its own configuration file. – Diaa Jun 08 '16 at 22:33
  • Yes, but the real question is why it needs such a file at all in MikTeX when it doesn't in TL. – cfr Jun 08 '16 at 23:25
  • 1
    Deeply sorry for being so late to this question. A couple of remarks: sadly, for version 3.0, I could not manage to integrate arara into MiKTeX, so the only way is through either a manual deployment or the graphical installer. I will try to contact the MiKTeX team when version 4.0 is ready, so MiKTeX users will also get updates. Regarding your question, I am a bit puzzled, as arara does not require a configuration file to exist at all; the error being reported is about a malformed existing configuration file located in your home directory (in Windows, it's C:\Users\Paulo, for example). – Paulo Cereda Jul 30 '16 at 13:19
  • @PauloCereda If the error message says arara cannot proceed until a proper configuration file is provided, may I suggest modifying it so that it does not suggest that a configuration file is required? Something like arara cannot proceed with the current file. Either remove the malformed configuration file completely (to run with default settings) or correct it (to use custom settings)? – cfr Jul 30 '16 at 22:41
  • @cfr: it's a great idea! I will take a look on what I wrote for version 4.0, as it's a complete rewrite from this version, so maybe I already provided a better error message. Thank you! :) – Paulo Cereda Jul 31 '16 at 10:48

1 Answers1

4

Finally, I figured it out with the help of this answer.

The complete steps to configure arara in TeXstudio on Windows are as follows:

  1. Download and install arara source file from Github

  2. If you let arara be installed in the default directory (i.e. C:\Program Files (x86)\arara), create arara configuration file araraconfig.yaml in the same directory and edit it to make search path

    config
    paths:
    C:\Program Files (x86)\arara\rules
    
  3. In Texstudio > Options > Configure Texstudio > Build > User Commands, add the following command

    user0:Arara "C:\Program Files (x86)\arara\arara.exe" -v -l % 
    

    enter image description here

  4. Test arara by running the user command Arara you have just created on the following sample file

    % arara: pdflatex
    \documentclass{article}
    \begin{document}
    Hello, world!
    \end{document}
    

    then you will get SUCCESS in the Messages window and an output PDF file.

Needless to say, the directory C:\Program Files (x86)\arara should be changed in the previous steps according to the actual one arara installed in.


Update 1

I tried to run arara after installing it in MiKTeX package manager, but I didn't know how to make it working. So far, the first approach seems to be working and straightforward.


Update 2

Because I have been notified in the comments that this configuration file is not a valid one, I tried to completely remove this config. file and run arara again. It works flawlessly without any warning of missing configuration file. At the first run, it seems that the arara was looking for a configuration file in its installation directory regardless its content.

I completely removed arara installation directory (since uninstaller.jar has no effect) and reinstalled it again without any creation of configuration file, and it works again without any problems.

Maybe, there is some weird thing happened after I created that invalid configuration file (at the very first run) that made everything works normally from then onwards.

Diaa
  • 9,599
  • 1
    I am lost, as arara does not need a configuration file at all. And the configuration file lookup procedure only checks your home directory (top level). I believe there might be some malformed configuration file in your home directory which was causing the issue. I would need more information about your system as a whole to see what's going on. Did you paste something from the manual into a file? Sometimes we get problems with hidden characters and wrong indentation. – Paulo Cereda Jul 30 '16 at 13:22
  • Thanks for considering my question. I have Windows 10 x64 and MikTex 2.9.6022. No, I didn't copy anything from the manual. My failed trial was to try download arara last version as of 9th July and run it directly on a file, but I got the warning message of missing configuration file. And it worked perfectly after creating a configuration file the way I did in my answer. – Diaa Jul 30 '16 at 15:14
  • 1
    I am deeply sorry, but I still don't follow. The config file you posted in your answer is not a valid YAML file. If arara were supposed to read this file, it would certainly raise an error. The tool won't search directories other than $HOME for a config file, and it works without it, unless you have a malformed one. The default rule path is automatically detected by the application. So either we have a misunderstanding, or you just found the most obscure bug ever. If the latter, please help me fill an issue here. – Paulo Cereda Jul 30 '16 at 17:46
  • I know you are one of the package authors, but why this config file is not valid? although it looks exactly the example ones given in the package documentation (chapter 6). Additionally, I don't remember exactly what happened when I tried to search for a config. file after I saw this error message. I could reproduce the error if you wish and I try to put my issue there without misleading wrong statements. – Diaa Jul 30 '16 at 18:47
  • 1
    The code you posted does not look exactly like the examples in chapter 6 of the manual. There is a ! missing before config, a : after paths, and - before the given path. – Torbjørn T. Jul 30 '16 at 21:50
  • @PauloCereda Probably the config file is irrelevant here and step 2 has no effect. It doesn't stop Arara from working because, although invalid, Arara never reads it. So the effect is simply the default no-config-file-found with a bit more typing to get there? – cfr Jul 30 '16 at 22:34
  • @TorbjørnT., thanks for pointing that out. I completely removed that invalid configuration file and arara was happy and working. Still, I don't understand why it needed any configuration file at the very first run, then it didn't bother looking at that file later on. – Diaa Jul 31 '16 at 03:37
  • 1
    Computers are witchcraft, basically. :) I improved the error detection in version 4.0, so the log file contains a lot of helpful information, including which config file was used. I am glad (and relieved) things worked out in the end. I will still check this issue with my Windows 10 VM later on. – Paulo Cereda Jul 31 '16 at 10:51
  • @PauloCereda, kindly, be informed that uninstaller.jar is not working at all for me. It just showed a windows of running uninstallation, but I found arara working fine and its directory is intact afterwards. – Diaa Jul 31 '16 at 12:50
  • @Diaa: I will take a look later on, maybe it's a IzPack problem. Thanks for the report. – Paulo Cereda Jul 31 '16 at 14:17