
我在 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
有一條規則,稱為remove
from 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.aux
和jobname.toc
和jobname.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
。