I am running Windows 7 and a recent (Dec 2014) distribution of TeX Live and a recent version of TeXmaker.
When invoking arara myFile.tex in the command line it returns "indent SUCCESS" and when opening myFile.tex it is indeed beautified/correctly indented.
However when setting up a macro in TeXmaker (via Users->Commands->User-defined "arara %.tex") TeXmaker returns:
Process started
Process exited normally
However the code is not beautified. Closing and opening the file does not help.
Do you have any ideas on how to make this work?
PS a minimal working example (working from command line - but not via TeXmaker) is:
% arara: indent
% arara: indent: {overwrite: yes}
\documentclass[10pt]{article}
\begin{document}
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{document}
PPS indent.log file output (when invoking via TeXmaker)
Thu Dec 11 15:41:00 2014
latexindent.pl version 2.0R, a script to indent .tex files
latexindent.pl lives here: C:/texlive/2014/bin/win32/
>
Directory for backup files and indent.log: .
file: tikpkzTEST.tex Reading defaultSettings.yaml from C:/texlive/2014/bin/win32/defaultSettings.yaml
Home directory is C:/Users/Björn To specify user settings you would put indentconfig.yaml here: C:/Users/Björn/indentconfig.yaml
Backup procedure: (...various backups...) Overwriting file: tikpkzTEST.tex
Line Count of tikpkzTEST.tex: 10 Line Count of indented tikpkzTEST.tex: 10
Line counts of original file and indented file match
PPPS arara.log file
11 Dec 2014 18:50:09.524 INFO Arara - Welcome to arara!
11 Dec 2014 18:50:09.524 INFO Arara - Processing file 'tikpkzTEST.tex', please wait.
11 Dec 2014 18:50:09.524 INFO DirectiveExtractor - Reading directives from
tikpkzTEST.tex.
11 Dec 2014 18:50:09.524 TRACE DirectiveExtractor - Directive found in line 1 with indent.
11 Dec 2014 18:50:09.524 TRACE DirectiveExtractor - Directive found in line 2 with indent: {overwrite: yes}.
11 Dec 2014 18:50:09.584 INFO DirectiveParser - Parsing directives.
11 Dec 2014 18:50:09.584 INFO TaskDeployer - Deploying tasks into commands.
11 Dec 2014 18:50:09.584 TRACE TaskDeployer - Task 'indent' found in >'C:\texlive\2014\texmf-dist\scripts\arara\rules'.
11 Dec 2014 18:50:09.728 TRACE TaskDeployer - Task 'indent' found in 'C:\texlive\2014\texmf-dist\scripts\arara\rules'.
11 Dec 2014 18:50:09.738 INFO CommandTrigger - Ready to run commands.
11 Dec 2014 18:50:09.738 INFO CommandTrigger - Running 'Indent'.
11 Dec 2014 18:50:09.738 TRACE CommandTrigger - Command: cmd /c latexindent.exe "tikpkzTEST.tex"
11 Dec 2014 18:50:10.048 TRACE CommandTrigger - Output logging:
11 Dec 2014 18:50:10.048 TRACE CommandTrigger - % arara: indent
% arara: indent: {overwrite: yes}
\documentclass[10pt]{article} \begin{document} \begin{enumerate} \item a \item b \item c \end{enumerate} \end{document} 11 Dec 2014 18:50:10.048 INFO CommandTrigger - 'Indent' was successfully executed. 11 Dec 2014 18:50:10.048 INFO CommandTrigger - Running 'Indent'. 11 Dec 2014 18:50:10.048 TRACE CommandTrigger - Command: cmd /c latexindent.exe -w >"tikpkzTEST.tex" 11 Dec 2014 18:50:10.348 TRACE CommandTrigger - Output logging: 11 Dec 2014 18:50:10.348 TRACE CommandTrigger - % arara: indent % arara: indent: {overwrite: yes}
\documentclass[10pt]{article}
\begin{document}
\begin{enumerate}
\item a
\item b
\item c
\end{enumerate}
\end{document}
11 Dec 2014 18:50:10.348 INFO CommandTrigger - 'Indent' was successfully executed.
11 Dec 2014 18:50:10.348 INFO CommandTrigger - All commands were successfully executed.
11 Dec 2014 18:50:10.348 INFO Arara - Done.
ararabut you can indent your code using the TeXmaker menu, or not? – Sigur Dec 11 '14 at 13:46indentis a nice tool for automatic code indentation (latexindent from cmhughes). I do not think that TeXmaker is able to do such work. – LaRiFaRi Dec 11 '14 at 13:49\documentclass[10pt]{article} \pagestyle{empty} \begin{document} \begin{enumerate} \item sahddjhhsv \item asdasdfasdf \end{enumerate} fcaf dfgdddsaf \end{document} Texmaker can not autoindent code, so I was trying this workaround. As said; arara correctly indents the code from the command line, but not from TeXmaker.
– Björn Dec 11 '14 at 13:51indent.logfile in that directory. What does that say? – Dec 11 '14 at 14:29ararafor automation or do simultaneously ? could you run arara with this flags in user command of texmakerarara %.tex --verbose --logto know what the arara.log says – texenthusiast Dec 11 '14 at 16:18:)– Paulo Cereda Dec 11 '14 at 18:50ararais working, but TeXmaker is not aware of changes in the current file. I'll take a closer look. – Paulo Cereda Dec 12 '14 at 06:46latexindent.plbeing used :) It's a good sign that it works from the command line. You only need oneararadirective forlatexindent; in your MWE you have two directives--the first doesn't overwrite your source, the second does. I'll have a look at this as well--I haven't used TeXmaker before... – cmhughes Dec 12 '14 at 15:32latexindent -w %.texTexmaker does not detect the new file changes butlatexidentworks fine and file is indented well. IMOCheck for external changesworks only if the file had been modified outside TeXmaker enviroment eg: like a command line interface how Bjorn tried. I don't know if TeXmakercheck for external changesneed to corrected or fool the texmaker bylatexindentfile overwriting process. – texenthusiast Dec 12 '14 at 16:15Can't locate YAML/Tiny.pm in @INC (you may need to install the YAML::Tiny module) (@INC contains:C:/texlive/2014/tlpkg/tlperl/lib c:/texlive/2014/tlpkg/tlperl/lib .) at c:/texlive/2014/texmf-dist/scripts/latexindent/latexindent.pl line 20.when i run at command windowlatexindent, Is there something i am doing wrong ? any workarounds ? – texenthusiast Dec 12 '14 at 22:58YAML::Tinyand other needed modules for latexindent via CPAN in strawberry perl 64 bit win8.helloworld.plruns well.perl latexindent.plworks well when run from the TL 2014 scripts directory. for some reasonlatexindent.exedoes not work and throws me above error. I think perl need not be installed as perl lib come packaged with TeXLive(may be it misses YAML::Tiny module). solatexindent.exeshould work right without a strawberry perl installed ? – texenthusiast Dec 13 '14 at 06:25latexindent.exeshould not try searching for modules in TeXLivetlperlfolder and it should rather look for strawberry perl path and with proper syncing of perl version modules. – texenthusiast Dec 13 '14 at 06:53Tiny.pmfrom C:\Strawberry\perl\site\lib to C:\texlive\2014\tlpkg\tlperl\lib and any missingFile:HomeDirmodules from strawberry perl lib (similar version of perl in TeXLive ) to tlperl lib folder thenlatexindent.exeshould fine. BTW IMO Bjorn Error of not updating the .tex file after latexindent in usercommand may be an issue pertaining to TeXmaker editor not arara or latexindent. Bjorn may be you post this issue tracker – texenthusiast Dec 13 '14 at 15:44latexindent.plchoose the appropriate modules from the distribution, not fromtlperl. – cmhughes Dec 13 '14 at 18:09Reload Document from fileto see updated the current file with indented contents. For me latexindent.exe works from commandline and texmaker detects the file changes automatically and it prompts for a option "Document has changed outside of Texmaker do wish to reload the documents with changes have it overwritten etc..". Note you may useAdd PathinOptions-->ConfigureTeXmaker to give texmaker user commands to access any binary paths of strawberry perl. Also you may execute external commands usingToolsmenu -->Open Terminal– texenthusiast Dec 13 '14 at 18:52latexindentshould now work more smoothly on TeXLive for Windows. As you probably know, TL2014 is frozen, but it should be part of TL2015. If you'd like to grab it manually, you can getlatexindent.exefromhttps://github.com/cmhughes/latexindent.pl; by using the standalone executable, there shouldn't be any need to tangle withperldistributions.... hopefully – cmhughes Jun 05 '15 at 14:54