I use this function to compile my latex documents in gVim with arara:
function! CompileTex()
silent write!
call setqflist([])
echon "compiling with arara ..."
exec "lcd %:h"
setlocal makeprg=arara\ -v\ %
silent make!
if !empty(getqflist())
copen
wincmd J
else
cclose
redraw
echon "successfully compiled"
endif
endfunction
And have the following mapping to call it:
nnoremap <buffer> <F6> :call CompileTex()<CR>
I use Latex-Box in order to parse and filter the tex build output nicely. Everything works fine (arara is really awesome) but there is one thing that I would like to know if it can be improved. Suppose I have the following document:
\documentclass{article}
% arara: pdflatex: {synctex: yes, action: nonstopmode, options: "-file-line-error-style"}
% arara: bibtex
% arara: pdflatex: {synctex: yes, action: nonstopmode, options: "-file-line-error-style"}
% arara: pdflatex: {synctex: yes, action: nonstopmode, options: "-file-line-error-style"}
\begin{document}
\section{Foo}
\label{sec:foo}
\ref{sec:foo}
\end{document}
As you can see in the image, when I compile the document the quickfix window (showing errors and warnings) shows the warning of the first call to the compiler (which goes away after compiling again). Is there some way to tell arara to ignore warnings until the last call?
.
Note: i) I know I can just add one directive and avoid the problem but this is just a MWE of what happens in larger documents. ii) If this question doesn't belong here please delete it (I actually posted it in arara's github issues but received no answer yet).
Edit: I would (also) like to know if the compilation time can be reduced by telling arara to run pdftex only once and only perform successive runs if they are really needed (for instance to correct cross-references).
action: batchmodefor the first runs. – Heiko Oberdiek Sep 16 '13 at 19:24action:batchmode, however I would also like for the compiler to stop in the first run if (and only if) errors were encountered (while ignoring warnings). Is that possible? – petobens Sep 16 '13 at 19:49nonstopmodedoes not necessarily stop at the first error. You would needscrollmode. It includes console output with the warnings again. – Heiko Oberdiek Sep 16 '13 at 20:06nonstopmodedoesn't stop at the first error but I was wondering whether arara could stop on the first run if there were errors and only continue with the following runs if no errors were found. Can the-halt-on-errorbe used in the first run? In fact I would like to know if arara can only perform the successive runs if they are really necessary, but I think that this is a feature that Paulo plans to introduce in arara 4. – petobens Sep 16 '13 at 20:12batchmodeornonstopmode? – petobens Sep 16 '13 at 20:37batchmode? Maybe you can post it as an answer? – petobens Sep 17 '13 at 03:09