Ich verfasse das mal als AW.
Um aus dem Dokument heraus Kommandozeilenbefehle, z.B. `batch`-Dateien auszuführen, eignet sich  [`arara`][1] (Weiteres: [hier][2]).
Von Haus aus hat arara allerdings keine entsprechende Regel; @Clemens hat aber eine solche erstellt:
    !config
    # Console rule for arara
    # author: Clemens Niederberger
    # requires arara 3.0+
    identifier: console
    name: Console
    command: <arara> @{command}
    arguments:
    - identifier: command
      flag: <arara> @{parameters.command}
In der Form 
    % arara: console: { command: <Konsolen-Befehl> }
können wir nun Kommandozeilenbefehle ausführen.
  [1]: http://matheplanet.de/matheplanet/nuke/html/viewtopic.php?rd2&topic=194815&start=0#p1451943
http://matheplanet.de/matheplanet/nuke/html/viewtopic.php?topic=194815&post_id=1433518
  [2]: http://texwelt.de/wissen/themen/arara/