5

I would like to autoindent my code under Kile using latexindent. I have TeXLive 2015 installed and I run arara on my tex file.

I tried to follow the manual instructions (p.5) for latexindent where it is said to copy indent.yaml to the directory of arara rules or to add the directory in which latexindent.pl resides to my araraconfig.yaml file. This last one doesn't exist in my TeXLive distribution nor the indent.yaml file, so I copied ident.yaml to arara rules directory but I get this error message:

I'm sorry, but the command from the 'Indent' task could not be found. Are you sure the command 'latexindent.pl -s -t -w "filename.tex" is correct, or even accessible from the system path?

Where is the problem?

1 Answer 1

4

I'm finally able to run indentlatex correctly and here is how I solved the problem

First one have to create a configuration file for arara: araraconfig.yaml. This file should be placed in your home directory /home/<yourusername> and should indicate the path of latexindent.pl file in your system. My araraconfig.yaml on my Linux machine looks like this:

config
paths:
- /usr/local/texlive/2015/texmf-dist/scripts/latexindent 

(The latexindent script comes with the 2015 TeX Live distribution).

Then one should copy indent.yaml in the arara rules directory (to be downloaded from here). At this stage it is still not possible to run latexindent, some modules must be installed (see documentation p. 17). For this, from the command line run:

cpan

If not installed, Linux will ask you to install it. Then from the CPAN prompt you could install missing moudules:

install YAML::Tiny
install Getopt::Long
install File::HomeDir

Once installation is finished, you can run latexindent from the command line:

latexindent

and to make it possible to run with arara, one last thing is needed, you should remove the .pl from the indent.yaml file. Here is the line that should be modified

command: @{ isWindows( "cmd /c latexindent.exe", "latexindent.pl" ) } @{silent} @{trace} @{localSettings} @{cruft}@{ isNotEmpty( cruft, '="'.concat(parameters.cruft).concat('"') ) } @{overwrite} @{onlyDefault} @{output} "@{file}" @{ isNotEmpty( output, '"'.concat(parameters.output).concat('"') ) }

1
  • 1
    Awesome, great work +1 from me :) I'll delete my answer :)
    – cmhughes
    Oct 1, 2015 at 22:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .