texwork 上 arara 的語法,以 preamble.tex 作為輸入文件,用於產生許多不同的文檔

texwork 上 arara 的語法,以 preamble.tex 作為輸入文件,用於產生許多不同的文檔

我在 Windows 上安裝了 arara,並且透過從 cmd shell 運行它可以看出它工作正常。將以下語法放入「模板」序言中,我將其用作輸入文件來產生足以編譯文檔的多個文檔,否則我每次都必須在每個 tex 文件中提及文件名。我正在使用 texwork。

如何讓 texwork 在文件更改時自動建立文件?

% arara: xelatex
% arara: xelatex
% arara: clean: { files: [ *.aux, *.bbl ] }
% arara: clean: { files: [ *.bcf, *.cod ] } 
% arara: clean: { files: [ *.blg, *.lof ] }
% arara: clean: { files: [ *.lot, *.out ] } 
% arara: clean: { files: [ *.toc, *.log ] } 

答案1

有一條規則,稱為removefrom Paulo Cereda

!config
# Clean rule for arara
# author: Paulo Cereda
# requires arara 3.0+
identifier: remove
name: Remove
command: <arara> @{remove}
arguments:
- identifier: remove
  default: <arara> @{isNotEmpty(item, isWindows("cmd /c del", "rm -f").concat(' "').concat(getBasename(file))concat('.').concat(item).concat('"'))}

這將刪除

% arara: remove: { items: [ aux , toc , bbl ] }

文件jobname.auxjobname.tocjobname.bbl.

如果你想刪除像 和 一樣的文件*.aux*.toc並且*.bbl具有任何名稱,請嘗試這個微小的更改:

!config
# Clean rule for arara
# requires arara 3.0+
identifier: removex
name: RemoveX
command: <arara> @{removex}
arguments:
- identifier: removex
  default: <arara> @{isNotEmpty(item, isWindows("cmd /c del", "rm -f").concat(' "').concat('*')concat('.').concat(item).concat('"'))}

這將刪除

% arara: removex: {items: [ png , tmp ] }

所有副檔名為*.png和 的檔案*.tmp

相關內容