I am learning with latexindent. I would like to follow up this question: How is automatic indentation done for subfiles with arara and latexindent? and ask for clarification:
Is there required any modification to arara rule indent.yaml or to configuration of latexindent? If I look on arara.yaml shipped with TeXlive 2019 on Windows 10, I see no support for option "files."
Code posted in linked question does not work for me with error exit code 1; indent.log says it cant find the file stated in "files" option...
As MWE may be used answer in linked question or this code:
Main.tex
% arara: indent: { overwrite: yes, files: [ main.tex, chapter/chapter.tex ] }
% arara: lualatex: { shell: yes }
\documentclass [a4paper, 12pt, twoside, openright] {book}
\usepackage{fontspec}
\usepackage{import}
\begin{document}
Main document test itemization.
\begin{itemize}
\item first item
\item second item
\item another item
\end{itemize}
\chapter{Imported chapter}
\import{chapter/}{chapter.tex}
\end{document}
/chapter/chapter.tex
Imported chapter itemization:
\begin{itemize}
\item first item
\item second item
\item another item
\end{itemize}
EDIT: Everything works, if I pot file "chapter.tex" into same folder as "Main.tex" and change arara indent rule accordingly. How can I specify search path to latexindent to find "chapter.tex" in different folder than "Main.tex" ?
EDIT 2: Modifyed MWE to get one run (the first one on file Main.tex, which is the one with arara directives) and posting content of indent.log created:
INFO: latexindent.exe version 3.7, 2019-07-13, a script to indent .tex files
latexindent.exe lives here: C:/texlive/2019/bin/win32/
Sat Sep 14 17:05:07 2019
Filename: chapter.tex
INFO: Processing switches:
-w|--overwrite: Overwrite mode active, will make a back up of chapter.tex first
INFO: Directory for backup files and indent.log: .
INFO: YAML settings read: defaultSettings.yaml
Reading defaultSettings.yaml from C:/texlive/2019/bin/win32/defaultSettings.yaml
Reading defaultSettings.yaml (2nd attempt, TeXLive, Windows) from C:/texlive/2019/bin/win32/../../texmf-dist/scripts/latexindent/defaultSettings.yaml
INFO: YAML settings read: indentconfig.yaml or .indentconfig.yaml
Home directory is C:/Users/user (didn't find either indentconfig.yaml or .indentconfig.yaml)
To specify user settings you would put indentconfig.yaml here: C:/Users/user/indentconfig.yaml
Alternatively, you can use the hidden file .indentconfig.yaml as: C:/Users/user/.indentconfig.yaml
FATAL: I couldn't find chapter.tex, are you sure it exists?.
No indentation done.
Exiting.
EDIT: Contents of arara.log file as requested by Mr. Hughes: Ah, date is in my local setting. Hope it doesnt mind :)
15 Zář 2019 21:31:39.958 INFO - Welcome to arara 4.0 (revision 1)!
15 Zář 2019 21:31:39.959 INFO - -----------------------------------------------------------------
15 Zář 2019 21:31:39.961 INFO - ::: arara @ C:\texlive\2019\texmf-dist\scripts\arara
15 Zář 2019 21:31:39.961 INFO - ::: Java 1.8.0_221, Oracle Corporation
15 Zář 2019 21:31:39.961 INFO - ::: C:\Program Files (x86)\Java\jre1.8.0_221
15 Zář 2019 21:31:39.961 INFO - ::: Windows 10, x86, 10.0
15 Zář 2019 21:31:39.961 INFO - ::: user.home @ C:\Users\Tomáš Kruliš
15 Zář 2019 21:31:39.961 INFO - ::: user.dir @ D:\Dokumenty\Prace SUJB\Sujb migrace\Compilation arara speed test\TestLatexindent\MWE
15 Zář 2019 21:31:39.961 INFO - ::: CF @ [none]
15 Zář 2019 21:31:39.962 INFO - -----------------------------------------------------------------
15 Zář 2019 21:31:39.962 INFO - Processing 'main.tex' (size: 451 bytes, last modified: 09/15/2019 21:29:57), please wait.
15 Zář 2019 21:31:39.968 INFO - I found a potential pattern in line 1: indent: { overwrite: yes, files: [ main.tex, chapters/chapter.tex ] }
15 Zář 2019 21:31:39.968 INFO - I found a potential pattern in line 2: lualatex: { shell: yes }
15 Zář 2019 21:31:40.004 INFO - I found a potential directive: Directive: { identifier: indent, parameters: {overwrite=yes, files=[main.tex, chapters/chapter.tex]}, conditional: { NONE }, lines: [1] }
15 Zář 2019 21:31:40.005 INFO - I found a potential directive: Directive: { identifier: lualatex, parameters: {shell=yes}, conditional: { NONE }, lines: [2] }
15 Zář 2019 21:31:40.006 INFO - All directives were validated. We are good to go.
15 Zář 2019 21:31:40.006 INFO - -------------------------- DIRECTIVES ---------------------------
15 Zář 2019 21:31:40.006 INFO - Directive: { identifier: indent, parameters: {reference=D:\Dokumenty\Prace SUJB\Sujb migrace\Compilation arara speed test\TestLatexindent\MWE\Main.tex, file=Main.tex, overwrite=yes}, conditional: { NONE }, lines: [1] }
15 Zář 2019 21:31:40.006 INFO - Directive: { identifier: indent, parameters: {reference=D:\Dokumenty\Prace SUJB\Sujb migrace\Compilation arara speed test\TestLatexindent\MWE\chapters\chapter.tex, file=chapter.tex, overwrite=yes}, conditional: { NONE }, lines: [1] }
15 Zář 2019 21:31:40.006 INFO - Directive: { identifier: lualatex, parameters: {shell=yes, file=main.tex, reference=D:\Dokumenty\Prace SUJB\Sujb migrace\Compilation arara speed test\TestLatexindent\MWE\main.tex}, conditional: { NONE }, lines: [2] }
15 Zář 2019 21:31:40.006 INFO - -----------------------------------------------------------------
15 Zář 2019 21:31:40.007 INFO - I am ready to interpret rule 'indent'.
15 Zář 2019 21:31:40.008 INFO - Rule location: 'C:\texlive\2019\texmf-dist\scripts\arara\rules'
15 Zář 2019 21:31:40.131 INFO - I am ready to interpret task 'The latexindent.pl script' from rule 'Indent'.
15 Zář 2019 21:31:40.131 INFO - System command: [ latexindent, -w, Main.tex ]
15 Zář 2019 21:31:40.851 INFO - ---------------------- BEGIN OUTPUT BUFFER ----------------------
15 Zář 2019 21:31:40.851 INFO - % arara: indent: { overwrite: yes, files: [ main.tex, chapters/chapter.tex ] }
% arara: lualatex: { shell: yes }
\documentclass [a4paper, 12pt, twoside, openright] {book}
\usepackage{fontspec}
\usepackage{import}
\begin{document}
Main document test itemization.
\begin{itemize}
\item first item
\item second item
\item another item
\end{itemize}
\chapter{Imported chapter}
\import{chapter/}{chapter.tex}
\end{document}
15 Zář 2019 21:31:40.851 INFO - ----------------------- END OUTPUT BUFFER -----------------------
15 Zář 2019 21:31:40.854 INFO - Task result: SUCCESS
15 Zář 2019 21:31:40.855 INFO - I am ready to interpret rule 'indent'.
15 Zář 2019 21:31:40.855 INFO - Rule location: 'C:\texlive\2019\texmf-dist\scripts\arara\rules'
15 Zář 2019 21:31:40.860 INFO - I am ready to interpret task 'The latexindent.pl script' from rule 'Indent'.
15 Zář 2019 21:31:40.861 INFO - System command: [ latexindent, -w, chapter.tex ]
15 Zář 2019 21:31:41.548 INFO - ---------------------- BEGIN OUTPUT BUFFER ----------------------
15 Zář 2019 21:31:41.548 INFO - I couldn't find chapter.tex, are you sure it exists?.
No indentation done.
Exiting. at C:\Users\TOMKRU~1\AppData\Local\Temp\par-546f6de19a204b72756c699a\cache-e5261462a856ca06b13fe24504351eecc6e6a781\inc\lib/LatexIndent/FileExtension.pm line 88.
15 Zář 2019 21:31:41.548 INFO - ----------------------- END OUTPUT BUFFER -----------------------
15 Zář 2019 21:31:41.549 INFO - Task result: FAILURE
15 Zář 2019 21:31:41.551 INFO - Total: 1.54 seconds
As requested by Mr. Cereda, I am adding arara.log file after using variant 1, using the "reference" arara key:
17 Zář 2019 14:26:38.494 INFO - Welcome to arara 4.0 (revision 1)!
17 Zář 2019 14:26:38.494 INFO - -----------------------------------------------------------------
17 Zář 2019 14:26:38.494 INFO - ::: arara @ C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara
17 Zář 2019 14:26:38.494 INFO - ::: Java 1.8.0_221, Oracle Corporation
17 Zář 2019 14:26:38.494 INFO - ::: C:\Program Files\Java\jre1.8.0_221
17 Zář 2019 14:26:38.494 INFO - ::: Windows 7, x86, 6.1
17 Zář 2019 14:26:38.494 INFO - ::: user.home @ C:\Users\tomas.krulis
17 Zář 2019 14:26:38.510 INFO - ::: user.dir @ Z:\TestLatexindent\MWE
17 Zář 2019 14:26:38.510 INFO - ::: CF @ [none]
17 Zář 2019 14:26:38.510 INFO - -----------------------------------------------------------------
17 Zář 2019 14:26:38.510 INFO - Processing 'Main.tex' (size: 501 bytes, last modified: 09/17/2019 14:26:25), please wait.
17 Zář 2019 14:26:38.510 INFO - I found a potential pattern in line 1: indent: { overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, Z:\TestLatexindent\MWE\chapters\chapter.tex ] }
17 Zář 2019 14:26:38.510 INFO - I found a potential pattern in line 2: lualatex: { shell: yes }
17 Zář 2019 14:26:38.572 ERROR - There was a problem with the provided YAML map in a directive (1). This part is quite tricky, since it involves aspects of the underlying data serialization format. There are more details available on this exception:
17 Zář 2019 14:26:38.572 ERROR - while scanning a plain scalar
in 'string', line 1, column 32:
{ overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, ...
^
found unexpected ':'
in 'string', line 1, column 33:
{ overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, ...
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.
17 Zář 2019 14:26:38.572 INFO - Total: 0.00 seconds
It is tested on machine with MikTeX distribution (other machines I have access to have TeXlive 2019).
Looks straightforward.
But if I remove "Z:" with "." ; I am getting different error:
17 Zář 2019 14:32:45.364 INFO - Welcome to arara 4.0 (revision 1)!
17 Zář 2019 14:32:45.364 INFO - -----------------------------------------------------------------
17 Zář 2019 14:32:45.364 INFO - ::: arara @ C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara
17 Zář 2019 14:32:45.364 INFO - ::: Java 1.8.0_221, Oracle Corporation
17 Zář 2019 14:32:45.364 INFO - ::: C:\Program Files\Java\jre1.8.0_221
17 Zář 2019 14:32:45.364 INFO - ::: Windows 7, x86, 6.1
17 Zář 2019 14:32:45.364 INFO - ::: user.home @ C:\Users\tomas.krulis
17 Zář 2019 14:32:45.364 INFO - ::: user.dir @ Z:\TestLatexindent\MWE
17 Zář 2019 14:32:45.364 INFO - ::: CF @ [none]
17 Zář 2019 14:32:45.364 INFO - -----------------------------------------------------------------
17 Zář 2019 14:32:45.379 INFO - Processing 'Main.tex' (size: 499 bytes, last modified: 09/17/2019 14:32:31), please wait.
17 Zář 2019 14:32:45.379 INFO - I found a potential pattern in line 1: indent: { overwrite: yes, reference: [ .\TestLatexindent\MWE\main.tex, .\TestLatexindent\MWE\chapters\chapter.tex ] }
17 Zář 2019 14:32:45.379 INFO - I found a potential pattern in line 2: lualatex: { shell: yes }
17 Zář 2019 14:32:45.442 INFO - I found a potential directive: Directive: { identifier: indent, parameters: {overwrite=yes, reference=[.\TestLatexindent\MWE\main.tex, .\TestLatexindent\MWE\chapters\chapter.tex]}, conditional: { NONE }, lines: [1] }
17 Zář 2019 14:32:45.442 INFO - I found a potential directive: Directive: { identifier: lualatex, parameters: {shell=yes}, conditional: { NONE }, lines: [2] }
17 Zář 2019 14:32:45.442 ERROR - I read a directive (1) and found out that the key 'reference' was used. This key is reserved, so you cannot use it. But do not worry, this should be an easy fix. Just replace it by another name.
17 Zář 2019 14:32:45.442 INFO - Total: 0.00 seconds
Which might be syntax problem? As far as I dont know, how to write absolute path in the "reference" field correctly? I am completely sure that all script and rule paths are correct, since I have all rules and TeX binaries in one place, and I have replaced the current rule with the one you suggested.
EDIT2: Using the solution #1 in answer provided by Mr. Cereda, with also arararc.yaml present in "main" project directory. I have redefined arara directives like so:
% arara: indent: { overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, Z:\TestLatexindent\MWE\chapter\chapter.tex ] }
% arara: lualatex: { shell: yes }
Result is failed compilation with this arara.log content:
18 Zář 2019 08:51:06.724 INFO - Welcome to arara 4.0 (revision 2)!
18 Zář 2019 08:51:06.724 INFO - -----------------------------------------------------------------
18 Zář 2019 08:51:06.724 INFO - ::: arara @ C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara
18 Zář 2019 08:51:06.724 INFO - ::: Java 1.8.0_221, Oracle Corporation
18 Zář 2019 08:51:06.724 INFO - ::: C:\Program Files\Java\jre1.8.0_221
18 Zář 2019 08:51:06.724 INFO - ::: Windows 7, x86, 6.1
18 Zář 2019 08:51:06.740 INFO - ::: user.home @ C:\Users\tomas.krulis
18 Zář 2019 08:51:06.740 INFO - ::: user.dir @ Z:\TestLatexindent\MWE
18 Zář 2019 08:51:06.740 INFO - ::: CF @ Z:\TestLatexindent\MWE\arararc.yaml
18 Zář 2019 08:51:06.740 INFO - -----------------------------------------------------------------
18 Zář 2019 08:51:06.740 INFO - Processing 'main.tex' (size: 549 bytes, last modified: 09/18/2019 08:28:43), please wait.
18 Zář 2019 08:51:06.740 INFO - I found a potential pattern in line 1: indent: { overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, Z:\TestLatexindent\MWE\chapter\chapter.tex ] }
18 Zář 2019 08:51:06.740 INFO - I found a potential pattern in line 2: lualatex: { shell: yes }
18 Zář 2019 08:51:06.756 ERROR - There was a problem with the provided YAML map in a directive (1). This part is quite tricky, since it involves aspects of the underlying data serialization format. There are more details available on this exception:
18 Zář 2019 08:51:06.756 ERROR - while scanning a plain scalar
in 'string', line 1, column 32:
{ overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, ...
^
found unexpected ':'
in 'string', line 1, column 33:
{ overwrite: yes, reference: [ Z:\TestLatexindent\MWE\main.tex, ...
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.
18 Zář 2019 08:51:06.756 INFO - Total: 0.00 seconds
I guess this might be because I am writing the reference value in wrong syntax. If I omit the "Z:" in both reference "values," creating directives like this:
% arara: indent: { overwrite: yes, reference: [ \TestLatexindent\MWE\main.tex, \TestLatexindent\MWE\chapter\chapter.tex ] }
% arara: lualatex: { shell: yes }
I am getting failed compilation with this arara.log:
18 Zář 2019 09:24:21.417 INFO - Welcome to arara 4.0 (revision 2)!
18 Zář 2019 09:24:21.433 INFO - -----------------------------------------------------------------
18 Zář 2019 09:24:21.433 INFO - ::: arara @ C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara
18 Zář 2019 09:24:21.433 INFO - ::: Java 1.8.0_221, Oracle Corporation
18 Zář 2019 09:24:21.433 INFO - ::: C:\Program Files\Java\jre1.8.0_221
18 Zář 2019 09:24:21.433 INFO - ::: Windows 7, x86, 6.1
18 Zář 2019 09:24:21.433 INFO - ::: user.home @ C:\Users\tomas.krulis
18 Zář 2019 09:24:21.433 INFO - ::: user.dir @ Z:\TestLatexindent\MWE
18 Zář 2019 09:24:21.433 INFO - ::: CF @ Z:\TestLatexindent\MWE\arararc.yaml
18 Zář 2019 09:24:21.433 INFO - -----------------------------------------------------------------
18 Zář 2019 09:24:21.433 INFO - Processing 'Main.tex' (size: 545 bytes, last modified: 09/18/2019 09:23:57), please wait.
18 Zář 2019 09:24:21.448 INFO - I found a potential pattern in line 1: indent: { overwrite: yes, reference: [ \TestLatexindent\MWE\main.tex, \TestLatexindent\MWE\chapter\chapter.tex ] }
18 Zář 2019 09:24:21.448 INFO - I found a potential pattern in line 2: lualatex: { shell: yes }
18 Zář 2019 09:24:21.448 INFO - I found a potential directive: Directive: { identifier: indent, parameters: {overwrite=yes, reference=[\TestLatexindent\MWE\main.tex, \TestLatexindent\MWE\chapter\chapter.tex]}, conditional: { NONE }, lines: [1] }
18 Zář 2019 09:24:21.448 INFO - I found a potential directive: Directive: { identifier: lualatex, parameters: {shell=yes}, conditional: { NONE }, lines: [2] }
18 Zář 2019 09:24:21.448 ERROR - I read a directive (1) and found out that the key 'reference' was used. This key is reserved, so you cannot use it. But do not worry, this should be an easy fix. Just replace it by another name.
18 Zář 2019 09:24:21.448 INFO - Total: 0.00 seconds
I am doing testing of suggested rules used to solve my issue by replacing the original one, indent.yaml, directly in arara scripts directory, so the updated indent.yaml should be picked up the same way as all other arara rules are.
For solution #2, with the new "directory" option, if I have understood GitHub conversation correctly, I am using such arara directives:
% arara: indent: { overwrite: yes }
% arara: indent: { overwrite: yes, directory: 'chapter', files: [ chapter.tex ] }
% arara: lualatex: { shell: yes }
I am getting also failed compilation with this arara.log:
18 Zář 2019 10:31:23.040 INFO - Welcome to arara 4.0 (revision 2)!
18 Zář 2019 10:31:23.040 INFO - -----------------------------------------------------------------
18 Zář 2019 10:31:23.040 INFO - ::: arara @ C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara
18 Zář 2019 10:31:23.040 INFO - ::: Java 1.8.0_221, Oracle Corporation
18 Zář 2019 10:31:23.040 INFO - ::: C:\Program Files\Java\jre1.8.0_221
18 Zář 2019 10:31:23.040 INFO - ::: Windows 7, x86, 6.1
18 Zář 2019 10:31:23.055 INFO - ::: user.home @ C:\Users\tomas.krulis
18 Zář 2019 10:31:23.055 INFO - ::: user.dir @ Z:\TestLatexindent\MWE
18 Zář 2019 10:31:23.055 INFO - ::: CF @ Z:\TestLatexindent\MWE\arararc.yaml
18 Zář 2019 10:31:23.055 INFO - -----------------------------------------------------------------
18 Zář 2019 10:31:23.055 INFO - Processing 'Main.tex' (size: 491 bytes, last modified: 09/18/2019 10:31:10), please wait.
18 Zář 2019 10:31:23.055 INFO - I found a potential pattern in line 1: indent: { overwrite: yes }
18 Zář 2019 10:31:23.055 INFO - I found a potential pattern in line 2: indent: { overwrite: yes, directory: 'chapter', files: [ chapter.tex ] }
18 Zář 2019 10:31:23.055 INFO - I found a potential pattern in line 3: lualatex: { shell: yes }
18 Zář 2019 10:31:23.071 INFO - I found a potential directive: Directive: { identifier: indent, parameters: {overwrite=yes}, conditional: { NONE }, lines: [1] }
18 Zář 2019 10:31:23.071 INFO - I found a potential directive: Directive: { identifier: indent, parameters: {overwrite=yes, directory=chapter, files=[chapter.tex]}, conditional: { NONE }, lines: [2] }
18 Zář 2019 10:31:23.071 INFO - I found a potential directive: Directive: { identifier: lualatex, parameters: {shell=yes}, conditional: { NONE }, lines: [3] }
18 Zář 2019 10:31:23.071 INFO - All directives were validated. We are good to go.
18 Zář 2019 10:31:23.071 INFO - -------------------------- DIRECTIVES ---------------------------
18 Zář 2019 10:31:23.071 INFO - Directive: { identifier: indent, parameters: {overwrite=yes, file=Main.tex, reference=Z:\TestLatexindent\MWE\Main.tex}, conditional: { NONE }, lines: [1] }
18 Zář 2019 10:31:23.071 INFO - Directive: { identifier: indent, parameters: {reference=Z:\TestLatexindent\MWE\chapter.tex, file=chapter.tex, overwrite=yes, directory=chapter}, conditional: { NONE }, lines: [2] }
18 Zář 2019 10:31:23.071 INFO - Directive: { identifier: lualatex, parameters: {shell=yes, file=Main.tex, reference=Z:\TestLatexindent\MWE\Main.tex}, conditional: { NONE }, lines: [3] }
18 Zář 2019 10:31:23.071 INFO - -----------------------------------------------------------------
18 Zář 2019 10:31:23.071 INFO - I am ready to interpret rule 'indent'.
18 Zář 2019 10:31:23.071 INFO - Rule location: 'C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara\rules'
18 Zář 2019 10:31:23.211 INFO - I am ready to interpret task 'The latexindent.pl script' from rule 'Indent'.
18 Zář 2019 10:31:23.211 INFO - System command: [ latexindent, -w, Main.tex ]
18 Zář 2019 10:31:24.085 INFO - ---------------------- BEGIN OUTPUT BUFFER ----------------------
18 Zář 2019 10:31:24.085 INFO - % arara: indent: { overwrite: yes }
% arara: indent: { overwrite: yes, directory: 'chapter', files: [ chapter.tex ] }
% arara: lualatex: { shell: yes }
\documentclass [a4paper, 12pt, twoside, openright] {book}
\usepackage{fontspec}
\usepackage{import}
\begin{document}
Main document test itemization.
\begin{itemize}
\item first item
\item second item
\item another item
\end{itemize}
\chapter{Imported chapter}
\import{chapter/}{chapter.tex}
\end{document}
18 Zář 2019 10:31:24.085 INFO - ----------------------- END OUTPUT BUFFER -----------------------
18 Zář 2019 10:31:24.085 INFO - Task result: SUCCESS
18 Zář 2019 10:31:24.085 INFO - I am ready to interpret rule 'indent'.
18 Zář 2019 10:31:24.101 INFO - Rule location: 'C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara\rules'
18 Zář 2019 10:31:24.116 INFO - I am ready to interpret task 'The latexindent.pl script' from rule 'Indent'.
18 Zář 2019 10:31:24.116 INFO - System command: [ latexindent, -w, Z:\TestLatexindent\MWE\chapter.tex ] @ chapter
18 Zář 2019 10:31:24.927 INFO - ---------------------- BEGIN OUTPUT BUFFER ----------------------
18 Zář 2019 10:31:24.927 INFO - I couldn't find Z:\TestLatexindent\MWE\chapter.tex, are you sure it exists?.
No indentation done.
Exiting. at C:/Users/tomas.krulis/AppData/Local/Programs/MiKTeX 2.9/scripts/latexindent/LatexIndent/FileExtension.pm line 83.
18 Zář 2019 10:31:24.927 INFO - ----------------------- END OUTPUT BUFFER -----------------------
18 Zář 2019 10:31:24.927 INFO - Task result: FAILURE
18 Zář 2019 10:31:24.927 INFO - Total: 1.85 seconds
I have updated arara to revision 2 just before, also updated to new rule suggested in solution #2. As far as my understanding goes, arara is searching for "chapter.tex" not in directory "chapter," but in main directory.
Edit3: As requested, location of "indent.yaml" is:
C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara\rules
and content of "indent.yaml" dor solution #2 (new directory field) is as follows:
!config
identifier: indent
name: Indent
authors:
- Chris Hughes
- Paulo Cereda
commands:
- name: The latexindent.pl script
command: >
@{
if (isEmpty(directory)) {
return getCommand('latexindent', silent, trace, screenlog,
settings, cruft, overwrite, output, file,
modifylinebreaks, replacement, options, logfile);
}
else {
return getCommandWithWorkingDirectory(directory,
'latexindent', silent, trace, screenlog,
settings, cruft, overwrite, output, reference,
modifylinebreaks, replacement, options, logfile);
}
}
arguments:
- identifier: silent
flag: >
@{
isTrue(parameters.silent, '-s')
}
- identifier: overwrite
flag: >
@{
isTrue(parameters.overwrite, '-w')
}
- identifier: trace
flag: >
@{
if ([ 'default', 'complete' ].contains(parameters.trace)) {
return isTrue(parameters.trace == 'default', '-t', '-tt');
}
else {
throwError('You provided an invalid value for trace.');
}
}
- identifier: screenlog
flag: >
@{
isTrue(parameters.screenlog, '-sl')
}
- identifier: modifylinebreaks
flag: >
@{
isTrue(parameters.modifylinebreaks, '-m')
}
- identifier: settings
flag: >
@{
check = parameters.containsKey('where');
location = check ? parameters.where : '';
if ([ 'local', 'onlydefault' ].contains(parameters.settings)) {
return isTrue(parameters.settings == 'local', isTrue(check,
'-l='.concat(location), '-l'), '-d');
}
else {
throwError('You provided an invalid value for settings.');
}
}
- identifier: cruft
flag: >
@{
'-c='.concat(parameters.cruft)
}
- identifier: logfile
flag: >
@{
[ '-g', parameters.logfile ]
}
- identifier: output
flag: >
@{
[ '-o', parameters.output ]
}
- identifier: where
flag: >
@{
check = parameters.containsKey('settings');
setting = check ? parameters.settings : '';
if (setting != 'local') {
throwError('This key requires a local setting.');
}
}
- identifier: replacement
flag: >
@{
opts = [ 'full' : '-r', 'noverb' : '-rv', 'noindent' : '-rr' ];
if (opts.keySet().contains(parameters.replacement)) {
return opts[parameters.replacement];
}
else {
throwError('You provided an invalid value for replacement.');
}
}
- identifier: options
flag: >
@{
if (isList(parameters.options)) {
return parameters.options;
}
else {
throwError('I was expecting a list of options.');
}
}
- identifier: directory
flag: >
@{
entry = toFile(parameters.directory);
if (entry.isFile()) {
throwError('I was expecting a directory.');
}
else {
if (!isSubdirectory(entry)) {
throwError('Only subdirectories are allowed.');
}
else {
return entry;
}
}
}
For configuration file (you mean arararc.yaml , yes?) in main folder I have used setup already mentioned:
!config
paths:
- '.'
Thinking that this might be the cause of error, I have changed arararc.yaml to point exactly into folder, in which before mentioned "indent.yaml" is placed, like so:
!config
paths:
- 'C:\Users\tomas.krulis\AppData\Local\Programs\MiKTeX 2.9\scripts\arara\rules'