James-Yu/LaTeX-Workshop

Document the interaction between LaTeX-Workshop and arara

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.

This feature request is related to #1996 (now closed and locked, so I could not add this proposal in there), where some issues between the ways arara and LaTeX-Workshop behave have been pointed out.
These issues are :

  • Compilations started with arara without the --verbose option are not in interactive mode, but do not show error/warning logging that could be parsed by LaTeX-Workshop, And with --verbose option show the logging, but may lead to hidden zombie child processes in case of a compilation fail.
  • Due to the way LaTeX-Workshop parses error / warning logging, some compilation options are added to the user-defined options e.g. with the pdflatex recipe, but not with arara since the "args": field cannot pass the same instruction on the fly to arara.

In order to help newcomers to LaTex-Workshop (as myself) to setup their compilation process easily, I propose to document these observations in the Wiki, so other people do not ask the same question over and over again.
Also (see below), I propose a set of customized arara rules for LaTeX-Workshop, so that everything works (mostly) out-of-the-box

Describe alternatives you've considered
In order to avoid using additional options to the default arara rules, e.g.

% arara: pdflatex: {
% arara: --> interaction: nonstopmode,
% arara: --> options: ['-file-line-error','-max-print-line=200'],
% arara: --> synctex: yes,
% arara: --> }

in each document, I propose the following process :

  1. Define a araraconfig.yaml file placed in the user home to configure arara to look for user-defined rules, where araraconfig.yaml is
!config
paths:
- absolute/path/to/my/custom/arara/rules
  1. Place the following lwpdflatex.yaml rule and potentially others (but I mostly use pdflatex) in the absolute/path/to/my/custom/arara/rules directory
!config
# arara configuration file compatible with LaTeX-Workshop behavior
# based on the original pdflatex rule
# requires arara 5.1.3+
identifier: lwpdflatex
name: PDFLaTeX
authors:
- BambOoxX (https://github.com/BambOoxX)
commands:
- name: PDFLaTeX engine with LaTeX-Workshop presets
  command: >
    @{
        return getCommand('pdflatex', '-interaction=nonstopmode', '-synctex=1','-file-line-error','-max-print-line=200',reference.getName());
    }
  1. When compiling the document, the new rule becomes :
% arara: lwpdflatex

Additional context

As I did for #1996 , I will also discuss this topic with the developpers of arara to see if they would be willing to document this on their side, or even to ship such specific rules with arara itself.

In any case, keep up the good work, this software is very nice !