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('"') ) }
For now I solved this issue using Windows PowerShell ISE and continue working from there. Furthermore, I added a custom command to my Notepad++ like described here:
https://superuser.com/questions/176678/how-to-launch-a-program-from-notepad#176685
<UserDefinedCommands>
<Command name="latexindent" Ctrl="yes" Alt="yes" Shift="yes" Key="">latexindent -d -w "$(FULL_CURRENT_PATH)"</Command>
<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox "$(FULL_CURRENT_PATH)"</Command>
<Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore "$(FULL_CURRENT_PATH)"</Command>
<Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome "$(FULL_CURRENT_PATH)"</Command>
<Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="70">safari "$(FULL_CURRENT_PATH)"</Command>
<Command name="Get php help" Ctrl="no" Alt="yes" Shift="no" Key="112">http://www.php.net/%20$(CURRENT_WORD)</Command>
<Command name="Google Search" Ctrl="no" Alt="yes" Shift="no" Key="113">http://www.google.com/search?q=$(CURRENT_WORD)</Command>
<Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">http://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command>
<Command name="Open file" Ctrl="no" Alt="yes" Shift="no" Key="116">$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_WORD)</Command>
<Command name="Open in another instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_WORD) -nosession -multiInst</Command>
<Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a "$(FULL_CURRENT_PATH)"</Command>
</UserDefinedCommands>
Like this I am able to use it from the IDE. Next step is a script iterating over all tex files using PowerShell ISE. Further step would be a Bash script on Jenkins.
Best Answer
TeX Live on Unix-like systems creates symbolic links from the
bin/
architecture directory to the relevant script, but the symbolic file links always omit the file extensions. For example,bin/x86_64-linux/latexindent
links to../../texmf-dist/scripts/latexindent/latexindent.pl
This is more consistent with Unix file naming schemes, but the scripts are often distributed with an extension for the benefit of non-Unix-like systems, such as Windows. Since the script is distributed and is on CTAN with the extension, the manual often references the script name with the extension. (If the package/script author isn't aware of this behaviour then they won't think to mention it in the manual.)
Conversely, TeX distributions on Windows may convert the script into an executable, in which case the extension becomes
.exe
(such aslatexindent.exe
).As @cmhughes commented below section 3 of the
latexindent
manual states: